Skip to content

Commit 747f815

Browse files
committed
r11911
2 parents 387648e + d1a40de commit 747f815

3 files changed

Lines changed: 14 additions & 3 deletions

File tree

revision.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
#define REVISION 11910
1+
#define REVISION 11911

src/simutrans/revision.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
#define REVISION 11910
1+
#define REVISION 11911

src/simutrans/sys/simsys.cc

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
#include <stdio.h>
88
#include <stdlib.h>
99
#include <string.h>
10-
#include <sys/stat.h>
1110
#include <sys/types.h>
1211

1312
#ifdef __HAIKU__
@@ -73,6 +72,18 @@
7372
# define L_DEBUG_TEXT
7473
#endif
7574

75+
// Windows does not define the S_ISREG macro in stat.h.
76+
// We have to define _CRT_INTERNAL_NONSTDC_NAMES 1 before #including sys/stat.h
77+
// in order for Microsoft's stat.h to define names like S_IFMT, S_IFREG,
78+
// rather than just defining _S_IFMT and _S_IFREG as it normally does.
79+
#define _CRT_INTERNAL_NONSTDC_NAMES 1
80+
#include <sys/stat.h>
81+
82+
#if !defined(S_ISREG) && defined(S_IFMT) && defined(S_IFREG)
83+
# define S_ISREG(m) (((m) & S_IFMT) == S_IFREG)
84+
#endif
85+
86+
7687
sys_event_t sys_event;
7788

7889

0 commit comments

Comments
 (0)