Skip to content

Commit

Permalink
fix(runtime): mman_win no longer include windows.h in header
Browse files Browse the repository at this point in the history
  • Loading branch information
JaDogg committed Mar 1, 2024
1 parent 995bc91 commit 67a61e5
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 20 deletions.
21 changes: 1 addition & 20 deletions compiler/runtime/_include_mman_win.h
Original file line number Diff line number Diff line change
@@ -1,25 +1,6 @@
#define WIN32_LEAN_AND_MEAN// Exclude rarely-used stuff from Windows headers
#include <stdint.h>
#include <time.h>
#include <windows.h>
#ifndef ssize_t
#define ssize_t intmax_t
#endif
// Below code is originally from mman-win32
//
/*
* sys/mman.h
* mman-win32
*/
#ifndef _WIN32_WINNT// Allow use of features specific to Windows XP or later.
#define _WIN32_WINNT \
0x0501// Change this to the appropriate value to target other versions of Windows.
#endif
/* All the headers include this file. */
#ifndef _MSC_VER
#include <_mingw.h>
#endif
#include <sys/types.h>
#include <stdint.h>
#define PROT_NONE 0
#define PROT_READ 1
#define PROT_WRITE 2
Expand Down
17 changes: 17 additions & 0 deletions compiler/runtime/yk__system.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,23 @@
#include <sys/types.h>
#include <sys/stat.h>
#endif
#ifndef ssize_t
#define ssize_t intmax_t
#endif
// Below code is originally from mman-win32
//
/*
* sys/mman.h
* mman-win32
*/
#ifndef _WIN32_WINNT// Allow use of features specific to Windows XP or later.
#define _WIN32_WINNT \
0x0501// Change this to the appropriate value to target other versions of Windows.
#endif
/* All the headers include this file. */
#ifndef _MSC_VER
#include <_mingw.h>
#endif
// clang-format on
void yk__printint(intmax_t to_print) {
#if defined(_WIN32) || defined(_WIN64)
Expand Down

0 comments on commit 67a61e5

Please sign in to comment.