diff --git a/GNUmakefile b/GNUmakefile index 79c65e475..c81e4e559 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -129,13 +129,7 @@ glad_src := $(glad_root)/src glad_inc := $(glad_root)/include glad_obj := $(obj)/$(glad) -glad__no_cast_qual := -Wno-cast-qual -ifeq (4,$(GCC_MAJOR)) - ifneq (,$(filter 0 1 2 3 4,$(GCC_MINOR))) - glad__no_cast_qual := - endif -endif -glad_cflags := $(glad__no_cast_qual) +glad_cflags := ifeq ($(RENDERTYPE),WIN) glad_objs += glad_wgl.c diff --git a/source/glad/include/glad/glad.h b/source/glad/include/glad/glad.h index f2858a957..b14c77acb 100644 --- a/source/glad/include/glad/glad.h +++ b/source/glad/include/glad/glad.h @@ -1,6 +1,6 @@ /* - OpenGL, OpenGL ES loader generated by glad 0.1.18a0 on Thu Mar 22 01:10:42 2018. + OpenGL, OpenGL ES loader generated by glad 0.1.25 on Mon Jul 23 02:57:25 2018. Language/Generator: C/C++ Specification: gl @@ -180,16 +180,8 @@ typedef unsigned int GLhandleARB; typedef unsigned short GLhalfARB; typedef unsigned short GLhalf; typedef GLint GLfixed; -#if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && (__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ > 1060) -typedef long GLintptr; -#else -typedef ptrdiff_t GLintptr; -#endif -#if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && (__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ > 1060) -typedef long GLsizeiptr; -#else -typedef ptrdiff_t GLsizeiptr; -#endif +typedef khronos_intptr_t GLintptr; +typedef khronos_ssize_t GLsizeiptr; typedef int64_t GLint64; typedef uint64_t GLuint64; #if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && (__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ > 1060) diff --git a/source/glad/include/glad/glad_wgl.h b/source/glad/include/glad/glad_wgl.h index 368115802..d41ff1bae 100644 --- a/source/glad/include/glad/glad_wgl.h +++ b/source/glad/include/glad/glad_wgl.h @@ -1,6 +1,6 @@ /* - WGL loader generated by glad 0.1.18a0 on Thu Mar 22 01:11:56 2018. + WGL loader generated by glad 0.1.25 on Mon Jul 23 02:57:35 2018. Language/Generator: C/C++ Specification: wgl diff --git a/source/glad/src/glad.c b/source/glad/src/glad.c index 9ab66ace1..d792b3292 100644 --- a/source/glad/src/glad.c +++ b/source/glad/src/glad.c @@ -1,6 +1,6 @@ /* - OpenGL, OpenGL ES loader generated by glad 0.1.18a0 on Thu Mar 22 01:10:42 2018. + OpenGL, OpenGL ES loader generated by glad 0.1.25 on Mon Jul 23 02:57:25 2018. Language/Generator: C/C++ Specification: gl @@ -37,21 +37,41 @@ static void* get_proc(const char *namez); -#ifdef _WIN32 +#if defined(_WIN32) || defined(__CYGWIN__) #include static HMODULE libGL; typedef void* (APIENTRYP PFNWGLGETPROCADDRESSPROC_PRIVATE)(const char*); static PFNWGLGETPROCADDRESSPROC_PRIVATE gladGetProcAddressPtr; +#ifdef _MSC_VER +#ifdef __has_include + #if __has_include() + #define HAVE_WINAPIFAMILY 1 + #endif +#elif _MSC_VER >= 1700 && !_USING_V110_SDK71_ + #define HAVE_WINAPIFAMILY 1 +#endif +#endif + +#ifdef HAVE_WINAPIFAMILY + #include + #if !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) && WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP) + #define IS_UWP 1 + #endif +#endif + static int open_gl(void) { +#ifndef IS_UWP libGL = LoadLibraryW(L"opengl32.dll"); if(libGL != NULL) { - gladGetProcAddressPtr = (PFNWGLGETPROCADDRESSPROC_PRIVATE)GetProcAddress( - libGL, "wglGetProcAddress"); + void (* tmp)(void); + tmp = (void(*)(void)) GetProcAddress(libGL, "wglGetProcAddress"); + gladGetProcAddressPtr = (PFNWGLGETPROCADDRESSPROC_PRIVATE) tmp; return gladGetProcAddressPtr != NULL; } +#endif return 0; } @@ -60,7 +80,7 @@ static void close_gl(void) { if(libGL != NULL) { FreeLibrary((HMODULE) libGL); - libGL = NULL; + libGL = NULL; } } #else @@ -123,7 +143,7 @@ void* get_proc(const char *namez) { } #endif if(result == NULL) { -#ifdef _WIN32 +#if defined(_WIN32) || defined(__CYGWIN__) result = (void*)GetProcAddress((HMODULE) libGL, namez); #else result = dlsym(libGL, namez); @@ -155,7 +175,7 @@ static int max_loaded_minor; static const char *exts = NULL; static int num_exts_i = 0; -static const char **exts_i = NULL; +static char **exts_i = NULL; static int get_exts(void) { #ifdef _GLAD_IS_SOME_NEW_VERSION @@ -169,7 +189,7 @@ static int get_exts(void) { num_exts_i = 0; glGetIntegerv(GL_NUM_EXTENSIONS, &num_exts_i); if (num_exts_i > 0) { - exts_i = (const char **)realloc((void *)exts_i, (size_t)num_exts_i * (sizeof *exts_i)); + exts_i = (char **)realloc((void *)exts_i, (size_t)num_exts_i * (sizeof *exts_i)); } if (exts_i == NULL) { @@ -182,11 +202,7 @@ static int get_exts(void) { char *local_str = (char*)malloc((len+1) * sizeof(char)); if(local_str != NULL) { -#if _MSC_VER >= 1400 - strncpy_s(local_str, len+1, gl_str_tmp, len); -#else - strncpy(local_str, gl_str_tmp, len+1); -#endif + memcpy(local_str, gl_str_tmp, (len+1) * sizeof(char)); } exts_i[index] = local_str; } diff --git a/source/glad/src/glad_wgl.c b/source/glad/src/glad_wgl.c index 91e2b95ea..40d89d0e1 100644 --- a/source/glad/src/glad_wgl.c +++ b/source/glad/src/glad_wgl.c @@ -1,6 +1,6 @@ /* - WGL loader generated by glad 0.1.18a0 on Thu Mar 22 01:11:56 2018. + WGL loader generated by glad 0.1.25 on Mon Jul 23 02:57:35 2018. Language/Generator: C/C++ Specification: wgl @@ -30,21 +30,41 @@ static void* get_proc(const char *namez); -#ifdef _WIN32 +#if defined(_WIN32) || defined(__CYGWIN__) #include static HMODULE libGL; typedef void* (APIENTRYP PFNWGLGETPROCADDRESSPROC_PRIVATE)(const char*); static PFNWGLGETPROCADDRESSPROC_PRIVATE gladGetProcAddressPtr; +#ifdef _MSC_VER +#ifdef __has_include + #if __has_include() + #define HAVE_WINAPIFAMILY 1 + #endif +#elif _MSC_VER >= 1700 && !_USING_V110_SDK71_ + #define HAVE_WINAPIFAMILY 1 +#endif +#endif + +#ifdef HAVE_WINAPIFAMILY + #include + #if !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) && WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP) + #define IS_UWP 1 + #endif +#endif + static int open_gl(void) { +#ifndef IS_UWP libGL = LoadLibraryW(L"opengl32.dll"); if(libGL != NULL) { - gladGetProcAddressPtr = (PFNWGLGETPROCADDRESSPROC_PRIVATE)GetProcAddress( - libGL, "wglGetProcAddress"); + void (* tmp)(void); + tmp = (void(*)(void)) GetProcAddress(libGL, "wglGetProcAddress"); + gladGetProcAddressPtr = (PFNWGLGETPROCADDRESSPROC_PRIVATE) tmp; return gladGetProcAddressPtr != NULL; } +#endif return 0; } @@ -53,7 +73,7 @@ static void close_gl(void) { if(libGL != NULL) { FreeLibrary((HMODULE) libGL); - libGL = NULL; + libGL = NULL; } } #else @@ -116,7 +136,7 @@ void* get_proc(const char *namez) { } #endif if(result == NULL) { -#ifdef _WIN32 +#if defined(_WIN32) || defined(__CYGWIN__) result = (void*)GetProcAddress((HMODULE) libGL, namez); #else result = dlsym(libGL, namez);