Commit | Line | Data |
68dc0745 |
1 | /* WIN32.H |
2 | * |
3 | * (c) 1995 Microsoft Corporation. All rights reserved. |
4 | * Developed by hip communications inc., http://info.hip.com/info/ |
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 | */ |
0a753a76 |
9 | #ifndef _INC_WIN32_PERL5 |
10 | #define _INC_WIN32_PERL5 |
11 | |
12 | #define WIN32_LEAN_AND_MEAN |
13 | #include <windows.h> |
14 | |
68dc0745 |
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 */ |
0a753a76 |
19 | |
20 | #include <dirent.h> |
21 | #include <io.h> |
22 | #include <process.h> |
23 | #include <stdio.h> |
24 | #include <direct.h> |
25 | |
68dc0745 |
26 | /* For UNIX compatibility. */ |
0a753a76 |
27 | |
3e3baf6d |
28 | #ifdef __BORLANDC__ |
29 | |
30 | #define _access access |
31 | #define _chdir chdir |
32 | #include <sys/types.h> |
33 | |
34 | #pragma warn -ccc |
35 | #pragma warn -rch |
36 | #pragma warn -sig |
37 | #pragma warn -pia |
38 | #pragma warn -par |
39 | #pragma warn -aus |
40 | #pragma warn -use |
41 | #pragma warn -csu |
42 | #pragma warn -pro |
43 | |
44 | #else |
45 | |
0a753a76 |
46 | typedef long uid_t; |
47 | typedef long gid_t; |
48 | |
3e3baf6d |
49 | #endif |
0a753a76 |
50 | |
51 | extern uid_t getuid(void); |
52 | extern gid_t getgid(void); |
53 | extern uid_t geteuid(void); |
54 | extern gid_t getegid(void); |
0a753a76 |
55 | extern int setuid(uid_t uid); |
56 | extern int setgid(gid_t gid); |
3e3baf6d |
57 | |
0a753a76 |
58 | extern int kill(int pid, int sig); |
59 | |
3e3baf6d |
60 | extern char *staticlinkmodules[]; |
61 | |
62 | /* if USE_WIN32_RTL_ENV is not defined, Perl uses direct Win32 calls |
63 | * to read the environment, bypassing the runtime's (usually broken) |
64 | * facilities for accessing the same. See note in util.c/my_setenv(). |
65 | */ |
66 | /*#define USE_WIN32_RTL_ENV */ |
0a753a76 |
67 | #define USE_SOCKETS_AS_HANDLES |
68 | #ifndef USE_SOCKETS_AS_HANDLES |
69 | extern FILE *myfdopen(int, char *); |
70 | |
71 | #undef fdopen |
72 | #define fdopen myfdopen |
68dc0745 |
73 | #endif /* USE_SOCKETS_AS_HANDLES */ |
0a753a76 |
74 | |
68dc0745 |
75 | #define STANDARD_C 1 /* Perl5 likes standard C. */ |
76 | #define DOSISH 1 /* Take advantage of DOSish code in Perl5. */ |
0a753a76 |
77 | |
3e3baf6d |
78 | #define OP_BINARY O_BINARY /* Mistake in in pp_sys.c. */ |
0a753a76 |
79 | |
0a753a76 |
80 | #undef pipe |
3e3baf6d |
81 | #define pipe(fd) win32_pipe((fd), 512, O_BINARY) /* the pipe call is a bit different */ |
0a753a76 |
82 | |
83 | #undef pause |
84 | #define pause() sleep((32767L << 16) + 32767) |
85 | |
86 | |
87 | #undef times |
88 | #define times mytimes |
89 | |
90 | #undef alarm |
91 | #define alarm myalarm |
92 | |
93 | struct tms { |
94 | long tms_utime; |
95 | long tms_stime; |
96 | long tms_cutime; |
97 | long tms_cstime; |
68dc0745 |
98 | }; |
c90c0ff4 |
99 | |
0a753a76 |
100 | unsigned int sleep(unsigned int); |
3e3baf6d |
101 | char *win32PerlLibPath(void); |
0a753a76 |
102 | int mytimes(struct tms *timebuf); |
103 | unsigned int myalarm(unsigned int sec); |
104 | int do_aspawn(void* really, void** mark, void** arglast); |
105 | int do_spawn(char *cmd); |
106 | |
68dc0745 |
107 | typedef char * caddr_t; /* In malloc.c (core address). */ |
0a753a76 |
108 | |
68dc0745 |
109 | /* |
110 | * Extension Library, only good for VC |
111 | */ |
0a753a76 |
112 | |
113 | #define DllExport __declspec(dllexport) |
3e3baf6d |
114 | #define DllImport __declspec(dllimport) |
0a753a76 |
115 | |
68dc0745 |
116 | /* |
117 | * handle socket stuff, assuming socket is always available |
118 | */ |
0a753a76 |
119 | |
120 | #include <sys/socket.h> |
121 | #include <netdb.h> |
122 | |
3e3baf6d |
123 | #ifdef _MSC_VER |
0a753a76 |
124 | #pragma warning(disable: 4018 4035 4101 4102 4244 4245 4761) |
3e3baf6d |
125 | #endif |
0a753a76 |
126 | |
3fe9a6f1 |
127 | int IsWin95(void); |
128 | int IsWinNT(void); |
129 | |
130 | #ifndef VER_PLATFORM_WIN32_WINDOWS /* VC-2.0 headers dont have this */ |
131 | #define VER_PLATFORM_WIN32_WINDOWS 1 |
132 | #endif |
133 | |
68dc0745 |
134 | #endif /* _INC_WIN32_PERL5 */ |