diff options
author | Emmanuele Bassi <ebassi@gnome.org> | 2017-02-01 00:02:16 +0000 |
---|---|---|
committer | Emmanuele Bassi <ebassi@gnome.org> | 2017-02-01 00:02:16 +0000 |
commit | 6973dd5db30057c66fd8db99c55917f671e5d380 (patch) | |
tree | 0b98d66cfce6c11e1ecf48289918fbdfd57e68e9 /include | |
parent | 5bcc550a6c85e7db4a8564aa292113e32d9993f0 (diff) | |
download | libepoxy-6973dd5db30057c66fd8db99c55917f671e5d380.tar.gz |
Add a fallback for missing stdbool.h
Older versions of the Microsoft Visual C compiler do not support C99 and
do not have stdbool.h.
Additionally, Epoxy is pretty much C89 compliant, and stdbool.h is part
of C99.
We can add a simple fallback for MSVC, in case we end up getting built
with it.
Diffstat (limited to 'include')
-rw-r--r-- | include/epoxy/common.h | 8 | ||||
-rw-r--r-- | include/epoxy/egl.h | 2 | ||||
-rw-r--r-- | include/epoxy/gl.h | 2 | ||||
-rw-r--r-- | include/epoxy/glx.h | 1 | ||||
-rw-r--r-- | include/epoxy/wgl.h | 1 |
5 files changed, 8 insertions, 6 deletions
diff --git a/include/epoxy/common.h b/include/epoxy/common.h index a745f16..a0b30b2 100644 --- a/include/epoxy/common.h +++ b/include/epoxy/common.h @@ -41,4 +41,12 @@ # define EPOXY_PUBLIC extern #endif +#if defined(_MSC_VER) && !defined(__bool_true_false_are_defined) && (_MSC_VER < 1800) +typedef unsigned char bool; +# define false 0 +# define true 1 +#else +# include <stdbool.h> +#endif + #endif /* EPOXY_COMMON_H */ diff --git a/include/epoxy/egl.h b/include/epoxy/egl.h index 79e9bb4..67b22ce 100644 --- a/include/epoxy/egl.h +++ b/include/epoxy/egl.h @@ -30,8 +30,6 @@ #ifndef EPOXY_EGL_H #define EPOXY_EGL_H -#include <stdbool.h> - #include "epoxy/common.h" #if defined(__egl_h_) || defined(__eglext_h_) diff --git a/include/epoxy/gl.h b/include/epoxy/gl.h index 425431c..c3a7437 100644 --- a/include/epoxy/gl.h +++ b/include/epoxy/gl.h @@ -30,8 +30,6 @@ #ifndef EPOXY_GL_H #define EPOXY_GL_H -#include <stdbool.h> - #include "epoxy/common.h" #if defined(__gl_h_) || defined(__glext_h_) diff --git a/include/epoxy/glx.h b/include/epoxy/glx.h index a67cb07..f5214f1 100644 --- a/include/epoxy/glx.h +++ b/include/epoxy/glx.h @@ -33,7 +33,6 @@ #include <epoxy/gl.h> #include <X11/Xlib.h> #include <X11/Xutil.h> -#include <stdbool.h> #if defined(GLX_H) || defined(__glxext_h_) #error epoxy/glx.h must be included before (or in place of) GL/glx.h diff --git a/include/epoxy/wgl.h b/include/epoxy/wgl.h index 84d26ac..503f899 100644 --- a/include/epoxy/wgl.h +++ b/include/epoxy/wgl.h @@ -30,7 +30,6 @@ #ifndef EPOXY_WGL_H #define EPOXY_WGL_H -#include <stdbool.h> #include <windows.h> #include "epoxy/common.h" |