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.
macos/v1.5.9
Emmanuele Bassi 8 years ago
parent 5bcc550a6c
commit 6973dd5db3
  1. 8
      include/epoxy/common.h
  2. 2
      include/epoxy/egl.h
  3. 2
      include/epoxy/gl.h
  4. 1
      include/epoxy/glx.h
  5. 1
      include/epoxy/wgl.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 */

@ -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_)

@ -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_)

@ -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

@ -30,7 +30,6 @@
#ifndef EPOXY_WGL_H
#define EPOXY_WGL_H
#include <stdbool.h>
#include <windows.h>
#include "epoxy/common.h"

Loading…
Cancel
Save