Skip to content

Commit

Permalink
More Windows build fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
hyperrealm committed Nov 22, 2022
1 parent 54e943f commit 384841a
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions lib/wincompat.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
#define _STDLIB_H
#endif

#include <io.h>
#include <malloc.h>

#ifdef _MSC_VER
Expand Down Expand Up @@ -65,6 +66,10 @@
|| defined(WIN64) || defined(_WIN64) || defined(__WIN64__) \
|| defined(__MINGW32__))

#ifndef STDERR_FILENO
#define STDERR_FILENO 2
#endif

#define INT64_FMT "%I64d"
#define UINT64_FMT "%I64u"

Expand Down Expand Up @@ -104,7 +109,7 @@

extern int fsync(int fd);

#else /* defined(WIN32/WIN64) && ! defined(__MINGW32__) */
#else /* !( defined(WIN32/WIN64) && ! defined(__MINGW32__) ) */

#define INT64_CONST(I) (I ## LL)
#define UINT64_CONST(I) (I ## ULL)
Expand All @@ -114,10 +119,6 @@ extern int fsync(int fd);

#include <unistd.h> /* for fsync() */

#ifndef STDERR_FILENO
#define STDERR_FILENO 2
#endif

#endif /* defined(WIN32/WIN64) && ! defined(__MINGW32__) */

#endif /* __wincompat_h */

0 comments on commit 384841a

Please sign in to comment.