Skip to content

Commit

Permalink
Define some UNIX constants in sqWin32Directory.c, MSVC oblige
Browse files Browse the repository at this point in the history
the unix constants S_IRUSR are not defined in MSVC.
Pick the workaround from platforms/minheadless/windows/sqWin32Directory.c
  • Loading branch information
nicolas-cellier-aka-nice committed Dec 25, 2018
1 parent a08c1fe commit 57d09ae
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions platforms/win32/vm/sqWin32Directory.c
Expand Up @@ -19,6 +19,17 @@
# include <sys/types.h>
# include <sys/stat.h>

/**
* Posix permissions are not defined in Windows, except when using
* Mingw or Cygwin. Since these constants are just standard, we define
* them for our purpose of emulating permissions.
*/
#ifndef S_IRUSR
#define S_IRUSR 0400
#define S_IWUSR 0200
#define S_IXUSR 0100
#endif

extern struct VirtualMachine *interpreterProxy;

#define FAIL() { return interpreterProxy->primitiveFail(); }
Expand Down

0 comments on commit 57d09ae

Please sign in to comment.