Skip to content
Permalink
Browse files

define S_ISDIR for win32 #94

Followup on #383.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
  • Loading branch information
rkitover committed Mar 7, 2019
1 parent 7373da1 commit 6a98f3c20008bf0d281fda85005f4e318a59e847
Showing with 9 additions and 3 deletions.
  1. +5 −2 src/common/ConfigManager.cpp
  2. +4 −1 src/sdl/SDL.cpp
@@ -40,7 +40,10 @@ extern "C" {
#define snprintf sprintf
#define stat _stat
#define mkdir(X,Y) (_mkdir(X))
#define S_ISDIR _S_IFDIR
// from: https://www.linuxquestions.org/questions/programming-9/porting-to-win32-429334/
#ifndef S_ISDIR
#define S_ISDIR(mode) (((mode) & _S_IFMT) == _S_IFDIR)
#endif
#endif // _WIN32

#ifndef __GNUC__
@@ -679,7 +682,7 @@ const char* FindConfigFile(const char *name)
while (tok) {
sprintf(path, "%s%c%s", tok, FILE_SEP, EXE_NAME);
if (FileExists(path)) {
char path2[2048];
static char path2[2048];
sprintf(path2, "%s%c%s", tok, FILE_SEP, name);
if (FileExists(path2)) {
return path2;
@@ -73,7 +73,10 @@
#define snprintf sprintf
#define stat _stat
#define mkdir(X,Y) (_mkdir(X))
#define S_ISDIR _S_IFDIR
// from: https://www.linuxquestions.org/questions/programming-9/porting-to-win32-429334/
#ifndef S_ISDIR
#define S_ISDIR(mode) (((mode) & _S_IFMT) == _S_IFDIR)
#endif
#endif // _WIN32

#ifndef __GNUC__

1 comment on commit 6a98f3c

@denisfa

This comment has been minimized.

Copy link
Collaborator

denisfa commented on 6a98f3c Mar 7, 2019

Nice! I just setup a Windows VM so I could test some stuff. I was going to think how to redo this exactly.

Please sign in to comment.
You can’t perform that action at this time.