From f0a66adc8862622ef65830dc7f3c154c211e22e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krzysztof=20Kosi=C5=84ski?= Date: Wed, 24 Apr 2019 17:44:46 -0700 Subject: [PATCH] Add KHRONOS_STATIC to allow static linking on Windows. I have encountered multiple situations where it is desirable to statically link against a software implementation of EGL on Windows. Add the preprocessor constant KHRONOS_STATIC that disables the annotation of EGL entry points as DLL-imported. This is squashed from commits 94ba8ee876206364cf45a9bc08b8db5a52cb9543 and f636b23410dd4db5055dffbe499f4754013759d5 from https://github.com/KhronosGroup/EGL-Registry, applied on the qtbase repo. --- src/3rdparty/angle/include/KHR/khrplatform.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/3rdparty/angle/include/KHR/khrplatform.h b/src/3rdparty/angle/include/KHR/khrplatform.h index 975bbff..dd22d92 100644 --- a/src/3rdparty/angle/include/KHR/khrplatform.h +++ b/src/3rdparty/angle/include/KHR/khrplatform.h @@ -90,12 +90,20 @@ * int arg2) KHRONOS_APIATTRIBUTES; */ +#if defined(__SCITECH_SNAP__) && !defined(KHRONOS_STATIC) +# define KHRONOS_STATIC 1 +#endif + /*------------------------------------------------------------------------- * Definition of KHRONOS_APICALL *------------------------------------------------------------------------- * This precedes the return type of the function in the function prototype. */ -#if defined(_WIN32) && !defined(__SCITECH_SNAP__) +#if defined(KHRONOS_STATIC) + /* If the preprocessor constant KHRONOS_STATIC is defined, make the + * header compatible with static linking. */ +# define KHRONOS_APICALL +#elif defined(_WIN32) # define KHRONOS_APICALL __declspec(dllimport) #elif defined (__SYMBIAN32__) # define KHRONOS_APICALL IMPORT_C -- 2.17.1