Simplify struct stitching for sync primitives

There will not currently be more than one set of threading or timer APIs
selected regardless of how many window systems are enabled, so there is
no need for this extra complexity.
This commit is contained in:
Camilla Löwy 2021-11-09 19:41:34 +01:00
parent 8f050b5655
commit 72642ea0d1

View File

@ -92,30 +92,6 @@
#define GLFW_LINUX_LIBRARY_JOYSTICK_STATE #define GLFW_LINUX_LIBRARY_JOYSTICK_STATE
#endif #endif
#if defined(_WIN32)
#include "win32_thread.h"
#define GLFW_POSIX_TLS_STATE
#define GLFW_POSIX_MUTEX_STATE
#else
#include "posix_thread.h"
#define GLFW_WIN32_TLS_STATE
#define GLFW_WIN32_MUTEX_STATE
#endif
#if defined(_WIN32)
#include "win32_time.h"
#define GLFW_POSIX_LIBRARY_TIMER_STATE
#define GLFW_COCOA_LIBRARY_TIMER_STATE
#elif defined(__APPLE__)
#include "cocoa_time.h"
#define GLFW_WIN32_LIBRARY_TIMER_STATE
#define GLFW_POSIX_LIBRARY_TIMER_STATE
#else
#include "posix_time.h"
#define GLFW_WIN32_LIBRARY_TIMER_STATE
#define GLFW_COCOA_LIBRARY_TIMER_STATE
#endif
#define GLFW_PLATFORM_WINDOW_STATE \ #define GLFW_PLATFORM_WINDOW_STATE \
GLFW_WIN32_WINDOW_STATE \ GLFW_WIN32_WINDOW_STATE \
GLFW_COCOA_WINDOW_STATE \ GLFW_COCOA_WINDOW_STATE \
@ -142,14 +118,6 @@
GLFW_COCOA_JOYSTICK_STATE \ GLFW_COCOA_JOYSTICK_STATE \
GLFW_LINUX_JOYSTICK_STATE GLFW_LINUX_JOYSTICK_STATE
#define GLFW_PLATFORM_TLS_STATE \
GLFW_WIN32_TLS_STATE \
GLFW_POSIX_TLS_STATE \
#define GLFW_PLATFORM_MUTEX_STATE \
GLFW_WIN32_MUTEX_STATE \
GLFW_POSIX_MUTEX_STATE \
#define GLFW_PLATFORM_LIBRARY_WINDOW_STATE \ #define GLFW_PLATFORM_LIBRARY_WINDOW_STATE \
GLFW_WIN32_LIBRARY_WINDOW_STATE \ GLFW_WIN32_LIBRARY_WINDOW_STATE \
GLFW_COCOA_LIBRARY_WINDOW_STATE \ GLFW_COCOA_LIBRARY_WINDOW_STATE \
@ -162,11 +130,6 @@
GLFW_COCOA_LIBRARY_JOYSTICK_STATE \ GLFW_COCOA_LIBRARY_JOYSTICK_STATE \
GLFW_LINUX_LIBRARY_JOYSTICK_STATE GLFW_LINUX_LIBRARY_JOYSTICK_STATE
#define GLFW_PLATFORM_LIBRARY_TIMER_STATE \
GLFW_WIN32_LIBRARY_TIMER_STATE \
GLFW_COCOA_LIBRARY_TIMER_STATE \
GLFW_POSIX_LIBRARY_TIMER_STATE \
#define GLFW_PLATFORM_CONTEXT_STATE \ #define GLFW_PLATFORM_CONTEXT_STATE \
GLFW_WGL_CONTEXT_STATE \ GLFW_WGL_CONTEXT_STATE \
GLFW_NSGL_CONTEXT_STATE \ GLFW_NSGL_CONTEXT_STATE \
@ -177,3 +140,24 @@
GLFW_NSGL_LIBRARY_CONTEXT_STATE \ GLFW_NSGL_LIBRARY_CONTEXT_STATE \
GLFW_GLX_LIBRARY_CONTEXT_STATE GLFW_GLX_LIBRARY_CONTEXT_STATE
#if defined(_WIN32)
#include "win32_thread.h"
#define GLFW_PLATFORM_TLS_STATE GLFW_WIN32_TLS_STATE
#define GLFW_PLATFORM_MUTEX_STATE GLFW_WIN32_MUTEX_STATE
#else
#include "posix_thread.h"
#define GLFW_PLATFORM_TLS_STATE GLFW_POSIX_TLS_STATE
#define GLFW_PLATFORM_MUTEX_STATE GLFW_POSIX_MUTEX_STATE
#endif
#if defined(_WIN32)
#include "win32_time.h"
#define GLFW_PLATFORM_LIBRARY_TIMER_STATE GLFW_WIN32_LIBRARY_TIMER_STATE
#elif defined(__APPLE__)
#include "cocoa_time.h"
#define GLFW_PLATFORM_LIBRARY_TIMER_STATE GLFW_COCOA_LIBRARY_TIMER_STATE
#else
#include "posix_time.h"
#define GLFW_PLATFORM_LIBRARY_TIMER_STATE GLFW_POSIX_LIBRARY_TIMER_STATE
#endif