shithub: npe

Download patch

ref: de724d7023c52e335c82bd6f102bf24343c53240
parent: 6a93414a2883e0ad4611f249810bd6b46f0a9f7c
author: Sigrid Solveig Haflínudóttir <ftrvxmtrx@gmail.com>
date: Fri Mar 19 06:02:32 EDT 2021

sdl2: move threads logic to a separate header

--- a/include/npe/SDL2/SDL.h
+++ b/include/npe/SDL2/SDL.h
@@ -18,6 +18,7 @@
 #include <SDL2/SDL_scancode.h>
 #include <SDL2/SDL_audio.h>
 #include <SDL2/SDL_events.h>
+#include <SDL2/SDL_thread.h>
 
 typedef struct SDL_Window SDL_Window;
 typedef struct SDL_Renderer SDL_Renderer;
@@ -25,8 +26,6 @@
 typedef struct SDL_Surface SDL_Surface;
 typedef struct SDL_Rect SDL_Rect;
 typedef int SDL_BlendMode;
-typedef struct SDL_Thread SDL_Thread;
-typedef int (*SDL_ThreadFunction)(void *);
 typedef struct SDL_Cursor SDL_Cursor;
 typedef struct SDL_PixelFormat SDL_PixelFormat;
 typedef struct SDL_Point SDL_Point;
@@ -39,7 +38,6 @@
 #pragma incomplete SDL_PixelFormat
 #pragma incomplete SDL_Renderer
 #pragma incomplete SDL_Texture
-#pragma incomplete SDL_Thread
 #pragma incomplete SDL_Window
 
 #define SDLCALL
@@ -53,11 +51,8 @@
 u64int SDL_GetPerformanceFrequency(void);
 u64int SDL_GetPerformanceCounter(void);
 char *SDL_GetError(void);
-SDL_Thread *SDL_CreateThread(SDL_ThreadFunction, char *, void *);
-void SDL_DetachThread(SDL_Thread *);
 char *SDL_GetClipboardText(void);
 int SDL_SetClipboardText(char *);
-void SDL_SetThreadPriority(int);
 SDL_bool SDL_HasClipboardText(void);
 void SDL_RestoreWindow(SDL_Window *window);
 void SDL_RaiseWindow(SDL_Window *window);
@@ -123,7 +118,6 @@
 char *SDL_GetPrefPath(char *org, char *app);
 int SDL_SetRenderDrawColor(SDL_Renderer *r, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
 int SDL_GetCurrentDisplayMode(int displayIndex, SDL_DisplayMode *mode);
-void SDL_WaitThread(SDL_Thread *thread, int *status);
 void SDL_ShowWindow(SDL_Window *w);
 int SDL_RenderSetIntegerScale(SDL_Renderer *r, SDL_bool enable);
 
--- /dev/null
+++ b/include/npe/SDL2/SDL_thread.h
@@ -1,0 +1,13 @@
+#ifndef _npe_SDL_thread_h_
+#define _npe_SDL_thread_h_
+
+typedef struct SDL_Thread SDL_Thread;
+typedef int (*SDL_ThreadFunction)(void *);
+#pragma incomplete SDL_Thread
+
+SDL_Thread *SDL_CreateThread(SDL_ThreadFunction, char *, void *);
+void SDL_DetachThread(SDL_Thread *);
+void SDL_SetThreadPriority(int);
+void SDL_WaitThread(SDL_Thread *thread, int *status);
+
+#endif