This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Update the WinCE files to the new cross model
[perl5.git] / win32 / win32.h
1 /* WIN32.H
2  *
3  * (c) 1995 Microsoft Corporation. All rights reserved.
4  *              Developed by hip communications inc.
5  *
6  *    You may distribute under the terms of either the GNU General Public
7  *    License or the Artistic License, as specified in the README file.
8  */
9 #ifndef  _INC_WIN32_PERL5
10 #define  _INC_WIN32_PERL5
11
12 #ifndef _WIN32_WINNT
13 #  define _WIN32_WINNT 0x0500     /* needed for CreateHardlink() etc. */
14 #endif
15
16 #ifdef PERL_IS_MINIPERL
17 /* this macro will remove Winsock only on miniperl, PERL_IMPLICIT_SYS and
18  * makedef.pl create dependencies that will keep Winsock linked in even with
19  * this macro defined, even though sockets will be umimplemented from a script
20  * level in full perl
21  */
22 #  define WIN32_NO_SOCKETS
23 #endif
24
25 #ifdef WIN32_NO_SOCKETS
26 #  undef HAS_SOCKET
27 #  undef HAS_GETPROTOBYNAME
28 #  undef HAS_GETPROTOBYNUMBER
29 #  undef HAS_GETPROTOENT
30 #  undef HAS_GETNETBYNAME
31 #  undef HAS_GETNETBYADDR
32 #  undef HAS_GETNETENT
33 #  undef HAS_GETSERVBYNAME
34 #  undef HAS_GETSERVBYPORT
35 #  undef HAS_GETSERVENT
36 #  undef HAS_GETHOSTBYNAME
37 #  undef HAS_GETHOSTBYADDR
38 #  undef HAS_GETHOSTENT
39 #  undef HAS_SELECT
40 #  undef HAS_IOCTL
41 #  undef HAS_NTOHL
42 #  undef HAS_HTONL
43 #  undef HAS_HTONS
44 #  undef HAS_NTOHS
45 #  define WIN32SCK_IS_STDSCK
46 #endif
47
48 #if defined(PERL_IMPLICIT_SYS)
49 #  define DYNAMIC_ENV_FETCH
50 #  define HAS_GETENV_LEN
51 #  define prime_env_iter()
52 #  define WIN32IO_IS_STDIO              /* don't pull in custom stdio layer */
53 #  define WIN32SCK_IS_STDSCK            /* don't pull in custom wsock layer */
54 #  ifdef PERL_GLOBAL_STRUCT
55 #    error PERL_GLOBAL_STRUCT cannot be defined with PERL_IMPLICIT_SYS
56 #  endif
57 #  define win32_get_privlib PerlEnv_lib_path
58 #  define win32_get_sitelib PerlEnv_sitelib_path
59 #  define win32_get_vendorlib PerlEnv_vendorlib_path
60 #endif
61
62 #ifdef __GNUC__
63 #  ifndef __int64               /* some versions seem to #define it already */
64 #    define __int64 long long
65 #  endif
66 #  define Win32_Winsock
67 #ifdef __cplusplus
68 /* Mingw32 gcc -xc++ objects to __attribute((unused)) at least */
69 #undef  PERL_UNUSED_DECL
70 #define PERL_UNUSED_DECL
71 #endif
72 #endif
73
74
75 /* Define DllExport akin to perl's EXT,
76  * If we are in the DLL then Export the symbol,
77  * otherwise import it.
78  */
79
80 /* now even GCC supports __declspec() */
81 /* miniperl has no reason to export anything */
82 #if defined(PERL_IS_MINIPERL) && !defined(UNDER_CE) && defined(_MSC_VER)
83 #  define DllExport
84 #else
85 #  if defined(PERLDLL)
86 #    define DllExport __declspec(dllexport)
87 #  else
88 #    define DllExport __declspec(dllimport)
89 #  endif
90 #endif
91
92 /* The Perl APIs can only be called directly inside the perl5xx.dll.
93  * All other code has to import them.  By declaring them as "dllimport"
94  * we tell the compiler to generate an indirect call instruction and
95  * avoid redirection through a call thunk.
96  *
97  * The XS code in the re extension is special, in that it redefines
98  * core APIs locally, so don't mark them as "dllimport" because GCC
99  * cannot handle this situation.
100  */
101 #if !defined(PERLDLL) && !defined(PERL_EXT_RE_BUILD)
102 #  ifdef __cplusplus
103 #    define PERL_CALLCONV extern "C" __declspec(dllimport)
104 #    ifdef _MSC_VER
105 #      define PERL_CALLCONV_NO_RET extern "C" __declspec(dllimport) __declspec(noreturn)
106 #    endif
107 #  else
108 #    define PERL_CALLCONV __declspec(dllimport)
109 #    ifdef _MSC_VER
110 #      define PERL_CALLCONV_NO_RET __declspec(dllimport) __declspec(noreturn)
111 #    endif
112 #  endif
113 #else /* MSVC noreturn support inside the interp */
114 #  ifdef _MSC_VER
115 #    define PERL_CALLCONV_NO_RET __declspec(noreturn)
116 #  endif
117 #endif
118
119 #ifdef _MSC_VER
120 #  define PERL_STATIC_NO_RET __declspec(noreturn) static
121 #  define PERL_STATIC_INLINE_NO_RET __declspec(noreturn) PERL_STATIC_INLINE
122 #endif
123
124 #define  WIN32_LEAN_AND_MEAN
125 #include <windows.h>
126
127 /*
128  * Bug in winbase.h in mingw-w64 4.4.0-1 at least... they
129  * do #define GetEnvironmentStringsA GetEnvironmentStrings and fail
130  * to declare GetEnvironmentStringsA.
131  */
132 #if defined(__MINGW64__) && defined(GetEnvironmentStringsA) && !defined(UNICODE)
133 #ifdef __cplusplus
134 extern "C" {
135 #endif
136 #undef GetEnvironmentStringsA
137 WINBASEAPI LPCH WINAPI GetEnvironmentStringsA(VOID);
138 #define GetEnvironmentStrings GetEnvironmentStringsA
139 #ifdef __cplusplus
140 }
141 #endif
142 #endif
143
144 #ifdef   WIN32_LEAN_AND_MEAN            /* C file is NOT a Perl5 original. */
145 #define  CONTEXT        PERL_CONTEXT    /* Avoid conflict of CONTEXT defs. */
146 #endif /*WIN32_LEAN_AND_MEAN */
147
148 #ifndef TLS_OUT_OF_INDEXES
149 #define TLS_OUT_OF_INDEXES (DWORD)0xFFFFFFFF
150 #endif
151
152 #include <dirent.h>
153 #include <io.h>
154 #include <process.h>
155 #include <stdio.h>
156 #include <direct.h>
157 #include <stdlib.h>
158 #include <stddef.h>
159 #include <fcntl.h>
160 #ifndef EXT
161 #include "EXTERN.h"
162 #endif
163
164 struct tms {
165         long    tms_utime;
166         long    tms_stime;
167         long    tms_cutime;
168         long    tms_cstime;
169 };
170
171 #ifndef SYS_NMLN
172 #define SYS_NMLN        257
173 #endif
174
175 struct utsname {
176     char sysname[SYS_NMLN];
177     char nodename[SYS_NMLN];
178     char release[SYS_NMLN];
179     char version[SYS_NMLN];
180     char machine[SYS_NMLN];
181 };
182
183 #ifndef START_EXTERN_C
184 #undef EXTERN_C
185 #ifdef __cplusplus
186 #  define START_EXTERN_C extern "C" {
187 #  define END_EXTERN_C }
188 #  define EXTERN_C extern "C"
189 #else
190 #  define START_EXTERN_C
191 #  define END_EXTERN_C
192 #  define EXTERN_C
193 #endif
194 #endif
195
196 #define  STANDARD_C     1
197 #define  DOSISH         1               /* no escaping our roots */
198 #define  OP_BINARY      O_BINARY        /* mistake in in pp_sys.c? */
199
200 /* read() and write() aren't transparent for socket handles */
201 #ifndef WIN32_NO_SOCKETS
202 #  define PERL_SOCK_SYSREAD_IS_RECV
203 #  define PERL_SOCK_SYSWRITE_IS_SEND
204 #endif
205
206 #define PERL_NO_FORCE_LINK              /* no need for PL_force_link_funcs */
207
208 #define ENV_IS_CASELESS
209
210 #define PIPESOCK_MODE   "b"             /* pipes, sockets default to binmode */
211
212 /* access() mode bits */
213 #ifndef R_OK
214 #  define       R_OK    4
215 #  define       W_OK    2
216 #  define       X_OK    1
217 #  define       F_OK    0
218 #endif
219
220 /* for waitpid() */
221 #ifndef WNOHANG
222 #  define WNOHANG       1
223 #endif
224
225 #define PERL_GET_CONTEXT_DEFINED
226
227 /* Compiler-specific stuff. */
228
229 /* VC uses non-standard way to determine the size and alignment if bit-fields */
230 /* MinGW will compile with -mms-bitfields, so should use the same types */
231 #define PERL_BITFIELD8  unsigned char
232 #define PERL_BITFIELD16 unsigned short
233 #define PERL_BITFIELD32 unsigned int
234
235 #ifdef _MSC_VER                 /* Microsoft Visual C++ */
236
237 #ifndef UNDER_CE
238 typedef long            uid_t;
239 typedef long            gid_t;
240 typedef unsigned short  mode_t;
241 #endif
242
243 #pragma  warning(disable: 4102) /* "unreferenced label" */
244
245 #if _MSC_VER < 1800
246 #define isnan           _isnan  /* Defined already in VC++ 12.0 */
247 #endif
248 #ifdef UNDER_CE /* revisit what function this becomes celib vs corelibc, prv warning here*/
249 #  undef snprintf
250 #endif
251 #define snprintf        _snprintf
252 #define vsnprintf       _vsnprintf
253
254 #ifdef USING_MSVC6
255 /* VC6 has broken NaN semantics: NaN == NaN returns true instead of false */
256 #define NAN_COMPARE_BROKEN 1
257 #endif
258
259 /* on VC2003, msvcrt.lib is missing these symbols */
260 #if _MSC_VER >= 1300 && _MSC_VER < 1400
261 #  pragma intrinsic(_rotl64,_rotr64)
262 #endif
263
264 #endif /* _MSC_VER */
265
266 #ifdef __MINGW32__              /* Minimal Gnu-Win32 */
267
268 typedef long            uid_t;
269 typedef long            gid_t;
270 #ifndef _environ
271 #define _environ        environ
272 #endif
273 #define flushall        _flushall
274 #define fcloseall       _fcloseall
275 #ifndef isnan
276 #define isnan           _isnan  /* ...same libraries as MSVC */
277 #endif
278
279 #ifndef _O_NOINHERIT
280 #  define _O_NOINHERIT  0x0080
281 #  ifndef _NO_OLDNAMES
282 #    define O_NOINHERIT _O_NOINHERIT
283 #  endif
284 #endif
285
286 /* <stdint.h>, pulled in by <io.h> as of mingw-runtime-3.3, typedef's
287  * (u)intptr_t but doesn't set the _(U)INTPTR_T_DEFINED defines */
288 #ifdef _STDINT_H
289 #  ifndef _INTPTR_T_DEFINED
290 #    define _INTPTR_T_DEFINED
291 #  endif
292 #  ifndef _UINTPTR_T_DEFINED
293 #    define _UINTPTR_T_DEFINED
294 #  endif
295 #endif
296
297 #ifndef CP_UTF8
298 #  define CP_UTF8       65001
299 #endif
300
301 #endif /* __MINGW32__ */
302
303 #ifndef _INTPTR_T_DEFINED
304 typedef int             intptr_t;
305 #  define _INTPTR_T_DEFINED
306 #endif
307
308 #ifndef _UINTPTR_T_DEFINED
309 typedef unsigned int    uintptr_t;
310 #  define _UINTPTR_T_DEFINED
311 #endif
312
313 START_EXTERN_C
314
315 /* For UNIX compatibility. */
316
317 #ifdef PERL_CORE
318 extern  uid_t   getuid(void);
319 extern  gid_t   getgid(void);
320 extern  uid_t   geteuid(void);
321 extern  gid_t   getegid(void);
322 extern  int     setuid(uid_t uid);
323 extern  int     setgid(gid_t gid);
324 extern  int     kill(int pid, int sig);
325 extern  int     killpg(int pid, int sig);
326 #ifndef USE_PERL_SBRK
327 extern  void    *sbrk(ptrdiff_t need);
328 #  define HAS_SBRK_PROTO
329 #endif
330 extern  char *  getlogin(void);
331 extern  int     chown(const char *p, uid_t o, gid_t g);
332 extern  int     mkstemp(const char *path);
333 #endif
334
335 #undef   Stat
336 #define  Stat           win32_stat
337
338 #undef   init_os_extras
339 #define  init_os_extras Perl_init_os_extras
340
341 DllExport void          Perl_win32_init(int *argcp, char ***argvp);
342 DllExport void          Perl_win32_term(void);
343 DllExport void          Perl_init_os_extras(void);
344 DllExport void          win32_str_os_error(void *sv, DWORD err);
345 DllExport int           RunPerl(int argc, char **argv, char **env);
346
347 typedef struct {
348     HANDLE      childStdIn;
349     HANDLE      childStdOut;
350     HANDLE      childStdErr;
351     /*
352      * the following correspond to the fields of the same name
353      * in the STARTUPINFO structure. Embedders can use these to
354      * control the spawning process' look.
355      * Example - to hide the window of the spawned process:
356      *    dwFlags = STARTF_USESHOWWINDOW;
357      *    wShowWindow = SW_HIDE;
358      */
359     DWORD       dwFlags;
360     DWORD       dwX;
361     DWORD       dwY;
362     DWORD       dwXSize;
363     DWORD       dwYSize;
364     DWORD       dwXCountChars;
365     DWORD       dwYCountChars;
366     DWORD       dwFillAttribute;
367     WORD        wShowWindow;
368 } child_IO_table;
369
370 DllExport void          win32_get_child_IO(child_IO_table* ptr);
371 DllExport HWND          win32_create_message_window(void);
372
373 extern int              my_fclose(FILE *);
374 extern char *           win32_get_privlib(const char *pl, STRLEN *const len);
375 extern char *           win32_get_sitelib(const char *pl, STRLEN *const len);
376 extern char *           win32_get_vendorlib(const char *pl, STRLEN *const len);
377
378 #ifdef PERL_IMPLICIT_SYS
379 extern void             win32_delete_internal_host(void *h);
380 #endif
381
382 extern int              win32_get_errno(int err);
383
384 extern const char * const               staticlinkmodules[];
385
386 END_EXTERN_C
387
388 typedef  char *         caddr_t;        /* In malloc.c (core address). */
389
390 /*
391  * handle socket stuff, assuming socket is always available
392  */
393 #include <sys/socket.h>
394 #include <netdb.h>
395
396 #ifdef MYMALLOC
397 #define EMBEDMYMALLOC   /**/
398 /* #define USE_PERL_SBRK        /**/
399 /* #define PERL_SBRK_VIA_MALLOC /**/
400 #endif
401
402 #ifdef PERL_TEXTMODE_SCRIPTS
403 #  define PERL_SCRIPT_MODE              "r"
404 #else
405 #  define PERL_SCRIPT_MODE              "rb"
406 #endif
407
408 /*
409  * Now Win32 specific per-thread data stuff
410  */
411
412 /* Leave the first couple ids after WM_USER unused because they
413  * might be used by an embedding application, and on Windows
414  * version before 2000 we might end up eating those messages
415  * if they were not meant for us.
416  */
417 #define WM_USER_MIN     (WM_USER+30)
418 #define WM_USER_MESSAGE (WM_USER_MIN)
419 #define WM_USER_KILL    (WM_USER_MIN+1)
420 #define WM_USER_MAX     (WM_USER_MIN+1)
421
422 struct thread_intern {
423     /* XXX can probably use one buffer instead of several */
424     char                Wstrerror_buffer[512];
425     struct servent      Wservent;
426     char                Wgetlogin_buffer[128];
427     int                 Winit_socktype;
428     char                Wcrypt_buffer[30];
429 #    ifdef USE_RTL_THREAD_API
430     void *              retv;   /* slot for thread return value */
431 #    endif
432     BOOL               Wuse_showwindow;
433     WORD               Wshowwindow;
434 };
435
436 #define HAVE_INTERP_INTERN
437 typedef struct {
438     long        num;
439     DWORD       pids[MAXIMUM_WAIT_OBJECTS];
440     HANDLE      handles[MAXIMUM_WAIT_OBJECTS];
441 } child_tab;
442
443 #ifdef USE_ITHREADS
444 typedef struct {
445     long        num;
446     DWORD       pids[MAXIMUM_WAIT_OBJECTS];
447     HANDLE      handles[MAXIMUM_WAIT_OBJECTS];
448     HWND        message_hwnds[MAXIMUM_WAIT_OBJECTS];
449     char        sigterm[MAXIMUM_WAIT_OBJECTS];
450 } pseudo_child_tab;
451 #endif
452
453 #ifndef Sighandler_t
454 typedef Signal_t (*Sighandler_t) (int);
455 #define Sighandler_t    Sighandler_t
456 #endif
457
458 struct interp_intern {
459     char *      perlshell_tokens;
460     char **     perlshell_vec;
461     long        perlshell_items;
462     struct av * fdpid;
463     child_tab * children;
464 #ifdef USE_ITHREADS
465     DWORD       pseudo_id;
466     pseudo_child_tab * pseudo_children;
467 #endif
468     void *      internal_host;
469     struct thread_intern        thr_intern;
470     HWND        message_hwnd;
471     UINT        timerid;
472     unsigned    poll_count;
473     Sighandler_t sigtable[SIG_SIZE];
474 };
475
476 DllExport int win32_async_check(pTHX);
477
478 #define WIN32_POLL_INTERVAL 32768
479 #define PERL_ASYNC_CHECK() if (w32_do_async || PL_sig_pending) win32_async_check(aTHX)
480
481 #define w32_perlshell_tokens    (PL_sys_intern.perlshell_tokens)
482 #define w32_perlshell_vec       (PL_sys_intern.perlshell_vec)
483 #define w32_perlshell_items     (PL_sys_intern.perlshell_items)
484 #define w32_fdpid               (PL_sys_intern.fdpid)
485 #define w32_children            (PL_sys_intern.children)
486 #define w32_num_children        (w32_children->num)
487 #define w32_child_pids          (w32_children->pids)
488 #define w32_child_handles       (w32_children->handles)
489 #define w32_pseudo_id           (PL_sys_intern.pseudo_id)
490 #define w32_pseudo_children     (PL_sys_intern.pseudo_children)
491 #define w32_num_pseudo_children         (w32_pseudo_children->num)
492 #define w32_pseudo_child_pids           (w32_pseudo_children->pids)
493 #define w32_pseudo_child_handles        (w32_pseudo_children->handles)
494 #define w32_pseudo_child_message_hwnds  (w32_pseudo_children->message_hwnds)
495 #define w32_pseudo_child_sigterm        (w32_pseudo_children->sigterm)
496 #define w32_internal_host               (PL_sys_intern.internal_host)
497 #define w32_timerid                     (PL_sys_intern.timerid)
498 #define w32_message_hwnd                (PL_sys_intern.message_hwnd)
499 #define w32_sighandler                  (PL_sys_intern.sigtable)
500 #define w32_poll_count                  (PL_sys_intern.poll_count)
501 #define w32_do_async                    (w32_poll_count++ > WIN32_POLL_INTERVAL)
502 #define w32_strerror_buffer     (PL_sys_intern.thr_intern.Wstrerror_buffer)
503 #define w32_getlogin_buffer     (PL_sys_intern.thr_intern.Wgetlogin_buffer)
504 #define w32_crypt_buffer        (PL_sys_intern.thr_intern.Wcrypt_buffer)
505 #define w32_servent             (PL_sys_intern.thr_intern.Wservent)
506 #define w32_init_socktype       (PL_sys_intern.thr_intern.Winit_socktype)
507 #define w32_use_showwindow      (PL_sys_intern.thr_intern.Wuse_showwindow)
508 #define w32_showwindow  (PL_sys_intern.thr_intern.Wshowwindow)
509
510 #ifdef USE_ITHREADS
511 void win32_wait_for_children(pTHX);
512 #  define PERL_WAIT_FOR_CHILDREN win32_wait_for_children(aTHX)
513 #endif
514
515 #ifdef PERL_CORE
516 /* C doesn't like repeat struct definitions */
517 #if defined(__MINGW32__) && (__MINGW32_MAJOR_VERSION>=3)
518 #undef _CRTIMP
519 #endif
520 #ifndef _CRTIMP
521 #define _CRTIMP __declspec(dllimport)
522 #endif
523
524
525 /* VV 2005 has multiple ioinfo struct definitions through VC 2005's release life
526  * VC 2008-2012 have been stable but do not assume future VCs will have the
527  * same ioinfo struct, just because past struct stability. If research is done
528  * on the CRTs of future VS, the version check can be bumped up so the newer
529  * VC uses a fixed ioinfo size.
530  */
531 #if ! (_MSC_VER < 1400 || (_MSC_VER >= 1500 && _MSC_VER <= 1700) \
532   || defined(__MINGW32__))
533 /* size of ioinfo struct is determined at runtime */
534 #  define WIN32_DYN_IOINFO_SIZE
535 #endif
536
537 #ifndef WIN32_DYN_IOINFO_SIZE
538 /*
539  * Control structure for lowio file handles
540  */
541 typedef struct {
542     intptr_t osfhnd;/* underlying OS file HANDLE */
543     char osfile;    /* attributes of file (e.g., open in text mode?) */
544     char pipech;    /* one char buffer for handles opened on pipes */
545     int lockinitflag;
546     CRITICAL_SECTION lock;
547 /* this struct defintion breaks ABI compatibility with
548  * not using, cl.exe's native VS version specitfic CRT. */
549 #  if _MSC_VER >= 1400 && _MSC_VER < 1500
550 #    error "This ioinfo struct is incomplete for Visual C 2005"
551 #  endif
552 /* VC 2005 CRT has atleast 3 different definitions of this struct based on the
553  * CRT DLL's build number. */
554 #  if _MSC_VER >= 1500
555 #    ifndef _SAFECRT_IMPL
556     /* Not used in the safecrt downlevel. We do not define them, so we cannot
557      * use them accidentally */
558     char textmode : 7;/* __IOINFO_TM_ANSI or __IOINFO_TM_UTF8 or __IOINFO_TM_UTF16LE */
559     char unicode : 1; /* Was the file opened as unicode? */
560     char pipech2[2];  /* 2 more peak ahead chars for UNICODE mode */
561     __int64 startpos;      /* File position that matches buffer start */
562     BOOL utf8translations; /* Buffer contains translations other than CRLF*/
563     char dbcsBuffer;       /* Buffer for the lead byte of dbcs when converting from dbcs to unicode */
564     BOOL dbcsBufferUsed;   /* Bool for the lead byte buffer is used or not */
565 #    endif
566 #  endif
567 } ioinfo;
568 #else
569 typedef intptr_t ioinfo;
570 #endif
571
572 /*
573  * Array of arrays of control structures for lowio files.
574  */
575 EXTERN_C _CRTIMP ioinfo* __pioinfo[];
576
577 /*
578  * Definition of IOINFO_L2E, the log base 2 of the number of elements in each
579  * array of ioinfo structs.
580  */
581 #define IOINFO_L2E          5
582
583 /*
584  * Definition of IOINFO_ARRAY_ELTS, the number of elements in ioinfo array
585  */
586 #define IOINFO_ARRAY_ELTS   (1 << IOINFO_L2E)
587
588 /*
589  * Access macros for getting at an ioinfo struct and its fields from a
590  * file handle
591  */
592 #ifdef WIN32_DYN_IOINFO_SIZE
593 #  define _pioinfo(i) ((intptr_t *) \
594      (((Size_t)__pioinfo[(i) >> IOINFO_L2E])/* * to head of array ioinfo [] */\
595       /* offset to the head of a particular ioinfo struct */ \
596       + (((i) & (IOINFO_ARRAY_ELTS - 1)) * w32_ioinfo_size)) \
597    )
598 /* first slice of ioinfo is always the OS handle */
599 #  define _osfhnd(i)  (*(_pioinfo(i)))
600 #else
601 #  define _pioinfo(i) (__pioinfo[(i) >> IOINFO_L2E] + ((i) & (IOINFO_ARRAY_ELTS - 1)))
602 #  define _osfhnd(i)  (_pioinfo(i)->osfhnd)
603 #endif
604
605 /* since we are not doing a dup2(), this works fine */
606 #  define _set_osfhnd(fh, osfh) (void)(_osfhnd(fh) = (intptr_t)osfh)
607 #endif /* PERL_CORE */
608
609 /* IO.xs and POSIX.xs define PERLIO_NOT_STDIO to 1 */
610 #if defined(PERL_EXT_IO) || defined(PERL_EXT_POSIX)
611 #undef  PERLIO_NOT_STDIO
612 #endif
613 #define PERLIO_NOT_STDIO 0
614
615 #include "perlio.h"
616
617 /*
618  * This provides a layer of functions and macros to ensure extensions will
619  * get to use the same RTL functions as the core.
620  */
621 #include "win32iop.h"
622
623 #define EXEC_ARGV_CAST(x) ((const char *const *) x)
624
625 DllExport void *win32_signal_context(void);
626 #define PERL_GET_SIG_CONTEXT win32_signal_context()
627
628 #ifdef UNDER_CE
629 #define Win_GetModuleHandle   XCEGetModuleHandleA
630 #define Win_GetProcAddress    XCEGetProcAddressA
631 #define Win_GetModuleFileName XCEGetModuleFileNameA
632 #define Win_CreateSemaphore   CreateSemaphoreW
633 #else
634 #define Win_GetModuleHandle   GetModuleHandle
635 #define Win_GetProcAddress    GetProcAddress
636 #define Win_GetModuleFileName GetModuleFileName
637 #define Win_CreateSemaphore   CreateSemaphore
638 #endif
639
640 #endif /* _INC_WIN32_PERL5 */
641