6
6
* Portions Copyright (c) 1996-2004, PostgreSQL Global Development Group
7
7
* Portions Copyright (c) 1994, Regents of the University of California
8
8
*
9
- * $PostgreSQL: pgsql/src/include/port.h,v 1.66 2004/11/08 16:34:23 momjian Exp $
9
+ * $PostgreSQL: pgsql/src/include/port.h,v 1.67 2004/11/17 17:46:15 tgl Exp $
10
10
*
11
11
*-------------------------------------------------------------------------
12
12
*/
@@ -73,9 +73,13 @@ extern int find_other_exec(const char *argv0, const char *target,
73
73
74
74
#if defined(WIN32 ) || defined(__CYGWIN__ )
75
75
#define EXE ".exe"
76
- #define DEVNULL "nul"
77
76
#else
78
77
#define EXE ""
78
+ #endif
79
+
80
+ #if defined(WIN32 ) && !defined(__CYGWIN__ )
81
+ #define DEVNULL "nul"
82
+ #else
79
83
#define DEVNULL "/dev/null"
80
84
#endif
81
85
@@ -88,13 +92,13 @@ extern int find_other_exec(const char *argv0, const char *target,
88
92
* See the "Notes" section about quotes at:
89
93
* http://home.earthlink.net/~rlively/MANUALS/COMMANDS/C/CMD.HTM
90
94
*/
91
- #ifdef WIN32
95
+ #if defined( WIN32 ) && !defined( __CYGWIN__ )
92
96
#define SYSTEMQUOTE "\""
93
97
#else
94
98
#define SYSTEMQUOTE ""
95
99
#endif
96
100
97
- #ifdef WIN32
101
+ #if defined( WIN32 ) && !defined( __CYGWIN__ )
98
102
#define HOMEDIR "USERPROFILE"
99
103
#else
100
104
#define HOMEDIR "HOME"
@@ -163,8 +167,9 @@ extern int pgunlink(const char *path);
163
167
* Cygwin has its own symlinks which work on Win95/98/ME where
164
168
* junction points don't, so use it instead. We have no way of
165
169
* knowing what type of system Cygwin binaries will be run on.
170
+ * Note: Some CYGWIN includes might #define WIN32.
166
171
*/
167
- #ifdef WIN32
172
+ #if defined( WIN32 ) && !defined( __CYGWIN__ )
168
173
extern int pgsymlink (const char * oldpath , const char * newpath );
169
174
#define symlink (oldpath , newpath ) pgsymlink(oldpath, newpath)
170
175
#endif
@@ -173,7 +178,7 @@ extern int pgsymlink(const char *oldpath, const char *newpath);
173
178
174
179
extern bool rmtree (char * path , bool rmtopdir );
175
180
176
- #ifdef WIN32
181
+ #if defined( WIN32 ) && !defined( __CYGWIN__ )
177
182
178
183
/* open() replacement to allow delete of held files */
179
184
#ifndef WIN32_CLIENT_ONLY
@@ -266,7 +271,7 @@ extern void srandom(unsigned int seed);
266
271
/* thread.h */
267
272
extern char * pqStrerror (int errnum , char * strerrbuf , size_t buflen );
268
273
269
- #ifndef WIN32
274
+ #if !defined( WIN32 ) || defined( __CYGWIN__ )
270
275
extern int pqGetpwuid (uid_t uid , struct passwd * resultbuf , char * buffer ,
271
276
size_t buflen , struct passwd * * result );
272
277
#endif
0 commit comments