- remove Windows includes from gl_load.h

This is one of two places that unconditionally pulled in all Windows headers into the GL code.
We also do not need the cruft for defining the standard integer types. GZDoom is C++11 which means that stdint.h will be present. So the madness with the definitions should be avoided to ensure that the types are always the same.
This commit is contained in:
Christoph Oelckers 2017-03-09 13:03:49 +01:00
parent 03e1cbcfc0
commit 05919a2926
2 changed files with 9 additions and 53 deletions

View File

@ -42,6 +42,8 @@ static void* PosixGetProcAddress (const GLubyte* name)
#if defined(_WIN32)
#include <windows.h>
#ifdef _MSC_VER
// disable inlining here because it creates an incredible amount of bloat in this file.
#pragma inline_depth(0)

View File

@ -26,23 +26,11 @@
#define __gltypes_h_
#define __gl_ATI_h_
/* BEGINNING OF MANUAL CHANGES, DO NOT REMOVE! */
#ifndef APIENTRY
#if defined(__MINGW32__)
#ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN 1
#endif
#ifndef NOMINMAX
#define NOMINMAX
#endif
#include <windows.h>
#elif (_MSC_VER >= 800) || defined(_STDCALL_SUPPORTED) || defined(__BORLANDC__)
#ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN 1
#endif
#ifndef NOMINMAX
#define NOMINMAX
#endif
#include <windows.h>
#if defined(_WIN32)
//#include <windows.h>
#define APIENTRY __stdcall
#else
#define APIENTRY
#endif
@ -51,7 +39,7 @@
#ifndef CODEGEN_FUNCPTR
#define CODEGEN_REMOVE_FUNCPTR
#if defined(_WIN32)
#define CODEGEN_FUNCPTR APIENTRY
#define CODEGEN_FUNCPTR __stdcall
#else
#define CODEGEN_FUNCPTR
#endif
@ -60,6 +48,7 @@
#ifndef GLAPI
#define GLAPI extern
#endif
/* END OF MANUAL CHANGES, DO NOT REMOVE! */
#ifndef GL_LOAD_GEN_BASIC_OPENGL_TYPEDEFS
@ -70,43 +59,8 @@
#include <stddef.h>
#ifndef GLEXT_64_TYPES_DEFINED
/* This code block is duplicated in glxext.h, so must be protected */
#define GLEXT_64_TYPES_DEFINED
/* Define int32_t, int64_t, and uint64_t types for UST/MSC */
/* (as used in the GL_EXT_timer_query extension). */
#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
#include <inttypes.h>
#elif defined(__sun__) || defined(__digital__)
#include <inttypes.h>
#if defined(__STDC__)
#if defined(__arch64__) || defined(_LP64)
typedef long int int64_t;
typedef unsigned long int uint64_t;
#else
typedef long long int int64_t;
typedef unsigned long long int uint64_t;
#endif /* __arch64__ */
#endif /* __STDC__ */
#elif defined( __VMS ) || defined(__sgi)
#include <inttypes.h>
#elif defined(__SCO__) || defined(__USLC__)
#include <stdint.h>
#elif defined(__UNIXOS2__) || defined(__SOL64__)
typedef long int int32_t;
typedef long long int int64_t;
typedef unsigned long long int uint64_t;
#elif defined(_WIN32) && defined(__GNUC__)
#include <stdint.h>
#elif defined(_WIN32)
typedef __int32 int32_t;
typedef __int64 int64_t;
typedef unsigned __int64 uint64_t;
#else
/* Fallback if nothing above works */
#include <inttypes.h>
#endif
#endif
typedef unsigned int GLenum;
typedef unsigned char GLboolean;
typedef unsigned int GLbitfield;