github.com/Konstantin8105/c4go@v0.0.0-20240505174241-768bb1c65a51/tests/raylib/external/glfw/src/platform.h (about)

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