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 */
30 #ifndef START_EXTERN_C
32 # define START_EXTERN_C extern "C" {
33 # define END_EXTERN_C }
34 # define EXTERN_C extern "C"
36 # define START_EXTERN_C
43 #define DOSISH 1 /* no escaping our roots */
44 #define OP_BINARY O_BINARY /* mistake in in pp_sys.c? */
45 #define USE_SOCKETS_AS_HANDLES /* we wanna pretend sockets are FDs */
46 /*#define USE_WIN32_RTL_ENV */ /* see note below */
48 /* For UNIX compatibility. */
52 #define _access access
54 #include <sys/types.h>
57 #define DllMain DllEntryPoint
78 extern uid_t getuid(void);
79 extern gid_t getgid(void);
80 extern uid_t geteuid(void);
81 extern gid_t getegid(void);
82 extern int setuid(uid_t uid);
83 extern int setgid(gid_t gid);
84 extern int kill(int pid, int sig);
87 extern char *staticlinkmodules[];
91 /* if USE_WIN32_RTL_ENV is not defined, Perl uses direct Win32 calls
92 * to read the environment, bypassing the runtime's (usually broken)
93 * facilities for accessing the same. See note in util.c/my_setenv().
96 #ifndef USE_WIN32_RTL_ENV
97 EXT char *win32_getenv(const char *name);
99 #define getenv win32_getenv
102 EXT void Perl_win32_init(int *argcp, char ***argvp);
104 #ifndef USE_SOCKETS_AS_HANDLES
105 extern FILE *my_fdopen(int, char *);
107 #define fdopen my_fdopen
108 #endif /* USE_SOCKETS_AS_HANDLES */
111 #define fclose my_fclose
113 #undef pipe /* win32_pipe() itself calls _pipe() */
114 #define pipe(fd) win32_pipe((fd), 512, O_BINARY)
117 #define pause() sleep((32767L << 16) + 32767)
120 #define times my_times
123 #define alarm my_alarm
132 extern unsigned int sleep(unsigned int);
133 extern char *win32PerlLibPath(void);
134 extern char *win32SiteLibPath(void);
135 extern int my_times(struct tms *timebuf);
136 extern unsigned int my_alarm(unsigned int sec);
137 extern int my_flock(int fd, int oper);
138 extern int do_aspawn(void* really, void ** mark, void ** arglast);
139 extern int do_spawn(char *cmd);
140 extern char do_exec(char *cmd);
141 extern void init_os_extras(void);
142 extern int my_fclose(FILE *);
143 extern int IsWin95(void);
144 extern int IsWinNT(void);
148 typedef char * caddr_t; /* In malloc.c (core address). */
151 * Extension Library, only good for VC
154 #define DllExport __declspec(dllexport)
155 #define DllImport __declspec(dllimport)
158 * handle socket stuff, assuming socket is always available
161 #include <sys/socket.h>
165 #pragma warning(disable: 4018 4035 4101 4102 4244 4245 4761)
168 #ifndef VER_PLATFORM_WIN32_WINDOWS /* VC-2.0 headers dont have this */
169 #define VER_PLATFORM_WIN32_WINDOWS 1
172 #endif /* _INC_WIN32_PERL5 */