Skip to content

Commit 5132ad8

Browse files
committed
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.
1 parent 3864afa commit 5132ad8

File tree

1 file changed

+17
-13
lines changed

1 file changed

+17
-13
lines changed

src/include/port/win32.h

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -315,6 +315,7 @@ extern void pgwin32_unsetenv(const char *);
315315

316316
/* Things that exist in MingW headers, but need to be added to MSVC & BCC */
317317
#ifdef WIN32_ONLY_COMPILER
318+
318319
#ifndef _WIN64
319320
typedef long ssize_t;
320321
#else
@@ -323,24 +324,15 @@ typedef __int64 ssize_t;
323324

324325
#ifndef __BORLANDC__
325326
typedef unsigned short mode_t;
326-
#endif
327327

328-
#ifndef __BORLANDC__
329328
#define S_IRUSR _S_IREAD
330329
#define S_IWUSR _S_IWRITE
331330
#define S_IXUSR _S_IEXEC
332331
#define S_IRWXU (S_IRUSR | S_IWUSR | S_IXUSR)
333-
#define S_IRGRP 0
334-
#define S_IWGRP 0
335-
#define S_IXGRP 0
336-
#define S_IRWXG 0
337-
#define S_IROTH 0
338-
#define S_IWOTH 0
339-
#define S_IXOTH 0
340-
#define S_IRWXO 0
332+
/* see also S_IRGRP etc below */
341333
#define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
342334
#define S_ISREG(m) (((m) & S_IFMT) == S_IFREG)
343-
#endif
335+
#endif /* __BORLANDC__ */
344336

345337
#define F_OK 0
346338
#define W_OK 2
@@ -363,10 +355,22 @@ typedef unsigned short mode_t;
363355
#ifndef O_RANDOM
364356
#define O_RANDOM 0x0010 /* File access is primarily random */
365357
#define O_SEQUENTIAL 0x0020 /* File access is primarily sequential */
366-
#define O_TEMPORARY 0x0040 /* Temporary file bit */
358+
#define O_TEMPORARY 0x0040 /* Temporary file bit */
367359
#define O_SHORT_LIVED 0x1000 /* Temporary storage file, try not to flush */
368360
#define _O_SHORT_LIVED O_SHORT_LIVED
369361
#endif /* ifndef O_RANDOM */
370362
#endif /* __BORLANDC__ */
371363

372-
#endif
364+
#endif /* WIN32_ONLY_COMPILER */
365+
366+
/* These aren't provided by either MingW or MSVC */
367+
#ifndef __BORLANDC__
368+
#define S_IRGRP 0
369+
#define S_IWGRP 0
370+
#define S_IXGRP 0
371+
#define S_IRWXG 0
372+
#define S_IROTH 0
373+
#define S_IWOTH 0
374+
#define S_IXOTH 0
375+
#define S_IRWXO 0
376+
#endif /* __BORLANDC__ */

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy