Permalink
Browse files

Fix compile error with Visual Studio 2012

The standard header stdbool.h is not available
with old Visual Studio compilers
  • Loading branch information...
pepone authored and hartwork committed Aug 23, 2017
1 parent e0b290e commit b4b89c2ab0cc5325a41360c25ef9d2ccbe617e5c
Showing with 22 additions and 4 deletions.
  1. +10 −1 expat/lib/xmltok.c
  2. +12 −3 expat/tests/runtests.c
View
@@ -31,9 +31,18 @@
*/
#include <stddef.h>
#include <stdbool.h>
#include <string.h> // memcpy
#if defined(_MSC_VER) && (_MSC_VER <= 1700)
/* for vs2012/11.0/1700 and earlier Visual Studio compilers */
# define bool int
# define false 0
# define true 1
#else
# include <stdbool.h>
#endif
#ifdef _WIN32
#include "winconfig.h"
#else
View
@@ -41,11 +41,20 @@
#include <stdint.h>
#include <stddef.h> /* ptrdiff_t */
#include <ctype.h>
#ifndef __cplusplus
# include <stdbool.h>
#endif
#include <limits.h>
#if ! defined(__cplusplus)
# if defined(_MSC_VER) && (_MSC_VER <= 1700)
/* for vs2012/11.0/1700 and earlier Visual Studio compilers */
# define bool int
# define false 0
# define true 1
# else
# include <stdbool.h>
# endif
#endif
#include "expat.h"
#include "chardata.h"
#include "internal.h" /* for UNUSED_P only */

0 comments on commit b4b89c2

Please sign in to comment.