]> wimlib.net Git - wimlib/commitdiff
wimlib.h: define bool for old MSVC versions
authorEric Biggers <ebiggers3@gmail.com>
Sun, 27 Nov 2016 23:24:38 +0000 (15:24 -0800)
committerEric Biggers <ebiggers3@gmail.com>
Mon, 28 Nov 2016 02:35:31 +0000 (18:35 -0800)
It's also unnecessary to define bool in C++ mode.

include/wimlib.h

index d22eb5811ffab8584caa3d30db7291ad0f606319..944c48cae60868cdc7cdbcaa1c8f1259a41e9eea 100644 (file)
 
 #include <stdio.h>
 #include <stddef.h>
 
 #include <stdio.h>
 #include <stddef.h>
-#include <stdbool.h>
+#ifndef __cplusplus
+#  if defined(_MSC_VER) && _MSC_VER < 1800 /* VS pre-2013? */
+     typedef unsigned char bool;
+#  else
+#    include <stdbool.h>
+#  endif
+#endif
 #include <stdint.h>
 #include <time.h>
 
 #include <stdint.h>
 #include <time.h>