Commit ca5c3048145e250bc4d8255798d0f01e6460024d

Sam Lantinga 2017-08-13T21:06:52

Fixed bug 3744 - missing SDLCALL in several functions Ozkan Sezer The attached patch adds missing SDLCALL to several functions, so that they properly match the headers as intended.

diff --git a/src/SDL_assert.c b/src/SDL_assert.c
index c64d626..47309eb 100644
--- a/src/SDL_assert.c
+++ b/src/SDL_assert.c
@@ -49,7 +49,7 @@
 #endif
 
 
-static SDL_assert_state
+static SDL_assert_state SDLCALL
 SDL_PromptAssertion(const SDL_assert_data *data, void *userdata);
 
 /*
@@ -141,7 +141,7 @@ static SDL_NORETURN void SDL_AbortAssertion(void)
 }
 
 
-static SDL_assert_state
+static SDL_assert_state SDLCALL
 SDL_PromptAssertion(const SDL_assert_data *data, void *userdata)
 {
 #ifdef __WIN32__
diff --git a/src/events/SDL_windowevents.c b/src/events/SDL_windowevents.c
index 12d4b83..b12dfbf 100644
--- a/src/events/SDL_windowevents.c
+++ b/src/events/SDL_windowevents.c
@@ -28,7 +28,7 @@
 #include "../video/SDL_sysvideo.h"
 
 
-static int
+static int SDLCALL
 RemovePendingResizedEvents(void * userdata, SDL_Event *event)
 {
     SDL_Event *new_event = (SDL_Event *)userdata;
@@ -42,7 +42,7 @@ RemovePendingResizedEvents(void * userdata, SDL_Event *event)
     return 1;
 }
 
-static int
+static int SDLCALL
 RemovePendingSizeChangedEvents(void * userdata, SDL_Event *event)
 {
     SDL_Event *new_event = (SDL_Event *)userdata;
@@ -56,7 +56,7 @@ RemovePendingSizeChangedEvents(void * userdata, SDL_Event *event)
     return 1;
 }
 
-static int
+static int SDLCALL
 RemovePendingMoveEvents(void * userdata, SDL_Event *event)
 {
     SDL_Event *new_event = (SDL_Event *)userdata;
@@ -70,7 +70,7 @@ RemovePendingMoveEvents(void * userdata, SDL_Event *event)
     return 1;
 }
 
-static int
+static int SDLCALL
 RemovePendingExposedEvents(void * userdata, SDL_Event *event)
 {
     SDL_Event *new_event = (SDL_Event *)userdata;
diff --git a/src/joystick/SDL_gamecontroller.c b/src/joystick/SDL_gamecontroller.c
index ba0ab83..1227fa7 100644
--- a/src/joystick/SDL_gamecontroller.c
+++ b/src/joystick/SDL_gamecontroller.c
@@ -333,7 +333,7 @@ static void HandleJoystickHat(SDL_GameController *gamecontroller, int hat, Uint8
 /*
  * Event filter to fire controller events from joystick ones
  */
