From ed421f4fd8d74a51882647920da6ba04ef518edc Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Wed, 24 Jan 2024 10:35:35 +0000 Subject: [PATCH] Revert Khronos headers to upstream version These are third-party headers, so it's best if they're identical to the upstream version rather than using SDL-specific macros or coding style. This partially reverts commits b6ae281e and 31d133db. Fixes: 31d133db "Define SDL_PLATFORM_* macros instead of underscored ones (#8875)" Signed-off-by: Simon McVittie --- src/video/khronos/EGL/eglplatform.h | 10 +++++----- src/video/khronos/KHR/khrplatform.h | 6 +++--- src/video/khronos/vulkan/vk_platform.h | 4 ++-- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/video/khronos/EGL/eglplatform.h b/src/video/khronos/EGL/eglplatform.h index 31015a0bd4..99362a23de 100644 --- a/src/video/khronos/EGL/eglplatform.h +++ b/src/video/khronos/EGL/eglplatform.h @@ -48,13 +48,13 @@ * implementations. */ -#ifdef EGL_NO_PLATFORM_SPECIFIC_TYPES +#if defined(EGL_NO_PLATFORM_SPECIFIC_TYPES) typedef void *EGLNativeDisplayType; typedef void *EGLNativePixmapType; typedef void *EGLNativeWindowType; -#elif defined(_WIN32) || defined(__VC32__) && !defined(SDL_PLATFORM_CYGWIN) && !defined(__SCITECH_SNAP__) /* Win32 and WinCE */ +#elif defined(_WIN32) || defined(__VC32__) && !defined(__CYGWIN__) && !defined(__SCITECH_SNAP__) /* Win32 and WinCE */ #ifndef WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN 1 #endif @@ -88,7 +88,7 @@ typedef struct gbm_device *EGLNativeDisplayType; typedef struct gbm_bo *EGLNativePixmapType; typedef void *EGLNativeWindowType; -#elif defined(SDL_PLATFORM_ANDROID) || defined(ANDROID) +#elif defined(__ANDROID__) || defined(ANDROID) struct ANativeWindow; struct egl_native_pixmap_t; @@ -125,7 +125,7 @@ typedef int EGLNativeDisplayType; typedef void *EGLNativePixmapType; typedef void *EGLNativeWindowType; -#elif defined(SDL_PLATFORM_HAIKU) +#elif defined(__HAIKU__) #include @@ -160,7 +160,7 @@ typedef khronos_int32_t EGLint; /* C++ / C typecast macros for special EGL handle values */ -#ifdef __cplusplus +#if defined(__cplusplus) #define EGL_CAST(type, value) (static_cast(value)) #else #define EGL_CAST(type, value) ((type) (value)) diff --git a/src/video/khronos/KHR/khrplatform.h b/src/video/khronos/KHR/khrplatform.h index 810ffac4e8..01646449ca 100644 --- a/src/video/khronos/KHR/khrplatform.h +++ b/src/video/khronos/KHR/khrplatform.h @@ -99,7 +99,7 @@ *------------------------------------------------------------------------- * This precedes the return type of the function in the function prototype. */ -#ifdef KHRONOS_STATIC +#if defined(KHRONOS_STATIC) /* If the preprocessor constant KHRONOS_STATIC is defined, make the * header compatible with static linking. */ # define KHRONOS_APICALL @@ -107,7 +107,7 @@ # define KHRONOS_APICALL __declspec(dllimport) #elif defined (__SYMBIAN32__) # define KHRONOS_APICALL IMPORT_C -#elif defined(SDL_PLATFORM_ANDROID) +#elif defined(__ANDROID__) # define KHRONOS_APICALL __attribute__((visibility("default"))) #else # define KHRONOS_APICALL @@ -260,7 +260,7 @@ typedef signed long int khronos_intptr_t; typedef unsigned long int khronos_uintptr_t; #endif -#ifdef _WIN64 +#if defined(_WIN64) typedef signed long long int khronos_ssize_t; typedef unsigned long long int khronos_usize_t; #else diff --git a/src/video/khronos/vulkan/vk_platform.h b/src/video/khronos/vulkan/vk_platform.h index 94c976e4bf..3ff8c5d146 100644 --- a/src/video/khronos/vulkan/vk_platform.h +++ b/src/video/khronos/vulkan/vk_platform.h @@ -41,9 +41,9 @@ extern "C" #define VKAPI_ATTR #define VKAPI_CALL __stdcall #define VKAPI_PTR VKAPI_CALL -#elif defined(SDL_PLATFORM_ANDROID) && defined(__ARM_ARCH) && __ARM_ARCH < 7 +#elif defined(__ANDROID__) && defined(__ARM_ARCH) && __ARM_ARCH < 7 #error "Vulkan is not supported for the 'armeabi' NDK ABI" -#elif defined(SDL_PLATFORM_ANDROID) && defined(__ARM_ARCH) && __ARM_ARCH >= 7 && defined(__ARM_32BIT_STATE) +#elif defined(__ANDROID__) && defined(__ARM_ARCH) && __ARM_ARCH >= 7 && defined(__ARM_32BIT_STATE) // On Android 32-bit ARM targets, Vulkan functions use the "hardfloat" // calling convention, i.e. float parameters are passed in registers. This // is true even if the rest of the application passes floats on the stack,