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;
18 #define WIN32_LEAN_AND_MEAN
21 #ifdef WIN32_LEAN_AND_MEAN /* C file is NOT a Perl5 original. */
22 #define CONTEXT PERL_CONTEXT /* Avoid conflict of CONTEXT defs. */
23 #define index strchr /* Why 'index'? */
24 #endif /*WIN32_LEAN_AND_MEAN */
36 #ifndef START_EXTERN_C
38 # define START_EXTERN_C extern "C" {
39 # define END_EXTERN_C }
40 # define EXTERN_C extern "C"
42 # define START_EXTERN_C
49 #define DOSISH 1 /* no escaping our roots */
50 #define OP_BINARY O_BINARY /* mistake in in pp_sys.c? */
51 #define DllExport __declspec(dllexport)
52 #define DllImport __declspec(dllimport)
54 /* Define USE_SOCKETS_AS_HANDLES to enable emulation of windows sockets as
55 * real filehandles. XXX Should always be defined (the other version is untested) */
56 #define USE_SOCKETS_AS_HANDLES
58 /* if USE_WIN32_RTL_ENV is not defined, Perl uses direct Win32 calls
59 * to read the environment, bypassing the runtime's (usually broken)
60 * facilities for accessing the same. See note in util.c/my_setenv(). */
61 /*#define USE_WIN32_RTL_ENV */
63 /* Define USE_FIXED_OSFHANDLE to fix VC's _open_osfhandle() on W95.
64 * Can only enable it if not using the DLL CRT (it doesn't expose internals) */
65 #if defined(_MSC_VER) && !defined(_DLL) && defined(_M_IX86)
66 #define USE_FIXED_OSFHANDLE
69 #ifndef VER_PLATFORM_WIN32_WINDOWS /* VC-2.0 headers dont have this */
70 #define VER_PLATFORM_WIN32_WINDOWS 1
73 /* Compiler-specific stuff. */
75 #ifdef __BORLANDC__ /* Microsoft Visual C++ */
77 #define _access access
79 #include <sys/types.h>
82 #define DllMain DllEntryPoint
97 #ifdef _MSC_VER /* Microsoft Visual C++ */
101 #pragma warning(disable: 4018 4035 4101 4102 4244 4245 4761)
103 #endif /* _MSC_VER */
105 /* compatibility stuff for other compilers goes here */
111 /* For UNIX compatibility. */
113 extern uid_t getuid(void);
114 extern gid_t getgid(void);
115 extern uid_t geteuid(void);
116 extern gid_t getegid(void);
117 extern int setuid(uid_t uid);
118 extern int setgid(gid_t gid);
119 extern int kill(int pid, int sig);
120 extern void *sbrk(int need);
123 #define Stat win32_stat
125 #undef init_os_extras
126 #define init_os_extras Perl_init_os_extras
128 EXT void Perl_win32_init(int *argcp, char ***argvp);
129 EXT void Perl_init_os_extras(void);
131 #ifndef USE_SOCKETS_AS_HANDLES
132 extern FILE * my_fdopen(int, char *);
134 extern int my_fclose(FILE *);
135 extern int do_aspawn(void* really, void ** mark, void ** arglast);
136 extern int do_spawn(char *cmd);
137 extern char do_exec(char *cmd);
138 extern char * win32PerlLibPath(char *sfx,...);
139 extern int IsWin95(void);
140 extern int IsWinNT(void);
142 extern char * staticlinkmodules[];
146 typedef char * caddr_t; /* In malloc.c (core address). */
149 * handle socket stuff, assuming socket is always available
151 #include <sys/socket.h>
155 #define EMBEDMYMALLOC /**/
156 /* #define USE_PERL_SBRK /**/
157 /* #define PERL_SBRK_VIA_MALLOC /**/
160 #if defined(PERLDLL) && !defined(PERL_CORE)
164 #ifdef USE_BINMODE_SCRIPTS
165 #define PERL_SCRIPT_MODE "rb"
166 EXT void win32_strip_return(struct sv *sv);
168 #define PERL_SCRIPT_MODE "r"
169 #define win32_strip_return(sv) NOOP
172 #endif /* _INC_WIN32_PERL5 */