-static int SDL_GameControllerEventWatcher(void *userdata, SDL_Event * event)
+static int SDLCALL SDL_GameControllerEventWatcher(void *userdata, SDL_Event * event)
 {
     switch(event->type) {
     case SDL_JOYAXISMOTION:
diff --git a/src/render/SDL_render.c b/src/render/SDL_render.c
index ea8cfdf..81feaf6 100644
--- a/src/render/SDL_render.c
+++ b/src/render/SDL_render.c
@@ -102,7 +102,7 @@ SDL_GetRenderDriverInfo(int index, SDL_RendererInfo * info)
 #endif
 }
 
-static int
+static int SDLCALL
 SDL_RendererEventWatch(void *userdata, SDL_Event *event)
 {
     SDL_Renderer *renderer = (SDL_Renderer *)userdata;
diff --git a/src/timer/SDL_timer.c b/src/timer/SDL_timer.c
index 3dcf7cb..2ed9ae1 100644
--- a/src/timer/SDL_timer.c
+++ b/src/timer/SDL_timer.c
@@ -97,7 +97,7 @@ SDL_AddTimerInternal(SDL_TimerData *data, SDL_Timer *timer)
     timer->next = curr;
 }
 
-static int
+static int SDLCALL
 SDL_TimerThread(void *_data)
 {
     SDL_TimerData *data = (SDL_TimerData *)_data;
diff --git a/test/testatomic.c b/test/testatomic.c
index 52646d6..bbb0270 100644
--- a/test/testatomic.c
+++ b/test/testatomic.c
@@ -117,7 +117,7 @@ static SDL_atomic_t threadsRunning;
 static SDL_sem *threadDone;
 
 static
-int adder(void* junk)
+int SDLCALL adder(void* junk)
 {
     unsigned long N=NInter;
     SDL_Log("Thread subtracting %d %lu times\n",CountInc,N);
@@ -495,7 +495,7 @@ typedef struct
     char padding[SDL_CACHELINE_SIZE-(sizeof(SDL_EventQueue*)+sizeof(int)*NUM_WRITERS+sizeof(int)+sizeof(SDL_bool))%SDL_CACHELINE_SIZE];
 } ReaderData;
 
-static int FIFO_Writer(void* _data)
+static int SDLCALL FIFO_Writer(void* _data)
 {
     WriterData *data = (WriterData *)_data;
     SDL_EventQueue *queue = data->queue;
@@ -530,7 +530,7 @@ static int FIFO_Writer(void* _data)
     return 0;
 }
 
-static int FIFO_Reader(void* _data)
+static int SDLCALL FIFO_Reader(void* _data)
 {
     ReaderData *data = (ReaderData *)_data;
     SDL_EventQueue *queue = data->queue;
@@ -570,7 +570,7 @@ static int FIFO_Reader(void* _data)
 
 #ifdef TEST_SPINLOCK_FIFO
 /* This thread periodically locks the queue for no particular reason */
-static int FIFO_Watcher(void* _data)
+static int SDLCALL FIFO_Watcher(void* _data)
 {
     SDL_EventQueue *queue = (SDL_EventQueue *)_data;
 
diff --git a/test/testautomation_audio.c b/test/testautomation_audio.c
index bef838d..be0f15e 100644
--- a/test/testautomation_audio.c
+++ b/test/testautomation_audio.c
@@ -46,7 +46,7 @@ int _audio_testCallbackLength;
 
 
 /* Test callback function */
-void _audio_testCallback(void *userdata, Uint8 *stream, int len)
+void SDLCALL _audio_testCallback(void *userdata, Uint8 *stream, int len)
 {
    /* track that callback was called */
    _audio_testCallbackCounter++;
diff --git a/test/testautomation_events.c b/test/testautomation_events.c
index a0119bd..09004da 100644
--- a/test/testautomation_events.c
+++ b/test/testautomation_events.c
@@ -25,7 +25,7 @@ int _userdataValue1 = 1;
 int _userdataValue2 = 2;
 
 /* Event filter that sets some flags and optionally checks userdata */
-int _events_sampleNullEventFilter(void *userdata, SDL_Event *event)
+int SDLCALL _events_sampleNullEventFilter(void *userdata, SDL_Event *event)
 {
    _eventFilterCalled = 1;
 
diff --git a/test/testautomation_timer.c b/test/testautomation_timer.c
index 6d73856..a42eb37 100644
--- a/test/testautomation_timer.c
+++ b/test/testautomation_timer.c
@@ -104,7 +104,7 @@ timer_delayAndGetTicks(void *arg)
 }
 
 /* Test callback */
-Uint32 _timerTestCallback(Uint32 interval, void *param)
+Uint32 SDLCALL _timerTestCallback(Uint32 interval, void *param)
 {
    _timerCallbackCalled = 1;
 
diff --git a/test/testhittesting.c b/test/testhittesting.c
index 5e32be4..c5223a9 100644
--- a/test/testhittesting.c
+++ b/test/testhittesting.c
@@ -14,7 +14,7 @@ const SDL_Rect drag_areas[] = {
 static const SDL_Rect *areas = drag_areas;
 static int numareas = SDL_arraysize(drag_areas);
 
-static SDL_HitTestResult
+static SDL_HitTestResult SDLCALL
 hitTest(SDL_Window *window, const SDL_Point *pt, void *data)
 {
     int i;
diff --git a/test/testmessage.c b/test/testmessage.c
index 0a4b93f..27407ba 100644
--- a/test/testmessage.c
+++ b/test/testmessage.c
@@ -25,7 +25,7 @@ quit(int rc)
     exit(rc);
 }
 
-static int
+static int SDLCALL
 button_messagebox(void *eventNumber)
 {
     const SDL_MessageBoxButtonData buttons[] = {