Commit 5132ad8b authored by Tom Lane's avatar Tom Lane

Make S_IRGRP etc available in mingw builds as well as MSVC.

(Hm, I wonder whether BCC defines them either...)

Also label dangling endifs a bit better in this area.
parent 3864afa1
...@@ -315,6 +315,7 @@ extern void pgwin32_unsetenv(const char *); ...@@ -315,6 +315,7 @@ extern void pgwin32_unsetenv(const char *);
/* Things that exist in MingW headers, but need to be added to MSVC & BCC */ /* Things that exist in MingW headers, but need to be added to MSVC & BCC */
#ifdef WIN32_ONLY_COMPILER #ifdef WIN32_ONLY_COMPILER
#ifndef _WIN64 #ifndef _WIN64
typedef long ssize_t; typedef long ssize_t;
#else #else
...@@ -323,24 +324,15 @@ typedef __int64 ssize_t; ...@@ -323,24 +324,15 @@ typedef __int64 ssize_t;
#ifndef __BORLANDC__ #ifndef __BORLANDC__
typedef unsigned short mode_t; typedef unsigned short mode_t;
#endif
#ifndef __BORLANDC__
#define S_IRUSR _S_IREAD #define S_IRUSR _S_IREAD
#define S_IWUSR _S_IWRITE #define S_IWUSR _S_IWRITE
#define S_IXUSR _S_IEXEC #define S_IXUSR _S_IEXEC
#define S_IRWXU (S_IRUSR | S_IWUSR | S_IXUSR) #define S_IRWXU (S_IRUSR | S_IWUSR | S_IXUSR)
#define S_IRGRP 0 /* see also S_IRGRP etc below */
#define S_IWGRP 0
#define S_IXGRP 0
#define S_IRWXG 0
#define S_IROTH 0
#define S_IWOTH 0
#define S_IXOTH 0
#define S_IRWXO 0
#define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR) #define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
#define S_ISREG(m) (((m) & S_IFMT) == S_IFREG) #define S_ISREG(m) (((m) & S_IFMT) == S_IFREG)
#endif #endif /* __BORLANDC__ */
#define F_OK 0 #define F_OK 0
#define W_OK 2 #define W_OK 2
...@@ -363,10 +355,22 @@ typedef unsigned short mode_t; ...@@ -363,10 +355,22 @@ typedef unsigned short mode_t;
#ifndef O_RANDOM #ifndef O_RANDOM
#define O_RANDOM 0x0010 /* File access is primarily random */ #define O_RANDOM 0x0010 /* File access is primarily random */
#define O_SEQUENTIAL 0x0020 /* File access is primarily sequential */ #define O_SEQUENTIAL 0x0020 /* File access is primarily sequential */
#define O_TEMPORARY 0x0040 /* Temporary file bit */ #define O_TEMPORARY 0x0040 /* Temporary file bit */
#define O_SHORT_LIVED 0x1000 /* Temporary storage file, try not to flush */ #define O_SHORT_LIVED 0x1000 /* Temporary storage file, try not to flush */
#define _O_SHORT_LIVED O_SHORT_LIVED #define _O_SHORT_LIVED O_SHORT_LIVED
#endif /* ifndef O_RANDOM */ #endif /* ifndef O_RANDOM */
#endif /* __BORLANDC__ */ #endif /* __BORLANDC__ */
#endif #endif /* WIN32_ONLY_COMPILER */
/* These aren't provided by either MingW or MSVC */
#ifndef __BORLANDC__
#define S_IRGRP 0
#define S_IWGRP 0
#define S_IXGRP 0
#define S_IRWXG 0
#define S_IROTH 0
#define S_IWOTH 0
#define S_IXOTH 0
#define S_IRWXO 0
#endif /* __BORLANDC__ */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment