1 |
#ifdef _WIN32 |
2 |
|
3 |
/* We define this in OS-specific code which include's config.h */ |
4 |
#ifndef _SWISH_PORT |
5 |
# include "win32/dirent.h" |
6 |
# include "pcreposix.h" |
7 |
# include "win32/mkstemp.h" |
8 |
#endif |
9 |
|
10 |
/* Special Inclusions */ |
11 |
#include <stdlib.h> /* _sleep() */ |
12 |
#include <process.h> /* _getpid() */ |
13 |
#include <io.h> /* _umask(), _mktemp, etc */ |
14 |
#include <fcntl.h> /* Most io.h functions want this */ |
15 |
#include <sys/types.h> /* Most io.h functions want this */ |
16 |
#include <sys/stat.h> /* Most io.h functions want this */ |
17 |
|
18 |
/* ifdef logic */ |
19 |
#define NO_GETTOD /* Win32 has no Get Time Of Day */ |
20 |
#define NO_SYMBOLIC_FILE_LINKS /* Win32 has no symbolic links */ |
21 |
#undef INDEXPERMS /* Win32 has no chmod() - DLN 2001-11-05 Umm, yes it does... */ |
22 |
#define HAVE_STDLIB_H /* We need stdlib.h instead of unistd.h */ |
23 |
#define HAVE_PROCESS_H /* _getpid is here */ |
24 |
#define HAVE_VARARGS_H /* va_list, vsnprintf, etc */ |
25 |
#define HAVE_LIBXML2 1 /* enable libxml2 XML parser */ |
26 |
#define HAVE_STRING_H /* For mkstemp from libiberty */ |
27 |
|
28 |
/* Macros which rewrite values */ |
29 |
#define SWISH_VERSION "2.1-dev-26" /* Should we find a better way to handle this */ |
30 |
|
31 |
/* Internal SWISH-E File Access Modes */ |
32 |
#define FILEMODE_READ "rb" /* Read only */ |
33 |
#define FILEMODE_WRITE "wb" /* Write only */ |
34 |
#define FILEMODE_READWRITE "rb+" /* Read Write */ |
35 |
|
36 |
/* External POSIX File Access Modes */ |
37 |
#define O_RDWR _O_RDWR |
38 |
#define O_CREAT _O_CREAT |
39 |
#define O_EXCL _O_EXCL |
40 |
#define O_BINARY _O_BINARY |
41 |
|
42 |
/* Win32 filename lengths */ |
43 |
#define SW_MAXPATHNAME 4096 |
44 |
#define SW_MAXFILENAME 256 |
45 |
|
46 |
/* Type definitions */ |
47 |
typedef int pid_t; /* process ID */ |
48 |
typedef int mode_t; /* file permission mode ID */ |
49 |
|
50 |
/* Rewrite ANSI functions to Win32 equivalents */ |
51 |
#define popen _popen |
52 |
#define pclose _pclose |
53 |
#define strcasecmp stricmp |
54 |
#define strncasecmp strnicmp |
55 |
#define sleep _sleep |
56 |
#define getpid _getpid |
57 |
#define umask _umask |
58 |
#define vsnprintf _vsnprintf |
59 |
#define stat _stat |
60 |
|
61 |
#endif |