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
14 typedef long long __int64;
20 #define WIN32_LEAN_AND_MEAN
23 #ifdef WIN32_LEAN_AND_MEAN /* C file is NOT a Perl5 original. */
24 #define CONTEXT PERL_CONTEXT /* Avoid conflict of CONTEXT defs. */
25 #define index strchr /* Why 'index'? */
26 #endif /*WIN32_LEAN_AND_MEAN */
45 #ifndef START_EXTERN_C
47 # define START_EXTERN_C extern "C" {
48 # define END_EXTERN_C }
49 # define EXTERN_C extern "C"
51 # define START_EXTERN_C
58 #define DOSISH 1 /* no escaping our roots */
59 #define OP_BINARY O_BINARY /* mistake in in pp_sys.c? */
60 #define DllExport __declspec(dllexport)
61 #define DllImport __declspec(dllimport)
63 /* Define USE_SOCKETS_AS_HANDLES to enable emulation of windows sockets as
64 * real filehandles. XXX Should always be defined (the other version is untested) */
65 #define USE_SOCKETS_AS_HANDLES
67 /* if USE_WIN32_RTL_ENV is not defined, Perl uses direct Win32 calls
68 * to read the environment, bypassing the runtime's (usually broken)
69 * facilities for accessing the same. See note in util.c/my_setenv(). */
70 /*#define USE_WIN32_RTL_ENV */
72 /* Define USE_FIXED_OSFHANDLE to fix VC's _open_osfhandle() on W95.
73 * Can only enable it if not using the DLL CRT (it doesn't expose internals) */
74 #if defined(_MSC_VER) && !defined(_DLL) && defined(_M_IX86)
75 #define USE_FIXED_OSFHANDLE
78 #ifndef VER_PLATFORM_WIN32_WINDOWS /* VC-2.0 headers dont have this */
79 #define VER_PLATFORM_WIN32_WINDOWS 1
82 /* Compiler-specific stuff. */
84 #ifdef __BORLANDC__ /* Microsoft Visual C++ */
86 #define _access access
88 #include <sys/types.h>
91 #define DllMain DllEntryPoint
106 #ifdef _MSC_VER /* Microsoft Visual C++ */
110 #pragma warning(disable: 4018 4035 4101 4102 4244 4245 4761)
112 #endif /* _MSC_VER */
114 /* compatibility stuff for other compilers goes here */
120 /* For UNIX compatibility. */
122 extern uid_t getuid(void);
123 extern gid_t getgid(void);
124 extern uid_t geteuid(void);
125 extern gid_t getegid(void);
126 extern int setuid(uid_t uid);
127 extern int setgid(gid_t gid);
128 extern int kill(int pid, int sig);
129 extern void *sbrk(int need);
132 #define Stat win32_stat
134 #undef init_os_extras
135 #define init_os_extras Perl_init_os_extras
137 EXT void Perl_win32_init(int *argcp, char ***argvp);
138 EXT void Perl_init_os_extras(void);
140 #ifndef USE_SOCKETS_AS_HANDLES
141 extern FILE * my_fdopen(int, char *);
143 extern int my_fclose(FILE *);
144 extern int do_aspawn(void* really, void ** mark, void ** arglast);
145 extern int do_spawn(char *cmd);
146 extern char do_exec(char *cmd);
147 extern char * win32PerlLibPath(char *sfx,...);
148 extern int IsWin95(void);
149 extern int IsWinNT(void);
151 extern char * staticlinkmodules[];
155 typedef char * caddr_t; /* In malloc.c (core address). */
158 * handle socket stuff, assuming socket is always available
160 #include <sys/socket.h>
164 #define EMBEDMYMALLOC /**/
165 /* #define USE_PERL_SBRK /**/
166 /* #define PERL_SBRK_VIA_MALLOC /**/
169 #if defined(PERLDLL) && !defined(PERL_CORE)
173 #ifdef USE_BINMODE_SCRIPTS
174 #define PERL_SCRIPT_MODE "rb"
175 EXT void win32_strip_return(struct sv *sv);
177 #define PERL_SCRIPT_MODE "r"
178 #define win32_strip_return(sv) NOOP
181 #endif /* _INC_WIN32_PERL5 */