3 * (c) 1995 Microsoft Corporation. All rights reserved.
4 * Developed by hip communications inc., http://info.hip.com/info/
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.
9 #ifndef _INC_WIN32_PERL5
10 #define _INC_WIN32_PERL5
12 #define WIN32_LEAN_AND_MEAN
15 #ifdef WIN32_LEAN_AND_MEAN /* C file is NOT a Perl5 original. */
16 #define CONTEXT PERL_CONTEXT /* Avoid conflict of CONTEXT defs. */
17 #define index strchr /* Why 'index'? */
18 #endif /*WIN32_LEAN_AND_MEAN */
26 /* For UNIX compatibility. */
30 #define _access access
32 #include <sys/types.h>
35 #define DllMain DllEntryPoint
55 extern uid_t getuid(void);
56 extern gid_t getgid(void);
57 extern uid_t geteuid(void);
58 extern gid_t getegid(void);
59 extern int setuid(uid_t uid);
60 extern int setgid(gid_t gid);
62 extern int kill(int pid, int sig);
64 extern char *staticlinkmodules[];
66 /* if USE_WIN32_RTL_ENV is not defined, Perl uses direct Win32 calls
67 * to read the environment, bypassing the runtime's (usually broken)
68 * facilities for accessing the same. See note in util.c/my_setenv().
70 /*#define USE_WIN32_RTL_ENV */
72 #ifndef USE_WIN32_RTL_ENV
78 #define getenv win32_getenv
79 EXT char *win32_getenv(const char *name);
82 EXT void Perl_win32_init(int *argcp, char ***argvp);
84 #define USE_SOCKETS_AS_HANDLES
85 #ifndef USE_SOCKETS_AS_HANDLES
86 extern FILE *myfdopen(int, char *);
89 #define fdopen myfdopen
90 #endif /* USE_SOCKETS_AS_HANDLES */
92 #define STANDARD_C 1 /* Perl5 likes standard C. */
93 #define DOSISH 1 /* Take advantage of DOSish code in Perl5. */
95 #define OP_BINARY O_BINARY /* Mistake in in pp_sys.c. */
98 #define pipe(fd) win32_pipe((fd), 512, O_BINARY) /* the pipe call is a bit different */
101 #define pause() sleep((32767L << 16) + 32767)
105 #define times mytimes
108 #define alarm myalarm
117 unsigned int sleep(unsigned int);
118 char *win32PerlLibPath(void);
119 char *win32SiteLibPath(void);
120 int mytimes(struct tms *timebuf);
121 unsigned int myalarm(unsigned int sec);
122 int do_aspawn(void* really, void** mark, void** arglast);
123 int do_spawn(char *cmd);
124 char do_exec(char *cmd);
125 void init_os_extras(void);
127 typedef char * caddr_t; /* In malloc.c (core address). */
130 * Extension Library, only good for VC
133 #define DllExport __declspec(dllexport)
134 #define DllImport __declspec(dllimport)
137 * handle socket stuff, assuming socket is always available
140 #include <sys/socket.h>
144 #pragma warning(disable: 4018 4035 4101 4102 4244 4245 4761)
150 #ifndef VER_PLATFORM_WIN32_WINDOWS /* VC-2.0 headers dont have this */
151 #define VER_PLATFORM_WIN32_WINDOWS 1
154 #endif /* _INC_WIN32_PERL5 */