Skip to content

Commit 12ad43e

Browse files
committed
MSVC lacks stdbool.h
1 parent b5af88b commit 12ad43e

2 files changed

Lines changed: 17 additions & 4 deletions

File tree

src/base/CMakeLists.txt

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,11 @@ set(SC_BASE_SOURCES
77
)
88

99
set(SC_BASE_HDRS
10-
sc_benchmark.h
11-
sc_memmgr.h
12-
sc_getopt.h
13-
sc_trace_fprintf.h
10+
sc_benchmark.h
11+
sc_memmgr.h
12+
sc_getopt.h
13+
sc_trace_fprintf.h
14+
sc_stdbool.h
1415
)
1516

1617
if(MINGW OR MSVC OR BORLAND)

src/base/sc_stdbool.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#ifndef SC_STDBOOL_H
2+
#define SC_STDBOOL_H
3+
4+
#ifdef _WIN32
5+
typedef int bool;
6+
# define false 0
7+
# define true 1
8+
#else
9+
# include <stdbool.h>
10+
#endif
11+
12+
#endif /* SC_STDBOOL_H */

0 commit comments

Comments
 (0)