This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
%x can't be used directly with pointers.
[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 0x0400     /* needed for TryEnterCriticalSection() etc. */
14 #endif
15
16 #if defined(PERL_IMPLICIT_SYS)
17 #  define DYNAMIC_ENV_FETCH
18 #  define HAS_GETENV_LEN
19 #  define prime_env_iter()
20 #  define WIN32IO_IS_STDIO              /* don't pull in custom stdio layer */
21 #  define WIN32SCK_IS_STDSCK            /* don't pull in custom wsock layer */
22 #  ifdef PERL_GLOBAL_STRUCT
23 #    error PERL_GLOBAL_STRUCT cannot be defined with PERL_IMPLICIT_SYS
24 #  endif
25 #  define win32_get_privlib PerlEnv_lib_path
26 #  define win32_get_sitelib PerlEnv_sitelib_path
27 #  define win32_get_vendorlib PerlEnv_vendorlib_path
28 #endif
29
30 #ifdef __GNUC__
31 #  ifndef __int64               /* some versions seem to #define it already */
32 #    define __int64 long long
33 #  endif
34 #  define Win32_Winsock
35 #ifdef __cplusplus
36 /* Mingw32 gcc -xc++ objects to __attribute((unused)) at least */
37 #undef  PERL_UNUSED_DECL
38 #define PERL_UNUSED_DECL
39 #endif
40 #endif
41
42
43 /* Define DllExport akin to perl's EXT,
44  * If we are in the DLL or mimicing the DLL for Win95 work round
45  * then Export the symbol,
46  * otherwise import it.
47  */
48
49 /* now even GCC supports __declspec() */
50
51 #if defined(PERLDLL) || defined(WIN95FIX)
52 #define DllExport
53 /*#define DllExport __declspec(dllexport)*/     /* noises with VC5+sp3 */
54 #else
55 #define DllExport __declspec(dllimport)
56 #endif
57
58 /* The Perl APIs can only be called directly inside the perl5xx.dll.
59  * All other code has to import them.  By declaring them as "dllimport"
60  * we tell the compiler to generate an indirect call instruction and
61  * avoid redirection through a call thunk.
62  *
63  * The XS code in the re extension is special, in that it redefines
64  * core APIs locally, so don't mark them as "dllimport" because GCC
65  * cannot handle this situation.
66  */
67 #if !defined(PERLDLL) && !defined(PERL_EXT_RE_BUILD)
68 #  ifdef __cplusplus
69 #    define PERL_CALLCONV extern "C" __declspec(dllimport)
70 #  else
71 #    define PERL_CALLCONV __declspec(dllimport)
72 #  endif
73 #endif
74
75 #define  WIN32_LEAN_AND_MEAN
76 #include <windows.h>
77
78 /*
79  * Bug in winbase.h in mingw-w64 4.4.0-1 at least... they
80  * do #define GetEnvironmentStringsA GetEnvironmentStrings and fail
81  * to declare GetEnvironmentStringsA.
82  */
83 #if defined(__MINGW64__) && defined(GetEnvironmentStringsA) && !defined(UNICODE)
84 #ifdef __cplusplus
85 extern "C" {
86 #endif
87 #undef GetEnvironmentStringsA
88 WINBASEAPI LPCH WINAPI GetEnvironmentStringsA(VOID);
89 #define GetEnvironmentStrings GetEnvironmentStringsA
90 #ifdef __cplusplus
91 }
92 #endif
93 #endif
94
95 #ifdef   WIN32_LEAN_AND_MEAN            /* C file is NOT a Perl5 original. */
96 #define  CONTEXT        PERL_CONTEXT    /* Avoid conflict of CONTEXT defs. */
97 #endif /*WIN32_LEAN_AND_MEAN */
98
99 #ifndef TLS_OUT_OF_INDEXES
100 #define TLS_OUT_OF_INDEXES (DWORD)0xFFFFFFFF
101 #endif
102
103 #include <dirent.h>
104 #include <io.h>
105 #include <process.h>
106 #include <stdio.h>
107 #include <direct.h>
108 #include <stdlib.h>
109 #include <stddef.h>
110 #include <fcntl.h>
111 #ifndef EXT
112 #include "EXTERN.h"
113 #endif
114
115 struct tms {
116         long    tms_utime;
117         long    tms_stime;
118         long    tms_cutime;
119         long    tms_cstime;
120 };
121
122 #ifndef SYS_NMLN
123 #define SYS_NMLN        257
124 #endif
125
126 struct utsname {
127     char sysname[SYS_NMLN];
128     char nodename[SYS_NMLN];
129     char release[SYS_NMLN];
130     char version[SYS_NMLN];
131     char machine[SYS_NMLN];
132 };
133
134 #ifndef START_EXTERN_C
135 #undef EXTERN_C
136 #ifdef __cplusplus
137 #  define START_EXTERN_C extern "C" {
138 #  define END_EXTERN_C }
139 #  define EXTERN_C extern "C"
140 #else
141 #  define START_EXTERN_C
142 #  define END_EXTERN_C
143 #  define EXTERN_C
144 #endif
145 #endif
146
147 #define  STANDARD_C     1
148 #define  DOSISH         1               /* no escaping our roots */
149 #define  OP_BINARY      O_BINARY        /* mistake in in pp_sys.c? */
150
151 /* Define USE_SOCKETS_AS_HANDLES to enable emulation of windows sockets as
152  * real filehandles. XXX Should always be defined (the other version is untested) */
153 #define USE_SOCKETS_AS_HANDLES
154
155 /* read() and write() aren't transparent for socket handles */
156 #define PERL_SOCK_SYSREAD_IS_RECV
157 #define PERL_SOCK_SYSWRITE_IS_SEND
158
159 #define PERL_NO_FORCE_LINK              /* no need for PL_force_link_funcs */
160
161 /* Define USE_FIXED_OSFHANDLE to fix MSVCRT's _open_osfhandle() on W95.
162    It now uses some black magic to work seamlessly with the DLL CRT and
163    works with MSVC++ 4.0+ or GCC/Mingw32
164         -- BKS 1-24-2000
165    Only use this fix for VC++ 6.x or earlier (and for GCC, which we assume
166    uses MSVCRT.DLL). Later versions use MSVCR70.dll, MSVCR71.dll, etc, which
167    do not require the fix. */
168 #if (defined(_M_IX86) && _MSC_VER >= 1000 && _MSC_VER <= 1200) || defined(__MINGW32__)
169 #define USE_FIXED_OSFHANDLE
170 #endif
171
172 /* Define PERL_WIN32_SOCK_DLOAD to have Perl dynamically load the winsock
173    DLL when needed. Don't use if your compiler supports delayloading (ie, VC++ 6.0)
174         -- BKS 5-29-2000 */
175 #if !(defined(_M_IX86) && _MSC_VER >= 1200)
176 #define PERL_WIN32_SOCK_DLOAD
177 #endif
178 #define ENV_IS_CASELESS
179
180 #define PIPESOCK_MODE   "b"             /* pipes, sockets default to binmode */
181
182 #ifndef VER_PLATFORM_WIN32_WINDOWS      /* VC-2.0 headers don't have this */
183 #define VER_PLATFORM_WIN32_WINDOWS      1
184 #endif
185
186 #ifndef FILE_SHARE_DELETE               /* VC-4.0 headers don't have this */
187 #define FILE_SHARE_DELETE               0x00000004
188 #endif
189
190 /* access() mode bits */
191 #ifndef R_OK
192 #  define       R_OK    4
193 #  define       W_OK    2
194 #  define       X_OK    1
195 #  define       F_OK    0
196 #endif
197
198 /* for waitpid() */
199 #ifndef WNOHANG
200 #  define WNOHANG       1
201 #endif
202
203 #define PERL_GET_CONTEXT_DEFINED
204
205 /* Compiler-specific stuff. */
206
207 #if defined(_MSC_VER) || defined(__MINGW32__)
208 /* VC uses non-standard way to determine the size and alignment if bit-fields */
209 /* MinGW will compiler with -mms-bitfields, so should use the same types */
210 #  define PERL_BITFIELD8  unsigned char
211 #  define PERL_BITFIELD16 unsigned short
212 #  define PERL_BITFIELD32 unsigned int
213 #endif
214
215 #ifdef __BORLANDC__             /* Borland C++ */
216
217 #if (__BORLANDC__ <= 0x520)
218 #define _access access
219 #define _chdir chdir
220 #endif
221
222 #define _getpid getpid
223 #define wcsicmp _wcsicmp
224 #include <sys/types.h>
225
226 #ifndef DllMain
227 #define DllMain DllEntryPoint
228 #endif
229
230 #pragma warn -8004      /* "'foo' is assigned a value that is never used" */
231 #pragma warn -8008      /* "condition is always true/false" */
232 #pragma warn -8012      /* "comparing signed and unsigned values" */
233 #pragma warn -8027      /* "functions containing %s are not expanded inline" */
234 #pragma warn -8057      /* "parameter 'foo' is never used" */
235 #pragma warn -8060      /* "possibly incorrect assignment" */
236 #pragma warn -8066      /* "unreachable code" */
237 #pragma warn -8071      /* "conversion may lose significant digits" */
238 #pragma warn -8080      /* "'foo' is declared but never used" */
239
240 /* Borland C thinks that a pointer to a member variable is 12 bytes in size. */
241 #define PERL_MEMBER_PTR_SIZE    12
242
243 #define isnan           _isnan
244
245 #endif
246
247 #ifdef _MSC_VER                 /* Microsoft Visual C++ */
248
249 #ifndef UNDER_CE
250 typedef long            uid_t;
251 typedef long            gid_t;
252 typedef unsigned short  mode_t;
253 #endif
254
255 #pragma  warning(disable: 4102) /* "unreferenced label" */
256
257 /* Visual C thinks that a pointer to a member variable is 16 bytes in size. */
258 #define PERL_MEMBER_PTR_SIZE    16
259
260 #define isnan           _isnan
261 #define snprintf        _snprintf
262 #define vsnprintf       _vsnprintf
263
264 #if _MSC_VER < 1300
265 /* VC6 has broken NaN semantics: NaN == NaN returns true instead of false */
266 #define NAN_COMPARE_BROKEN 1
267 #endif
268
269 #endif /* _MSC_VER */
270
271 #ifdef __MINGW32__              /* Minimal Gnu-Win32 */
272
273 typedef long            uid_t;
274 typedef long            gid_t;
275 #ifndef _environ
276 #define _environ        environ
277 #endif
278 #define flushall        _flushall
279 #define fcloseall       _fcloseall
280 #ifndef isnan
281 #define isnan           _isnan  /* ...same libraries as MSVC */
282 #endif
283
284 #ifndef _O_NOINHERIT
285 #  define _O_NOINHERIT  0x0080
286 #  ifndef _NO_OLDNAMES
287 #    define O_NOINHERIT _O_NOINHERIT
288 #  endif
289 #endif
290
291 /* <stdint.h>, pulled in by <io.h> as of mingw-runtime-3.3, typedef's
292  * (u)intptr_t but doesn't set the _(U)INTPTR_T_DEFINED defines */
293 #ifdef _STDINT_H
294 #  ifndef _INTPTR_T_DEFINED
295 #    define _INTPTR_T_DEFINED
296 #  endif
297 #  ifndef _UINTPTR_T_DEFINED
298 #    define _UINTPTR_T_DEFINED
299 #  endif
300 #endif
301
302 #endif /* __MINGW32__ */
303
304 /* both GCC/Mingw32 and MSVC++ 4.0 are missing this, so we put it here */
305 #ifndef CP_UTF8
306 #  define CP_UTF8       65001
307 #endif
308
309 /* compatibility stuff for other compilers goes here */
310
311 #ifndef _INTPTR_T_DEFINED
312 typedef int             intptr_t;
313 #  define _INTPTR_T_DEFINED
314 #endif
315
316 #ifndef _UINTPTR_T_DEFINED
317 typedef unsigned int    uintptr_t;
318 #  define _UINTPTR_T_DEFINED
319 #endif
320
321 START_EXTERN_C
322
323 /* For UNIX compatibility. */
324
325 extern  uid_t   getuid(void);
326 extern  gid_t   getgid(void);
327 extern  uid_t   geteuid(void);
328 extern  gid_t   getegid(void);
329 extern  int     setuid(uid_t uid);
330 extern  int     setgid(gid_t gid);
331 extern  int     kill(int pid, int sig);
332 extern  int     killpg(int pid, int sig);
333 #ifndef USE_PERL_SBRK
334 extern  void    *sbrk(ptrdiff_t need);
335 #  define HAS_SBRK_PROTO
336 #endif
337 extern  char *  getlogin(void);
338 extern  int     chown(const char *p, uid_t o, gid_t g);
339 extern  int     mkstemp(const char *path);
340
341 #undef   Stat
342 #define  Stat           win32_stat
343
344 #undef   init_os_extras
345 #define  init_os_extras Perl_init_os_extras
346
347 DllExport void          Perl_win32_init(int *argcp, char ***argvp);
348 DllExport void          Perl_win32_term(void);
349 DllExport void          Perl_init_os_extras(void);
350 DllExport void          win32_str_os_error(void *sv, DWORD err);
351 DllExport int           RunPerl(int argc, char **argv, char **env);
352
353 typedef struct {
354     HANDLE      childStdIn;
355     HANDLE      childStdOut;
356     HANDLE      childStdErr;
357     /*
358      * the following correspond to the fields of the same name
359      * in the STARTUPINFO structure. Embedders can use these to
360      * control the spawning process' look.
361      * Example - to hide the window of the spawned process:
362      *    dwFlags = STARTF_USESHOWWINDOW;
363      *    wShowWindow = SW_HIDE;
364      */
365     DWORD       dwFlags;
366     DWORD       dwX;
367     DWORD       dwY;
368     DWORD       dwXSize;
369     DWORD       dwYSize;
370     DWORD       dwXCountChars;
371     DWORD       dwYCountChars;
372     DWORD       dwFillAttribute;
373     WORD        wShowWindow;
374 } child_IO_table;
375
376 DllExport void          win32_get_child_IO(child_IO_table* ptr);
377 DllExport HWND          win32_create_message_window(void);
378
379 #ifndef USE_SOCKETS_AS_HANDLES
380 extern FILE *           my_fdopen(int, char *);
381 #endif
382 extern int              my_fclose(FILE *);
383 extern int              my_fstat(int fd, Stat_t *sbufptr);
384 extern char *           win32_get_privlib(const char *pl, STRLEN *const len);
385 extern char *           win32_get_sitelib(const char *pl, STRLEN *const len);
386 extern char *           win32_get_vendorlib(const char *pl, STRLEN *const len);
387 extern int              IsWin95(void);
388 extern int              IsWinNT(void);
389
390 #ifdef PERL_IMPLICIT_SYS
391 extern void             win32_delete_internal_host(void *h);
392 #endif
393
394 extern char *           staticlinkmodules[];
395
396 END_EXTERN_C
397
398 typedef  char *         caddr_t;        /* In malloc.c (core address). */
399
400 /*
401  * handle socket stuff, assuming socket is always available
402  */
403 #include <sys/socket.h>
404 #include <netdb.h>
405
406 #ifdef MYMALLOC
407 #define EMBEDMYMALLOC   /**/
408 /* #define USE_PERL_SBRK        /**/
409 /* #define PERL_SBRK_VIA_MALLOC /**/
410 #endif
411
412 #ifdef PERL_TEXTMODE_SCRIPTS
413 #  define PERL_SCRIPT_MODE              "r"
414 #else
415 #  define PERL_SCRIPT_MODE              "rb"
416 #endif
417
418 /*
419  * Now Win32 specific per-thread data stuff
420  */
421
422 /* Leave the first couple ids after WM_USER unused because they
423  * might be used by an embedding application, and on Windows
424  * version before 2000 we might end up eating those messages
425  * if they were not meant for us.
426  */
427 #define WM_USER_MIN     (WM_USER+30)
428 #define WM_USER_MESSAGE (WM_USER_MIN)
429 #define WM_USER_KILL    (WM_USER_MIN+1)
430 #define WM_USER_MAX     (WM_USER_MIN+1)
431
432 struct thread_intern {
433     /* XXX can probably use one buffer instead of several */
434     char                Wstrerror_buffer[512];
435     struct servent      Wservent;
436     char                Wgetlogin_buffer[128];
437 #    ifdef USE_SOCKETS_AS_HANDLES
438     int                 Winit_socktype;
439 #    endif
440 #    ifdef HAVE_DES_FCRYPT
441     char                Wcrypt_buffer[30];
442 #    endif
443 #    ifdef USE_RTL_THREAD_API
444     void *              retv;   /* slot for thread return value */
445 #    endif
446     BOOL               Wuse_showwindow;
447     WORD               Wshowwindow;
448 };
449
450 #define HAVE_INTERP_INTERN
451 typedef struct {
452     long        num;
453     DWORD       pids[MAXIMUM_WAIT_OBJECTS];
454     HANDLE      handles[MAXIMUM_WAIT_OBJECTS];
455 } child_tab;
456
457 #ifdef USE_ITHREADS
458 typedef struct {
459     long        num;
460     DWORD       pids[MAXIMUM_WAIT_OBJECTS];
461     HANDLE      handles[MAXIMUM_WAIT_OBJECTS];
462     HWND        message_hwnds[MAXIMUM_WAIT_OBJECTS];
463 } pseudo_child_tab;
464 #endif
465
466 #ifndef Sighandler_t
467 typedef Signal_t (*Sighandler_t) (int);
468 #define Sighandler_t    Sighandler_t
469 #endif
470
471 struct interp_intern {
472     char *      perlshell_tokens;
473     char **     perlshell_vec;
474     long        perlshell_items;
475     struct av * fdpid;
476     child_tab * children;
477 #ifdef USE_ITHREADS
478     DWORD       pseudo_id;
479     pseudo_child_tab * pseudo_children;
480 #endif
481     void *      internal_host;
482     struct thread_intern        thr_intern;
483     HWND        message_hwnd;
484     UINT        timerid;
485     unsigned    poll_count;
486     Sighandler_t sigtable[SIG_SIZE];
487 };
488
489 DllExport int win32_async_check(pTHX);
490
491 #define WIN32_POLL_INTERVAL 32768
492 #define PERL_ASYNC_CHECK() if (w32_do_async || PL_sig_pending) win32_async_check(aTHX)
493
494 #define w32_perlshell_tokens    (PL_sys_intern.perlshell_tokens)
495 #define w32_perlshell_vec       (PL_sys_intern.perlshell_vec)
496 #define w32_perlshell_items     (PL_sys_intern.perlshell_items)
497 #define w32_fdpid               (PL_sys_intern.fdpid)
498 #define w32_children            (PL_sys_intern.children)
499 #define w32_num_children        (w32_children->num)
500 #define w32_child_pids          (w32_children->pids)
501 #define w32_child_handles       (w32_children->handles)
502 #define w32_pseudo_id           (PL_sys_intern.pseudo_id)
503 #define w32_pseudo_children     (PL_sys_intern.pseudo_children)
504 #define w32_num_pseudo_children         (w32_pseudo_children->num)
505 #define w32_pseudo_child_pids           (w32_pseudo_children->pids)
506 #define w32_pseudo_child_handles        (w32_pseudo_children->handles)
507 #define w32_pseudo_child_message_hwnds  (w32_pseudo_children->message_hwnds)
508 #define w32_internal_host               (PL_sys_intern.internal_host)
509 #define w32_timerid                     (PL_sys_intern.timerid)
510 #define w32_message_hwnd                (PL_sys_intern.message_hwnd)
511 #define w32_sighandler                  (PL_sys_intern.sigtable)
512 #define w32_poll_count                  (PL_sys_intern.poll_count)
513 #define w32_do_async                    (w32_poll_count++ > WIN32_POLL_INTERVAL)
514 #define w32_strerror_buffer     (PL_sys_intern.thr_intern.Wstrerror_buffer)
515 #define w32_getlogin_buffer     (PL_sys_intern.thr_intern.Wgetlogin_buffer)
516 #define w32_crypt_buffer        (PL_sys_intern.thr_intern.Wcrypt_buffer)
517 #define w32_servent             (PL_sys_intern.thr_intern.Wservent)
518 #define w32_init_socktype       (PL_sys_intern.thr_intern.Winit_socktype)
519 #define w32_use_showwindow      (PL_sys_intern.thr_intern.Wuse_showwindow)
520 #define w32_showwindow  (PL_sys_intern.thr_intern.Wshowwindow)
521
522 #ifdef USE_ITHREADS
523 #  define PERL_WAIT_FOR_CHILDREN \
524     STMT_START {                                                        \
525         if (w32_pseudo_children && w32_num_pseudo_children) {           \
526             long children = w32_num_pseudo_children;                    \
527             WaitForMultipleObjects(children,                            \
528                                    w32_pseudo_child_handles,            \
529                                    TRUE, INFINITE);                     \
530             while (children)                                            \
531                 CloseHandle(w32_pseudo_child_handles[--children]);      \
532         }                                                               \
533     } STMT_END
534 #endif
535
536 #if defined(USE_FIXED_OSFHANDLE) || defined(PERL_MSVCRT_READFIX)
537 #ifdef PERL_CORE
538
539 /* C doesn't like repeat struct definitions */
540 #if defined(__MINGW32__) && (__MINGW32_MAJOR_VERSION>=3)
541 #undef _CRTIMP
542 #endif
543 #ifndef _CRTIMP
544 #define _CRTIMP __declspec(dllimport)
545 #endif
546
547 /*
548  * Control structure for lowio file handles
549  */
550 typedef struct {
551     intptr_t osfhnd;/* underlying OS file HANDLE */
552     char osfile;    /* attributes of file (e.g., open in text mode?) */
553     char pipech;    /* one char buffer for handles opened on pipes */
554     int lockinitflag;
555     CRITICAL_SECTION lock;
556 } ioinfo;
557
558
559 /*
560  * Array of arrays of control structures for lowio files.
561  */
562 EXTERN_C _CRTIMP ioinfo* __pioinfo[];
563
564 /*
565  * Definition of IOINFO_L2E, the log base 2 of the number of elements in each
566  * array of ioinfo structs.
567  */
568 #define IOINFO_L2E          5
569
570 /*
571  * Definition of IOINFO_ARRAY_ELTS, the number of elements in ioinfo array
572  */
573 #define IOINFO_ARRAY_ELTS   (1 << IOINFO_L2E)
574
575 /*
576  * Access macros for getting at an ioinfo struct and its fields from a
577  * file handle
578  */
579 #define _pioinfo(i) (__pioinfo[(i) >> IOINFO_L2E] + ((i) & (IOINFO_ARRAY_ELTS - 1)))
580 #define _osfhnd(i)  (_pioinfo(i)->osfhnd)
581 #define _osfile(i)  (_pioinfo(i)->osfile)
582 #define _pipech(i)  (_pioinfo(i)->pipech)
583
584 /* since we are not doing a dup2(), this works fine */
585 #define _set_osfhnd(fh, osfh) (void)(_osfhnd(fh) = (intptr_t)osfh)
586 #endif
587 #endif
588
589 /* IO.xs and POSIX.xs define PERLIO_NOT_STDIO to 1 */
590 #if defined(PERL_EXT_IO) || defined(PERL_EXT_POSIX)
591 #undef  PERLIO_NOT_STDIO
592 #endif
593 #define PERLIO_NOT_STDIO 0
594
595 #include "perlio.h"
596
597 /*
598  * This provides a layer of functions and macros to ensure extensions will
599  * get to use the same RTL functions as the core.
600  */
601 #include "win32iop.h"
602
603 #define EXEC_ARGV_CAST(x) ((const char *const *) x)
604
605 #if !defined(ECONNABORTED) && defined(WSAECONNABORTED)
606 #define ECONNABORTED WSAECONNABORTED
607 #endif
608 #if !defined(ECONNRESET) && defined(WSAECONNRESET)
609 #define ECONNRESET WSAECONNRESET
610 #endif
611 #if !defined(EAFNOSUPPORT) && defined(WSAEAFNOSUPPORT)
612 #define EAFNOSUPPORT WSAEAFNOSUPPORT
613 #endif
614 /* Why not needed for ECONNREFUSED? --abe */
615
616 DllExport void *win32_signal_context(void);
617 #define PERL_GET_SIG_CONTEXT win32_signal_context()
618
619 #ifdef UNDER_CE
620 #define Win_GetModuleHandle   XCEGetModuleHandleA
621 #define Win_GetProcAddress    XCEGetProcAddressA
622 #define Win_GetModuleFileName XCEGetModuleFileNameA
623 #define Win_CreateSemaphore   CreateSemaphoreW
624 #else
625 #define Win_GetModuleHandle   GetModuleHandle
626 #define Win_GetProcAddress    GetProcAddress
627 #define Win_GetModuleFileName GetModuleFileName
628 #define Win_CreateSemaphore   CreateSemaphore
629 #endif
630
631 #endif /* _INC_WIN32_PERL5 */
632