1 /* $PostgreSQL: pgsql/src/include/port/win32.h,v 1.19 2004/02/23 20:48:03 tgl Exp $ */
3 /* undefine and redefine after #include */
11 /* Must be here to avoid conflicting with prototype in windows.h */
12 #define mkdir(a,b) mkdir(a)
17 /* defines for dynamic linking on Win32 platform */
18 #if defined(__CYGWIN__) || defined(__MINGW32__)
20 #if __GNUC__ && ! defined (__declspec)
21 #error You need egcs 1.1 or newer for compiling!
25 #define DLLIMPORT __declspec (dllexport)
26 #else /* not BUILDING_DLL */
27 #define DLLIMPORT __declspec (dllimport)
30 #elif defined(WIN32) && defined(_MSC_VER) /* not CYGWIN or MingW */
33 #define DLLIMPORT __declspec (dllexport)
35 #define DLLIMPORT __declspec (dllimport)
38 #else /* not CYGWIN, not MSVC, not MingW */
46 #undef HAVE_UNION_SEMUN
47 #define HAVE_UNION_SEMUN 1
52 #define IPC_PRIVATE 234564
53 #define IPC_NOWAIT 2048
74 int shmdt(const void *shmaddr);
75 void *shmat(int memId, void *shmaddr, int flag);
76 int shmctl(int shmid, int flag, struct shmid_ds * dummy);
77 int shmget(int memKey, int size, int flag);
87 unsigned short *array;
97 int semctl(int semId, int semNum, int flag, union semun);
98 int semget(int semKey, int semNum, int flags);
99 int semop(int semId, struct sembuf * sops, int flag);
101 #define sleep(sec) (Sleep(sec * 1000), /* no return value */ 0)
105 /* In libpq/pqsignal.c */
106 #define kill(pid,sig) pqkill(pid,sig)
107 int pqkill(int pid, int sig);
110 /* Some extra signals */
114 #define SIGABRT 22 /* Set to match W32 value -- not UNIX
123 #define SIGTTOU 22 /* Same as SIGABRT -- no problem, I hope */
130 int tz_minuteswest; /* Minutes west of GMT. */
131 int tz_dsttime; /* Nonzero if DST is ever in effect. */
134 /* for setitimer in backend/port/win32/timer.c */
135 #define ITIMER_REAL 0
137 struct timeval it_interval;
138 struct timeval it_value;
140 int setitimer(int which, const struct itimerval *value, struct itimerval *ovalue);
146 * Supplement to <sys/types.h>.
150 #define pid_t unsigned long
154 #define ushort unsigned short
157 * Supplement to <sys/stat.h>.
161 #define S_ISDIR(m) (((m) & _S_IFMT) == _S_IFDIR)
162 #define S_ISREG(m) (((m) & _S_IFMT) == _S_IFREG)
164 #define S_IRUSR _S_IREAD
165 #define S_IWUSR _S_IWRITE
166 #define S_IXUSR _S_IEXEC
167 #define S_IRWXU (_S_IREAD | _S_IWRITE | _S_IEXEC)
170 * Supplement to <errno.h>.
175 #define EINTR WSAEINTR
176 #define EAGAIN WSAEWOULDBLOCK
177 #define EMSGSIZE WSAEMSGSIZE
178 #define EAFNOSUPPORT WSAEAFNOSUPPORT
179 #define EWOULDBLOCK WSAEWOULDBLOCK
180 #define ECONNRESET WSAECONNRESET
181 #define EINPROGRESS WSAEINPROGRESS