Gawain: define feature macros in a more compatible way
Thanks to @sergey for proactively testing clang 4.0, which does not accept defined(FOO) as part of macro definitions.
This commit is contained in:
@@ -11,8 +11,12 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#define TRUST_NO_ONE !defined(NDEBUG)
|
||||
// strict error checking, enabled for debug builds during early development
|
||||
#if defined(NDEBUG)
|
||||
#define TRUST_NO_ONE 1
|
||||
// strict error checking, enabled for debug builds during early development
|
||||
#else
|
||||
#define TRUST_NO_ONE 0
|
||||
#endif
|
||||
|
||||
#include <GL/glew.h>
|
||||
#include <stdbool.h>
|
||||
@@ -22,7 +26,11 @@
|
||||
#include <assert.h>
|
||||
#endif
|
||||
|
||||
#define APPLE_LEGACY (defined(__APPLE__) && defined(WITH_GL_PROFILE_COMPAT))
|
||||
#if defined(__APPLE__) && defined(WITH_GL_PROFILE_COMPAT)
|
||||
#define APPLE_LEGACY 1
|
||||
#else
|
||||
#define APPLE_LEGACY 1
|
||||
#endif
|
||||
|
||||
#if APPLE_LEGACY
|
||||
#undef glGenVertexArrays
|
||||
|
||||
@@ -17,9 +17,13 @@
|
||||
#define AVG_VERTEX_ATTRIB_NAME_LEN 5
|
||||
#define VERTEX_ATTRIB_NAMES_BUFFER_LEN ((AVG_VERTEX_ATTRIB_NAME_LEN + 1) * MAX_VERTEX_ATTRIBS)
|
||||
|
||||
#define USE_10_10_10 defined(_WIN32)
|
||||
// (GLEW_VERSION_3_3 || GLEW_ARB_vertex_type_2_10_10_10_rev)
|
||||
// ^-- this is only guaranteed on Windows right now, will be true on all platforms soon
|
||||
#if defined(_WIN32)
|
||||
// (GLEW_VERSION_3_3 || GLEW_ARB_vertex_type_2_10_10_10_rev)
|
||||
// ^-- this is only guaranteed on Windows right now, will be true on all platforms soon
|
||||
#define USE_10_10_10 1
|
||||
#else
|
||||
#define USE_10_10_10 0
|
||||
#endif
|
||||
|
||||
typedef enum {
|
||||
COMP_I8,
|
||||
|
||||
Reference in New Issue
Block a user