Skip to content

Commit e16e1ab

Browse files
committed
Define WIN32_LEAN_AND_MEAN, NOMINMAX before including windows.h
fixes vimpunk#96
1 parent 3f86a95 commit e16e1ab

File tree

3 files changed

+24
-0
lines changed

3 files changed

+24
-0
lines changed

include/mio/mmap.hpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@
2929
#include <cstdint>
3030

3131
#ifdef _WIN32
32+
# ifndef NOMINMAX
33+
# define NOMINMAX
34+
# endif // NOMINMAX
3235
# ifndef WIN32_LEAN_AND_MEAN
3336
# define WIN32_LEAN_AND_MEAN
3437
# endif // WIN32_LEAN_AND_MEAN

include/mio/page.hpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,12 @@
2222
#define MIO_PAGE_HEADER
2323

2424
#ifdef _WIN32
25+
# ifndef NOMINMAX
26+
# define NOMINMAX
27+
# endif // NOMINMAX
28+
# ifndef WIN32_LEAN_AND_MEAN
29+
# define WIN32_LEAN_AND_MEAN
30+
# endif // WIN32_LEAN_AND_MEAN
2531
# include <windows.h>
2632
#else
2733
# include <unistd.h>

single_include/mio/mio.hpp

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,12 @@
4646
#define MIO_PAGE_HEADER
4747

4848
#ifdef _WIN32
49+
# ifndef NOMINMAX
50+
# define NOMINMAX
51+
# endif // NOMINMAX
52+
# ifndef WIN32_LEAN_AND_MEAN
53+
# define WIN32_LEAN_AND_MEAN
54+
# endif // WIN32_LEAN_AND_MEAN
4955
# include <windows.h>
5056
#else
5157
# include <unistd.h>
@@ -108,6 +114,9 @@ inline size_t make_offset_page_aligned(size_t offset) noexcept
108114
#include <cstdint>
109115

110116
#ifdef _WIN32
117+
# ifndef NOMINMAX
118+
# define NOMINMAX
119+
# endif // NOMINMAX
111120
# ifndef WIN32_LEAN_AND_MEAN
112121
# define WIN32_LEAN_AND_MEAN
113122
# endif // WIN32_LEAN_AND_MEAN
@@ -1297,6 +1306,12 @@ bool operator>=(const basic_mmap<AccessMode, ByteT>& a,
12971306
#define MIO_PAGE_HEADER
12981307

12991308
#ifdef _WIN32
1309+
# ifndef NOMINMAX
1310+
# define NOMINMAX
1311+
# endif // NOMINMAX
1312+
# ifndef WIN32_LEAN_AND_MEAN
1313+
# define WIN32_LEAN_AND_MEAN
1314+
# endif // WIN32_LEAN_AND_MEAN
13001315
# include <windows.h>
13011316
#else
13021317
# include <unistd.h>

0 commit comments

Comments
 (0)