1
0
mirror of synced 2024-11-28 09:30:51 +01:00

fix: MacOS Build errors because of khronos includes

This commit is contained in:
WerWolv 2023-01-21 00:11:33 +01:00
parent d4967018c2
commit 76d47bf856

View File

@ -32,7 +32,36 @@
#ifndef __gl3w_h_
#define __gl3w_h_
#include <KHR/khrplatform.h>
#if __has_include(<KHR/khrplatform.h>)
#include <KHR/khrplatform.h>
#else
// Adapted from KHR/khrplatform.h to avoid including entire file.
typedef float khronos_float_t;
typedef signed char khronos_int8_t;
typedef unsigned char khronos_uint8_t;
typedef signed short int khronos_int16_t;
typedef unsigned short int khronos_uint16_t;
#ifdef _WIN64
typedef signed long long int khronos_intptr_t;
typedef signed long long int khronos_ssize_t;
#else
typedef signed long int khronos_intptr_t;
typedef signed long int khronos_ssize_t;
#endif
#if defined(_MSC_VER) && !defined(__clang__)
typedef signed __int64 khronos_int64_t;
typedef unsigned __int64 khronos_uint64_t;
#elif (defined(__clang__) || defined(__GNUC__)) && (__cplusplus < 201100)
#include <stdint.h>
typedef int64_t khronos_int64_t;
typedef uint64_t khronos_uint64_t;
#else
typedef signed long long khronos_int64_t;
typedef unsigned long long khronos_uint64_t;
#endif
#endif
#ifndef __gl_glcorearb_h_
#define __gl_glcorearb_h_ 1
@ -85,8 +114,8 @@ extern "C" {
* Additional extensions included: _nomatch_^
* Extensions removed: _nomatch_^
*/
#ifndef GL_VERSION_1_0
#define GL_VERSION_1_0 1
#ifndef GL3W_GL_VERSION_1_0
#define GL3W_GL_VERSION_1_0 1
typedef void GLvoid;
typedef unsigned int GLenum;
@ -369,9 +398,9 @@ GLAPI GLboolean APIENTRY glIsEnabled (GLenum cap);
GLAPI void APIENTRY glDepthRange (GLdouble n, GLdouble f);
GLAPI void APIENTRY glViewport (GLint x, GLint y, GLsizei width, GLsizei height);
#endif
#endif /* GL_VERSION_1_0 */
//#ifndef GL_VERSION_1_1
//#define GL_VERSION_1_1 1
#endif /* GL3W_GL_VERSION_1_0 */
#ifndef GL3W_GL_VERSION_1_1
#define GL3W_GL_VERSION_1_1 1
typedef khronos_float_t GLclampf;
typedef double GLclampd;
#define GL_COLOR_LOGIC_OP 0x0BF2
@ -435,9 +464,9 @@ GLAPI void APIENTRY glDeleteTextures (GLsizei n, const GLuint *textures);
GLAPI void APIENTRY glGenTextures (GLsizei n, GLuint *textures);
GLAPI GLboolean APIENTRY glIsTexture (GLuint texture);
#endif
//#endif /* GL_VERSION_1_1 */
#ifndef GL_VERSION_1_2
#define GL_VERSION_1_2 1
#endif /* GL3W_GL_VERSION_1_1 */
#ifndef GL3W_GL_VERSION_1_2
#define GL3W_GL_VERSION_1_2 1
#define GL_UNSIGNED_BYTE_3_3_2 0x8032
#define GL_UNSIGNED_SHORT_4_4_4_4 0x8033
#define GL_UNSIGNED_SHORT_5_5_5_1 0x8034
@ -484,9 +513,9 @@ GLAPI void APIENTRY glTexImage3D (GLenum target, GLint level, GLint internalform
GLAPI void APIENTRY glTexSubImage3D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *pixels);
GLAPI void APIENTRY glCopyTexSubImage3D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height);
#endif
#endif /* GL_VERSION_1_2 */
#ifndef GL_VERSION_1_3
#define GL_VERSION_1_3 1
#endif /* GL3W_GL_VERSION_1_2 */
#ifndef GL3W_GL_VERSION_1_3
#define GL3W_GL_VERSION_1_3 1
#define GL_TEXTURE0 0x84C0
#define GL_TEXTURE1 0x84C1
#define GL_TEXTURE2 0x84C2
@ -566,9 +595,9 @@ GLAPI void APIENTRY glCompressedTexSubImage2D (GLenum target, GLint level, GLint
GLAPI void APIENTRY glCompressedTexSubImage1D (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const void *data);
GLAPI void APIENTRY glGetCompressedTexImage (GLenum target, GLint level, void *img);
#endif
#endif /* GL_VERSION_1_3 */
#ifndef GL_VERSION_1_4
#define GL_VERSION_1_4 1
#endif /* GL3W_GL_VERSION_1_3 */
#ifndef GL3W_GL_VERSION_1_4
#define GL3W_GL_VERSION_1_4 1
#define GL_BLEND_DST_RGB 0x80C8
#define GL_BLEND_SRC_RGB 0x80C9
#define GL_BLEND_DST_ALPHA 0x80CA
@ -616,9 +645,9 @@ GLAPI void APIENTRY glPointParameteriv (GLenum pname, const GLint *params);
GLAPI void APIENTRY glBlendColor (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);
GLAPI void APIENTRY glBlendEquation (GLenum mode);
#endif
#endif /* GL_VERSION_1_4 */
#ifndef GL_VERSION_1_5
#define GL_VERSION_1_5 1
#endif /* GL3W_GL_VERSION_1_4 */
#ifndef GL3W_GL_VERSION_1_5
#define GL3W_GL_VERSION_1_5 1
typedef khronos_ssize_t GLsizeiptr;
typedef khronos_intptr_t GLintptr;
#define GL_BUFFER_SIZE 0x8764
@ -689,9 +718,9 @@ GLAPI GLboolean APIENTRY glUnmapBuffer (GLenum target);
GLAPI void APIENTRY glGetBufferParameteriv (GLenum target, GLenum pname, GLint *params);
GLAPI void APIENTRY glGetBufferPointerv (GLenum target, GLenum pname, void **params);
#endif
#endif /* GL_VERSION_1_5 */
#ifndef GL_VERSION_2_0
#define GL_VERSION_2_0 1
#endif /* GL3W_GL_VERSION_1_5 */
#ifndef GL3W_GL_VERSION_2_0
#define GL3W_GL_VERSION_2_0 1
typedef char GLchar;
typedef khronos_int16_t GLshort;
typedef khronos_int8_t GLbyte;
@ -964,9 +993,9 @@ GLAPI void APIENTRY glVertexAttrib4uiv (GLuint index, const GLuint *v);
GLAPI void APIENTRY glVertexAttrib4usv (GLuint index, const GLushort *v);
GLAPI void APIENTRY glVertexAttribPointer (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void *pointer);
#endif
#endif /* GL_VERSION_2_0 */
#ifndef GL_VERSION_2_1
#define GL_VERSION_2_1 1
#endif /* GL3W_GL_VERSION_2_0 */
#ifndef GL3W_GL_VERSION_2_1
#define GL3W_GL_VERSION_2_1 1
#define GL_PIXEL_PACK_BUFFER 0x88EB
#define GL_PIXEL_UNPACK_BUFFER 0x88EC
#define GL_PIXEL_PACK_BUFFER_BINDING 0x88ED
@ -997,9 +1026,9 @@ GLAPI void APIENTRY glUniformMatrix4x2fv (GLint location, GLsizei count, GLboole
GLAPI void APIENTRY glUniformMatrix3x4fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
GLAPI void APIENTRY glUniformMatrix4x3fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
#endif
#endif /* GL_VERSION_2_1 */
#ifndef GL_VERSION_3_0
#define GL_VERSION_3_0 1
#endif /* GL3W_GL_VERSION_2_1 */
#ifndef GL3W_GL_VERSION_3_0
#define GL3W_GL_VERSION_3_0 1
typedef khronos_uint16_t GLhalf;
#define GL_COMPARE_REF_TO_TEXTURE 0x884E
#define GL_CLIP_DISTANCE0 0x3000
@ -1402,9 +1431,9 @@ GLAPI void APIENTRY glDeleteVertexArrays (GLsizei n, const GLuint *arrays);
GLAPI void APIENTRY glGenVertexArrays (GLsizei n, GLuint *arrays);
GLAPI GLboolean APIENTRY glIsVertexArray (GLuint array);
#endif
#endif /* GL_VERSION_3_0 */
#ifndef GL_VERSION_3_1
#define GL_VERSION_3_1 1
#endif /* GL3W_GL_VERSION_3_0 */
#ifndef GL3W_GL_VERSION_3_1
#define GL3W_GL_VERSION_3_1 1
#define GL_SAMPLER_2D_RECT 0x8B63
#define GL_SAMPLER_2D_RECT_SHADOW 0x8B64
#define GL_SAMPLER_BUFFER 0x8DC2
@ -1492,9 +1521,9 @@ GLAPI void APIENTRY glGetActiveUniformBlockiv (GLuint program, GLuint uniformBlo
GLAPI void APIENTRY glGetActiveUniformBlockName (GLuint program, GLuint uniformBlockIndex, GLsizei bufSize, GLsizei *length, GLchar *uniformBlockName);
GLAPI void APIENTRY glUniformBlockBinding (GLuint program, GLuint uniformBlockIndex, GLuint uniformBlockBinding);
#endif
#endif /* GL_VERSION_3_1 */
#ifndef GL_VERSION_3_2
#define GL_VERSION_3_2 1
#endif /* GL3W_GL_VERSION_3_1 */
#ifndef GL3W_GL_VERSION_3_2
#define GL3W_GL_VERSION_3_2 1
typedef struct __GLsync *GLsync;
typedef khronos_uint64_t GLuint64;
typedef khronos_int64_t GLint64;
@ -1602,9 +1631,9 @@ GLAPI void APIENTRY glTexImage3DMultisample (GLenum target, GLsizei samples, GLe
GLAPI void APIENTRY glGetMultisamplefv (GLenum pname, GLuint index, GLfloat *val);
GLAPI void APIENTRY glSampleMaski (GLuint maskNumber, GLbitfield mask);
#endif
#endif /* GL_VERSION_3_2 */
#ifndef GL_VERSION_3_3
#define GL_VERSION_3_3 1
#endif /* GL3W_GL_VERSION_3_2 */
#ifndef GL3W_GL_VERSION_3_3
#define GL3W_GL_VERSION_3_3 1
#define GL_VERTEX_ATTRIB_ARRAY_DIVISOR 0x88FE
#define GL_SRC1_COLOR 0x88F9
#define GL_ONE_MINUS_SRC1_COLOR 0x88FA
@ -1679,9 +1708,9 @@ GLAPI void APIENTRY glVertexAttribP3uiv (GLuint index, GLenum type, GLboolean no
GLAPI void APIENTRY glVertexAttribP4ui (GLuint index, GLenum type, GLboolean normalized, GLuint value);
GLAPI void APIENTRY glVertexAttribP4uiv (GLuint index, GLenum type, GLboolean normalized, const GLuint *value);
#endif
#endif /* GL_VERSION_3_3 */
#ifndef GL_VERSION_4_0
#define GL_VERSION_4_0 1
#endif /* GL3W_GL_VERSION_3_3 */
#ifndef GL3W_GL_VERSION_4_0
#define GL3W_GL_VERSION_4_0 1
#define GL_SAMPLE_SHADING 0x8C36
#define GL_MIN_SAMPLE_SHADING_VALUE 0x8C37
#define GL_MIN_PROGRAM_TEXTURE_GATHER_OFFSET 0x8E5E
@ -1853,9 +1882,9 @@ GLAPI void APIENTRY glBeginQueryIndexed (GLenum target, GLuint index, GLuint id)
GLAPI void APIENTRY glEndQueryIndexed (GLenum target, GLuint index);
GLAPI void APIENTRY glGetQueryIndexediv (GLenum target, GLuint index, GLenum pname, GLint *params);
#endif
#endif /* GL_VERSION_4_0 */
#ifndef GL_VERSION_4_1
#define GL_VERSION_4_1 1
#endif /* GL3W_GL_VERSION_4_0 */
#ifndef GL3W_GL_VERSION_4_1
#define GL3W_GL_VERSION_4_1 1
#define GL_FIXED 0x140C
#define GL_IMPLEMENTATION_COLOR_READ_TYPE 0x8B9A
#define GL_IMPLEMENTATION_COLOR_READ_FORMAT 0x8B9B
@ -2069,9 +2098,9 @@ GLAPI void APIENTRY glDepthRangeIndexed (GLuint index, GLdouble n, GLdouble f);
GLAPI void APIENTRY glGetFloati_v (GLenum target, GLuint index, GLfloat *data);
GLAPI void APIENTRY glGetDoublei_v (GLenum target, GLuint index, GLdouble *data);
#endif
#endif /* GL_VERSION_4_1 */
#ifndef GL_VERSION_4_2
#define GL_VERSION_4_2 1
#endif /* GL3W_GL_VERSION_4_1 */
#ifndef GL3W_GL_VERSION_4_2
#define GL3W_GL_VERSION_4_2 1
#define GL_COPY_READ_BUFFER_BINDING 0x8F36
#define GL_COPY_WRITE_BUFFER_BINDING 0x8F37
#define GL_TRANSFORM_FEEDBACK_ACTIVE 0x8E24
@ -2210,9 +2239,9 @@ GLAPI void APIENTRY glTexStorage3D (GLenum target, GLsizei levels, GLenum intern
GLAPI void APIENTRY glDrawTransformFeedbackInstanced (GLenum mode, GLuint id, GLsizei instancecount);
GLAPI void APIENTRY glDrawTransformFeedbackStreamInstanced (GLenum mode, GLuint id, GLuint stream, GLsizei instancecount);
#endif
#endif /* GL_VERSION_4_2 */
#ifndef GL_VERSION_4_3
#define GL_VERSION_4_3 1
#endif /* GL3W_GL_VERSION_4_2 */
#ifndef GL3W_GL_VERSION_4_3
#define GL3W_GL_VERSION_4_3 1
typedef void (APIENTRY *GLDEBUGPROC)(GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar *message,const void *userParam);
#define GL_NUM_SHADING_LANGUAGE_VERSIONS 0x82E9
#define GL_VERTEX_ATTRIB_ARRAY_LONG 0x874E
@ -2560,9 +2589,9 @@ GLAPI void APIENTRY glGetObjectLabel (GLenum identifier, GLuint name, GLsizei bu
GLAPI void APIENTRY glObjectPtrLabel (const void *ptr, GLsizei length, const GLchar *label);
GLAPI void APIENTRY glGetObjectPtrLabel (const void *ptr, GLsizei bufSize, GLsizei *length, GLchar *label);
#endif
#endif /* GL_VERSION_4_3 */
#ifndef GL_VERSION_4_4
#define GL_VERSION_4_4 1
#endif /* GL3W_GL_VERSION_4_3 */
#ifndef GL3W_GL_VERSION_4_4
#define GL3W_GL_VERSION_4_4 1
#define GL_MAX_VERTEX_ATTRIB_STRIDE 0x82E5
#define GL_PRIMITIVE_RESTART_FOR_PATCHES_SUPPORTED 0x8221
#define GL_TEXTURE_BUFFER_BINDING 0x8C2A
@ -2602,9 +2631,9 @@ GLAPI void APIENTRY glBindSamplers (GLuint first, GLsizei count, const GLuint *s
GLAPI void APIENTRY glBindImageTextures (GLuint first, GLsizei count, const GLuint *textures);
GLAPI void APIENTRY glBindVertexBuffers (GLuint first, GLsizei count, const GLuint *buffers, const GLintptr *offsets, const GLsizei *strides);
#endif
#endif /* GL_VERSION_4_4 */
#ifndef GL_VERSION_4_5
#define GL_VERSION_4_5 1
#endif /* GL3W_GL_VERSION_4_4 */
#ifndef GL3W_GL_VERSION_4_5
#define GL3W_GL_VERSION_4_5 1
#define GL_CONTEXT_LOST 0x0507
#define GL_NEGATIVE_ONE_TO_ONE 0x935E
#define GL_ZERO_TO_ONE 0x935F
@ -2849,9 +2878,9 @@ GLAPI void APIENTRY glGetnUniformuiv (GLuint program, GLint location, GLsizei bu
GLAPI void APIENTRY glReadnPixels (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, void *data);
GLAPI void APIENTRY glTextureBarrier (void);
#endif
#endif /* GL_VERSION_4_5 */
#ifndef GL_VERSION_4_6
#define GL_VERSION_4_6 1
#endif /* GL3W_GL_VERSION_4_5 */
#ifndef GL3W_GL_VERSION_4_6
#define GL3W_GL_VERSION_4_6 1
#define GL_SHADER_BINARY_FORMAT_SPIR_V 0x9551
#define GL_SPIR_V_BINARY 0x9552
#define GL_PARAMETER_BUFFER 0x80EE
@ -2884,7 +2913,7 @@ GLAPI void APIENTRY glMultiDrawArraysIndirectCount (GLenum mode, const void *ind
GLAPI void APIENTRY glMultiDrawElementsIndirectCount (GLenum mode, GLenum type, const void *indirect, GLintptr drawcount, GLsizei maxdrawcount, GLsizei stride);
GLAPI void APIENTRY glPolygonOffsetClamp (GLfloat factor, GLfloat units, GLfloat clamp);
#endif
#endif /* GL_VERSION_4_6 */
#endif /* GL3W_GL_VERSION_4_6 */
#ifndef GL_ARB_ES2_compatibility
#define GL_ARB_ES2_compatibility 1
#endif /* GL_ARB_ES2_compatibility */