1b877906bSopenharmony_ci//========================================================================
2b877906bSopenharmony_ci// GLFW 3.5 - www.glfw.org
3b877906bSopenharmony_ci//------------------------------------------------------------------------
4b877906bSopenharmony_ci// Copyright (c) 2002-2006 Marcus Geelnard
5b877906bSopenharmony_ci// Copyright (c) 2006-2018 Camilla Löwy <elmindreda@glfw.org>
6b877906bSopenharmony_ci//
7b877906bSopenharmony_ci// This software is provided 'as-is', without any express or implied
8b877906bSopenharmony_ci// warranty. In no event will the authors be held liable for any damages
9b877906bSopenharmony_ci// arising from the use of this software.
10b877906bSopenharmony_ci//
11b877906bSopenharmony_ci// Permission is granted to anyone to use this software for any purpose,
12b877906bSopenharmony_ci// including commercial applications, and to alter it and redistribute it
13b877906bSopenharmony_ci// freely, subject to the following restrictions:
14b877906bSopenharmony_ci//
15b877906bSopenharmony_ci// 1. The origin of this software must not be misrepresented; you must not
16b877906bSopenharmony_ci//    claim that you wrote the original software. If you use this software
17b877906bSopenharmony_ci//    in a product, an acknowledgment in the product documentation would
18b877906bSopenharmony_ci//    be appreciated but is not required.
19b877906bSopenharmony_ci//
20b877906bSopenharmony_ci// 2. Altered source versions must be plainly marked as such, and must not
21b877906bSopenharmony_ci//    be misrepresented as being the original software.
22b877906bSopenharmony_ci//
23b877906bSopenharmony_ci// 3. This notice may not be removed or altered from any source
24b877906bSopenharmony_ci//    distribution.
25b877906bSopenharmony_ci//
26b877906bSopenharmony_ci//========================================================================
27b877906bSopenharmony_ci
28b877906bSopenharmony_ci#if defined(GLFW_BUILD_WIN32_TIMER) || \
29b877906bSopenharmony_ci    defined(GLFW_BUILD_WIN32_MODULE) || \
30b877906bSopenharmony_ci    defined(GLFW_BUILD_WIN32_THREAD) || \
31b877906bSopenharmony_ci    defined(GLFW_BUILD_COCOA_TIMER) || \
32b877906bSopenharmony_ci    defined(GLFW_BUILD_POSIX_TIMER) || \
33b877906bSopenharmony_ci    defined(GLFW_BUILD_POSIX_MODULE) || \
34b877906bSopenharmony_ci    defined(GLFW_BUILD_POSIX_THREAD) || \
35b877906bSopenharmony_ci    defined(GLFW_BUILD_POSIX_POLL) || \
36b877906bSopenharmony_ci    defined(GLFW_BUILD_LINUX_JOYSTICK)
37b877906bSopenharmony_ci #error "You must not define these; define zero or more _GLFW_<platform> macros instead"
38b877906bSopenharmony_ci#endif
39b877906bSopenharmony_ci
40b877906bSopenharmony_ci#include "null_platform.h"
41b877906bSopenharmony_ci#define GLFW_EXPOSE_NATIVE_EGL
42b877906bSopenharmony_ci#define GLFW_EXPOSE_NATIVE_OSMESA
43b877906bSopenharmony_ci
44b877906bSopenharmony_ci#if defined(_GLFW_WIN32)
45b877906bSopenharmony_ci #include "win32_platform.h"
46b877906bSopenharmony_ci #define GLFW_EXPOSE_NATIVE_WIN32
47b877906bSopenharmony_ci #define GLFW_EXPOSE_NATIVE_WGL
48b877906bSopenharmony_ci#else
49b877906bSopenharmony_ci #define GLFW_WIN32_WINDOW_STATE
50b877906bSopenharmony_ci #define GLFW_WIN32_MONITOR_STATE
51b877906bSopenharmony_ci #define GLFW_WIN32_CURSOR_STATE
52b877906bSopenharmony_ci #define GLFW_WIN32_LIBRARY_WINDOW_STATE
53b877906bSopenharmony_ci #define GLFW_WGL_CONTEXT_STATE
54b877906bSopenharmony_ci #define GLFW_WGL_LIBRARY_CONTEXT_STATE
55b877906bSopenharmony_ci#endif
56b877906bSopenharmony_ci
57b877906bSopenharmony_ci#if defined(_GLFW_COCOA)
58b877906bSopenharmony_ci #include "cocoa_platform.h"
59b877906bSopenharmony_ci #define GLFW_EXPOSE_NATIVE_COCOA
60b877906bSopenharmony_ci #define GLFW_EXPOSE_NATIVE_NSGL
61b877906bSopenharmony_ci#else
62b877906bSopenharmony_ci #define GLFW_COCOA_WINDOW_STATE
63b877906bSopenharmony_ci #define GLFW_COCOA_MONITOR_STATE
64b877906bSopenharmony_ci #define GLFW_COCOA_CURSOR_STATE
65b877906bSopenharmony_ci #define GLFW_COCOA_LIBRARY_WINDOW_STATE
66b877906bSopenharmony_ci #define GLFW_NSGL_CONTEXT_STATE
67b877906bSopenharmony_ci #define GLFW_NSGL_LIBRARY_CONTEXT_STATE
68b877906bSopenharmony_ci#endif
69b877906bSopenharmony_ci
70b877906bSopenharmony_ci#if defined(_GLFW_WAYLAND)
71b877906bSopenharmony_ci #include "wl_platform.h"
72b877906bSopenharmony_ci #define GLFW_EXPOSE_NATIVE_WAYLAND
73b877906bSopenharmony_ci#else
74b877906bSopenharmony_ci #define GLFW_WAYLAND_WINDOW_STATE
75b877906bSopenharmony_ci #define GLFW_WAYLAND_MONITOR_STATE
76b877906bSopenharmony_ci #define GLFW_WAYLAND_CURSOR_STATE
77b877906bSopenharmony_ci #define GLFW_WAYLAND_LIBRARY_WINDOW_STATE
78b877906bSopenharmony_ci#endif
79b877906bSopenharmony_ci
80b877906bSopenharmony_ci#if defined(_GLFW_X11)
81b877906bSopenharmony_ci #include "x11_platform.h"
82b877906bSopenharmony_ci #define GLFW_EXPOSE_NATIVE_X11
83b877906bSopenharmony_ci #define GLFW_EXPOSE_NATIVE_GLX
84b877906bSopenharmony_ci#else
85b877906bSopenharmony_ci #define GLFW_X11_WINDOW_STATE
86b877906bSopenharmony_ci #define GLFW_X11_MONITOR_STATE
87b877906bSopenharmony_ci #define GLFW_X11_CURSOR_STATE
88b877906bSopenharmony_ci #define GLFW_X11_LIBRARY_WINDOW_STATE
89b877906bSopenharmony_ci #define GLFW_GLX_CONTEXT_STATE
90b877906bSopenharmony_ci #define GLFW_GLX_LIBRARY_CONTEXT_STATE
91b877906bSopenharmony_ci#endif
92b877906bSopenharmony_ci
93b877906bSopenharmony_ci#include "null_joystick.h"
94b877906bSopenharmony_ci
95b877906bSopenharmony_ci#if defined(_GLFW_WIN32)
96b877906bSopenharmony_ci #include "win32_joystick.h"
97b877906bSopenharmony_ci#else
98b877906bSopenharmony_ci #define GLFW_WIN32_JOYSTICK_STATE
99b877906bSopenharmony_ci #define GLFW_WIN32_LIBRARY_JOYSTICK_STATE
100b877906bSopenharmony_ci#endif
101b877906bSopenharmony_ci
102b877906bSopenharmony_ci#if defined(_GLFW_COCOA)
103b877906bSopenharmony_ci #include "cocoa_joystick.h"
104b877906bSopenharmony_ci#else
105b877906bSopenharmony_ci #define GLFW_COCOA_JOYSTICK_STATE
106b877906bSopenharmony_ci #define GLFW_COCOA_LIBRARY_JOYSTICK_STATE
107b877906bSopenharmony_ci#endif
108b877906bSopenharmony_ci
109b877906bSopenharmony_ci#if (defined(_GLFW_X11) || defined(_GLFW_WAYLAND)) && defined(__linux__)
110b877906bSopenharmony_ci #define GLFW_BUILD_LINUX_JOYSTICK
111b877906bSopenharmony_ci#endif
112b877906bSopenharmony_ci
113b877906bSopenharmony_ci#if defined(GLFW_BUILD_LINUX_JOYSTICK)
114b877906bSopenharmony_ci #include "linux_joystick.h"
115b877906bSopenharmony_ci#else
116b877906bSopenharmony_ci #define GLFW_LINUX_JOYSTICK_STATE
117b877906bSopenharmony_ci #define GLFW_LINUX_LIBRARY_JOYSTICK_STATE
118b877906bSopenharmony_ci#endif
119b877906bSopenharmony_ci
120b877906bSopenharmony_ci#define GLFW_PLATFORM_WINDOW_STATE \
121b877906bSopenharmony_ci        GLFW_WIN32_WINDOW_STATE \
122b877906bSopenharmony_ci        GLFW_COCOA_WINDOW_STATE \
123b877906bSopenharmony_ci        GLFW_WAYLAND_WINDOW_STATE \
124b877906bSopenharmony_ci        GLFW_X11_WINDOW_STATE \
125b877906bSopenharmony_ci        GLFW_NULL_WINDOW_STATE \
126b877906bSopenharmony_ci
127b877906bSopenharmony_ci#define GLFW_PLATFORM_MONITOR_STATE \
128b877906bSopenharmony_ci        GLFW_WIN32_MONITOR_STATE \
129b877906bSopenharmony_ci        GLFW_COCOA_MONITOR_STATE \
130b877906bSopenharmony_ci        GLFW_WAYLAND_MONITOR_STATE \
131b877906bSopenharmony_ci        GLFW_X11_MONITOR_STATE \
132b877906bSopenharmony_ci        GLFW_NULL_MONITOR_STATE \
133b877906bSopenharmony_ci
134b877906bSopenharmony_ci#define GLFW_PLATFORM_CURSOR_STATE \
135b877906bSopenharmony_ci        GLFW_WIN32_CURSOR_STATE \
136b877906bSopenharmony_ci        GLFW_COCOA_CURSOR_STATE \
137b877906bSopenharmony_ci        GLFW_WAYLAND_CURSOR_STATE \
138b877906bSopenharmony_ci        GLFW_X11_CURSOR_STATE \
139b877906bSopenharmony_ci        GLFW_NULL_CURSOR_STATE \
140b877906bSopenharmony_ci
141b877906bSopenharmony_ci#define GLFW_PLATFORM_JOYSTICK_STATE \
142b877906bSopenharmony_ci        GLFW_WIN32_JOYSTICK_STATE \
143b877906bSopenharmony_ci        GLFW_COCOA_JOYSTICK_STATE \
144b877906bSopenharmony_ci        GLFW_LINUX_JOYSTICK_STATE
145b877906bSopenharmony_ci
146b877906bSopenharmony_ci#define GLFW_PLATFORM_LIBRARY_WINDOW_STATE \
147b877906bSopenharmony_ci        GLFW_WIN32_LIBRARY_WINDOW_STATE \
148b877906bSopenharmony_ci        GLFW_COCOA_LIBRARY_WINDOW_STATE \
149b877906bSopenharmony_ci        GLFW_WAYLAND_LIBRARY_WINDOW_STATE \
150b877906bSopenharmony_ci        GLFW_X11_LIBRARY_WINDOW_STATE \
151b877906bSopenharmony_ci        GLFW_NULL_LIBRARY_WINDOW_STATE \
152b877906bSopenharmony_ci
153b877906bSopenharmony_ci#define GLFW_PLATFORM_LIBRARY_JOYSTICK_STATE \
154b877906bSopenharmony_ci        GLFW_WIN32_LIBRARY_JOYSTICK_STATE \
155b877906bSopenharmony_ci        GLFW_COCOA_LIBRARY_JOYSTICK_STATE \
156b877906bSopenharmony_ci        GLFW_LINUX_LIBRARY_JOYSTICK_STATE
157b877906bSopenharmony_ci
158b877906bSopenharmony_ci#define GLFW_PLATFORM_CONTEXT_STATE \
159b877906bSopenharmony_ci        GLFW_WGL_CONTEXT_STATE \
160b877906bSopenharmony_ci        GLFW_NSGL_CONTEXT_STATE \
161b877906bSopenharmony_ci        GLFW_GLX_CONTEXT_STATE
162b877906bSopenharmony_ci
163b877906bSopenharmony_ci#define GLFW_PLATFORM_LIBRARY_CONTEXT_STATE \
164b877906bSopenharmony_ci        GLFW_WGL_LIBRARY_CONTEXT_STATE \
165b877906bSopenharmony_ci        GLFW_NSGL_LIBRARY_CONTEXT_STATE \
166b877906bSopenharmony_ci        GLFW_GLX_LIBRARY_CONTEXT_STATE
167b877906bSopenharmony_ci
168b877906bSopenharmony_ci#if defined(_WIN32)
169b877906bSopenharmony_ci #define GLFW_BUILD_WIN32_THREAD
170b877906bSopenharmony_ci#else
171b877906bSopenharmony_ci #define GLFW_BUILD_POSIX_THREAD
172b877906bSopenharmony_ci#endif
173b877906bSopenharmony_ci
174b877906bSopenharmony_ci#if defined(GLFW_BUILD_WIN32_THREAD)
175b877906bSopenharmony_ci #include "win32_thread.h"
176b877906bSopenharmony_ci #define GLFW_PLATFORM_TLS_STATE    GLFW_WIN32_TLS_STATE
177b877906bSopenharmony_ci #define GLFW_PLATFORM_MUTEX_STATE  GLFW_WIN32_MUTEX_STATE
178b877906bSopenharmony_ci#elif defined(GLFW_BUILD_POSIX_THREAD)
179b877906bSopenharmony_ci #include "posix_thread.h"
180b877906bSopenharmony_ci #define GLFW_PLATFORM_TLS_STATE    GLFW_POSIX_TLS_STATE
181b877906bSopenharmony_ci #define GLFW_PLATFORM_MUTEX_STATE  GLFW_POSIX_MUTEX_STATE
182b877906bSopenharmony_ci#endif
183b877906bSopenharmony_ci
184b877906bSopenharmony_ci#if defined(_WIN32)
185b877906bSopenharmony_ci #define GLFW_BUILD_WIN32_TIMER
186b877906bSopenharmony_ci#elif defined(__APPLE__)
187b877906bSopenharmony_ci #define GLFW_BUILD_COCOA_TIMER
188b877906bSopenharmony_ci#else
189b877906bSopenharmony_ci #define GLFW_BUILD_POSIX_TIMER
190b877906bSopenharmony_ci#endif
191b877906bSopenharmony_ci
192b877906bSopenharmony_ci#if defined(GLFW_BUILD_WIN32_TIMER)
193b877906bSopenharmony_ci #include "win32_time.h"
194b877906bSopenharmony_ci #define GLFW_PLATFORM_LIBRARY_TIMER_STATE  GLFW_WIN32_LIBRARY_TIMER_STATE
195b877906bSopenharmony_ci#elif defined(GLFW_BUILD_COCOA_TIMER)
196b877906bSopenharmony_ci #include "cocoa_time.h"
197b877906bSopenharmony_ci #define GLFW_PLATFORM_LIBRARY_TIMER_STATE  GLFW_COCOA_LIBRARY_TIMER_STATE
198b877906bSopenharmony_ci#elif defined(GLFW_BUILD_POSIX_TIMER)
199b877906bSopenharmony_ci #include "posix_time.h"
200b877906bSopenharmony_ci #define GLFW_PLATFORM_LIBRARY_TIMER_STATE  GLFW_POSIX_LIBRARY_TIMER_STATE
201b877906bSopenharmony_ci#endif
202b877906bSopenharmony_ci
203b877906bSopenharmony_ci#if defined(_WIN32)
204b877906bSopenharmony_ci #define GLFW_BUILD_WIN32_MODULE
205b877906bSopenharmony_ci#else
206b877906bSopenharmony_ci #define GLFW_BUILD_POSIX_MODULE
207b877906bSopenharmony_ci#endif
208b877906bSopenharmony_ci
209b877906bSopenharmony_ci#if defined(_GLFW_WAYLAND) || defined(_GLFW_X11)
210b877906bSopenharmony_ci #define GLFW_BUILD_POSIX_POLL
211b877906bSopenharmony_ci#endif
212b877906bSopenharmony_ci
213