From 22e22ba1964c6ff8effc0e71c5672d620f725ab5 Mon Sep 17 00:00:00 2001 From: Daniel Gibson Date: Thu, 15 Dec 2022 05:58:20 +0100 Subject: [PATCH] Add SDL_main.h includes to tests .. including cmake/test/*.c, whatever that does (this is needed now because SDL.h doesn't include SDL_main.h anymore) --- cmake/test/main_cli.c | 1 + cmake/test/main_gui.c | 1 + cmake/test/main_lib.c | 2 ++ test/checkkeys.c | 1 + test/checkkeysthreads.c | 1 + test/controllermap.c | 1 + test/loopwave.c | 1 + test/loopwavequeue.c | 1 + test/testatomic.c | 1 + test/testaudiocapture.c | 1 + test/testaudiohotplug.c | 1 + test/testaudioinfo.c | 1 + test/testautomation.c | 1 + test/testbounds.c | 1 + test/testcustomcursor.c | 1 + test/testdisplayinfo.c | 1 + test/testdraw2.c | 1 + test/testdrawchessboard.c | 1 + test/testdropfile.c | 1 + test/testerror.c | 1 + test/testfile.c | 1 + test/testfilesystem.c | 1 + test/testgamecontroller.c | 1 + test/testgeometry.c | 1 + test/testgl2.c | 1 + test/testgles.c | 1 + test/testgles2.c | 1 + test/testgles2_sdf.c | 1 + test/testhaptic.c | 1 + test/testhittesting.c | 1 + test/testhotplug.c | 1 + test/testiconv.c | 1 + test/testime.c | 1 + test/testintersections.c | 1 + test/testjoystick.c | 1 + test/testkeys.c | 1 + test/testloadso.c | 1 + test/testlocale.c | 1 + test/testlock.c | 1 + test/testmessage.c | 1 + test/testmouse.c | 1 + test/testmultiaudio.c | 1 + test/testnative.c | 2 ++ test/testoffscreen.c | 1 + test/testoverlay2.c | 1 + test/testplatform.c | 1 + test/testpower.c | 1 + test/testqsort.c | 1 + test/testrelative.c | 1 + test/testrendercopyex.c | 1 + test/testrendertarget.c | 1 + test/testresample.c | 1 + test/testrumble.c | 1 + test/testscale.c | 1 + test/testsem.c | 1 + test/testsensor.c | 1 + test/testshader.c | 1 + test/testshape.c | 1 + test/testsprite2.c | 1 + test/testspriteminimal.c | 1 + test/teststreaming.c | 1 + test/testsurround.c | 1 + test/testthread.c | 1 + test/testtimer.c | 1 + test/testurl.c | 1 + test/testver.c | 1 + test/testviewport.c | 1 + test/testvulkan.c | 1 + test/testwm2.c | 1 + test/testyuv.c | 1 + test/torturethread.c | 1 + 71 files changed, 73 insertions(+) diff --git a/cmake/test/main_cli.c b/cmake/test/main_cli.c index 658b9d54b..0449709c0 100644 --- a/cmake/test/main_cli.c +++ b/cmake/test/main_cli.c @@ -1,5 +1,6 @@ #define SDL_MAIN_HANDLED #include +#include #include int main(int argc, char *argv[]) { diff --git a/cmake/test/main_gui.c b/cmake/test/main_gui.c index 1f482b6bb..84d8d67f8 100644 --- a/cmake/test/main_gui.c +++ b/cmake/test/main_gui.c @@ -1,4 +1,5 @@ #include +#include #include int main(int argc, char *argv[]) { diff --git a/cmake/test/main_lib.c b/cmake/test/main_lib.c index 5e7763df7..78d7c60dd 100644 --- a/cmake/test/main_lib.c +++ b/cmake/test/main_lib.c @@ -1,4 +1,6 @@ #include +#define SDL_MAIN_HANDLED /* don't drag in header-only SDL_main implementation */ +#include #include #include EXPORT_HEADER diff --git a/test/checkkeys.c b/test/checkkeys.c index 6c739b1ed..6a3a6bad6 100644 --- a/test/checkkeys.c +++ b/test/checkkeys.c @@ -22,6 +22,7 @@ #endif #include +#include #include static SDL_Window *window; diff --git a/test/checkkeysthreads.c b/test/checkkeysthreads.c index b361c1487..153bd8258 100644 --- a/test/checkkeysthreads.c +++ b/test/checkkeysthreads.c @@ -23,6 +23,7 @@ #endif #include +#include int done; diff --git a/test/controllermap.c b/test/controllermap.c index b0aa86f88..a9fadf13c 100644 --- a/test/controllermap.c +++ b/test/controllermap.c @@ -17,6 +17,7 @@ #include #include +#include #include "testutils.h" /* Define this for verbose output while mapping controllers */ diff --git a/test/loopwave.c b/test/loopwave.c index 132ebbc7b..e2a2ada50 100644 --- a/test/loopwave.c +++ b/test/loopwave.c @@ -22,6 +22,7 @@ #endif #include +#include #include "testutils.h" static struct diff --git a/test/loopwavequeue.c b/test/loopwavequeue.c index 95c71d754..ff85c2944 100644 --- a/test/loopwavequeue.c +++ b/test/loopwavequeue.c @@ -19,6 +19,7 @@ #endif #include +#include #if HAVE_SIGNAL_H #include diff --git a/test/testatomic.c b/test/testatomic.c index a81b6117b..4b3eca50c 100644 --- a/test/testatomic.c +++ b/test/testatomic.c @@ -10,6 +10,7 @@ freely. */ #include +#include /* Absolutely basic tests just to see if we get the expected value diff --git a/test/testaudiocapture.c b/test/testaudiocapture.c index d0db38b13..b20d9180f 100644 --- a/test/testaudiocapture.c +++ b/test/testaudiocapture.c @@ -13,6 +13,7 @@ #include #include +#include #ifdef __EMSCRIPTEN__ #include diff --git a/test/testaudiohotplug.c b/test/testaudiohotplug.c index cb7020b30..5d145f8d4 100644 --- a/test/testaudiohotplug.c +++ b/test/testaudiohotplug.c @@ -23,6 +23,7 @@ #endif #include +#include #include "testutils.h" static SDL_AudioSpec spec; diff --git a/test/testaudioinfo.c b/test/testaudioinfo.c index 2bdf92893..f262e92dc 100644 --- a/test/testaudioinfo.c +++ b/test/testaudioinfo.c @@ -10,6 +10,7 @@ freely. */ #include +#include static void print_devices(int iscapture) diff --git a/test/testautomation.c b/test/testautomation.c index 1bb5627cc..4c69d6cc0 100644 --- a/test/testautomation.c +++ b/test/testautomation.c @@ -13,6 +13,7 @@ #include #include +#include #include #include "testautomation_suites.h" diff --git a/test/testbounds.c b/test/testbounds.c index a44dc079d..de1bd1b09 100644 --- a/test/testbounds.c +++ b/test/testbounds.c @@ -11,6 +11,7 @@ */ #include +#include int main(int argc, char **argv) { diff --git a/test/testcustomcursor.c b/test/testcustomcursor.c index 8592d097a..0aad0a325 100644 --- a/test/testcustomcursor.c +++ b/test/testcustomcursor.c @@ -16,6 +16,7 @@ #endif #include +#include /* Stolen from the mailing list */ /* Creates a new mouse cursor from an XPM */ diff --git a/test/testdisplayinfo.c b/test/testdisplayinfo.c index 6cfddecdb..cbbd21a38 100644 --- a/test/testdisplayinfo.c +++ b/test/testdisplayinfo.c @@ -15,6 +15,7 @@ #include #include +#include static void print_mode(const char *prefix, const SDL_DisplayMode *mode) diff --git a/test/testdraw2.c b/test/testdraw2.c index 2ff9e4f84..06b5c2e46 100644 --- a/test/testdraw2.c +++ b/test/testdraw2.c @@ -20,6 +20,7 @@ #endif #include +#include #define NUM_OBJECTS 100 diff --git a/test/testdrawchessboard.c b/test/testdrawchessboard.c index 9e8338198..6ff158ba0 100644 --- a/test/testdrawchessboard.c +++ b/test/testdrawchessboard.c @@ -19,6 +19,7 @@ #endif #include +#include SDL_Window *window; SDL_Renderer *renderer; diff --git a/test/testdropfile.c b/test/testdropfile.c index b1390d66b..9884d88a4 100644 --- a/test/testdropfile.c +++ b/test/testdropfile.c @@ -13,6 +13,7 @@ #include #include +#include static SDLTest_CommonState *state; diff --git a/test/testerror.c b/test/testerror.c index e0f137423..57834b65c 100644 --- a/test/testerror.c +++ b/test/testerror.c @@ -15,6 +15,7 @@ #include #include +#include static int alive = 0; diff --git a/test/testfile.c b/test/testfile.c index ffef041b5..406f00307 100644 --- a/test/testfile.c +++ b/test/testfile.c @@ -24,6 +24,7 @@ #endif #include +#include /* WARNING ! those 2 files will be destroyed by this test program */ diff --git a/test/testfilesystem.c b/test/testfilesystem.c index 9e099582b..425f60fc3 100644 --- a/test/testfilesystem.c +++ b/test/testfilesystem.c @@ -12,6 +12,7 @@ /* Simple test of filesystem functions. */ #include +#include int main(int argc, char *argv[]) { diff --git a/test/testgamecontroller.c b/test/testgamecontroller.c index 421da8e89..68352fdea 100644 --- a/test/testgamecontroller.c +++ b/test/testgamecontroller.c @@ -13,6 +13,7 @@ /* Simple program to test the SDL game controller routines */ #include +#include #include "testutils.h" #ifdef __EMSCRIPTEN__ diff --git a/test/testgeometry.c b/test/testgeometry.c index afe71740f..1509888ee 100644 --- a/test/testgeometry.c +++ b/test/testgeometry.c @@ -20,6 +20,7 @@ #endif #include +#include #include "testutils.h" static SDLTest_CommonState *state; diff --git a/test/testgl2.c b/test/testgl2.c index 238a1fef9..b5abb6491 100644 --- a/test/testgl2.c +++ b/test/testgl2.c @@ -10,6 +10,7 @@ freely. */ #include +#include #ifdef HAVE_OPENGL diff --git a/test/testgles.c b/test/testgles.c index cd96eac7d..f9b48caf5 100644 --- a/test/testgles.c +++ b/test/testgles.c @@ -12,6 +12,7 @@ #include #include +#include #if defined(__IOS__) || defined(__ANDROID__) #define HAVE_OPENGLES diff --git a/test/testgles2.c b/test/testgles2.c index 7e047b21d..ae49934c0 100644 --- a/test/testgles2.c +++ b/test/testgles2.c @@ -16,6 +16,7 @@ #endif #include +#include #if defined(__IOS__) || defined(__ANDROID__) || defined(__EMSCRIPTEN__) || defined(__WINDOWS__) || defined(__LINUX__) #define HAVE_OPENGLES2 diff --git a/test/testgles2_sdf.c b/test/testgles2_sdf.c index edae4ef7a..bd0f51df1 100644 --- a/test/testgles2_sdf.c +++ b/test/testgles2_sdf.c @@ -16,6 +16,7 @@ #endif #include +#include #include "testutils.h" #if defined(__IOS__) || defined(__ANDROID__) || defined(__EMSCRIPTEN__) || defined(__WINDOWS__) || defined(__LINUX__) diff --git a/test/testhaptic.c b/test/testhaptic.c index 942495331..3f02466bc 100644 --- a/test/testhaptic.c +++ b/test/testhaptic.c @@ -17,6 +17,7 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND #include #include +#include static SDL_Haptic *haptic; diff --git a/test/testhittesting.c b/test/testhittesting.c index a2646975a..6c783f51c 100644 --- a/test/testhittesting.c +++ b/test/testhittesting.c @@ -10,6 +10,7 @@ freely. */ #include +#include /* !!! FIXME: rewrite this to be wired in to test framework. */ diff --git a/test/testhotplug.c b/test/testhotplug.c index a26ae5da4..2b090b151 100644 --- a/test/testhotplug.c +++ b/test/testhotplug.c @@ -15,6 +15,7 @@ #include #include +#include int main(int argc, char *argv[]) { diff --git a/test/testiconv.c b/test/testiconv.c index 00a506c0d..f9903a11d 100644 --- a/test/testiconv.c +++ b/test/testiconv.c @@ -18,6 +18,7 @@ #include #include +#include #include "testutils.h" static size_t diff --git a/test/testime.c b/test/testime.c index e74225344..000f7e8ee 100644 --- a/test/testime.c +++ b/test/testime.c @@ -14,6 +14,7 @@ Download at http://unifoundry.com/unifont.html */ #include +#include #ifdef HAVE_SDL_TTF #include "SDL_ttf.h" #endif diff --git a/test/testintersections.c b/test/testintersections.c index 94966b2a3..d9eeef49f 100644 --- a/test/testintersections.c +++ b/test/testintersections.c @@ -20,6 +20,7 @@ #endif #include +#include #define SWAP(typ, a, b) \ do { \ diff --git a/test/testjoystick.c b/test/testjoystick.c index 8b2552ee1..0af97d616 100644 --- a/test/testjoystick.c +++ b/test/testjoystick.c @@ -15,6 +15,7 @@ #include #include +#include #ifdef __EMSCRIPTEN__ #include diff --git a/test/testkeys.c b/test/testkeys.c index 31221e96c..5319daa83 100644 --- a/test/testkeys.c +++ b/test/testkeys.c @@ -15,6 +15,7 @@ #include #include +#include int main(int argc, char *argv[]) { diff --git a/test/testloadso.c b/test/testloadso.c index a1e531939..8f91ddd33 100644 --- a/test/testloadso.c +++ b/test/testloadso.c @@ -16,6 +16,7 @@ #include #include +#include typedef int (*fntype)(const char *); diff --git a/test/testlocale.c b/test/testlocale.c index 714cc2981..7699ecac1 100644 --- a/test/testlocale.c +++ b/test/testlocale.c @@ -10,6 +10,7 @@ freely. */ #include +#include /* !!! FIXME: move this to the test framework */ diff --git a/test/testlock.c b/test/testlock.c index 09a2c9843..88d35a9a8 100644 --- a/test/testlock.c +++ b/test/testlock.c @@ -18,6 +18,7 @@ #include /* for atexit() */ #include +#include static SDL_mutex *mutex = NULL; static SDL_threadID mainthread; diff --git a/test/testmessage.c b/test/testmessage.c index 3d3489b94..c538b851e 100644 --- a/test/testmessage.c +++ b/test/testmessage.c @@ -15,6 +15,7 @@ #include #include +#include /* Call this instead of exit(), so we can clean up SDL: atexit() is evil. */ static void diff --git a/test/testmouse.c b/test/testmouse.c index 121972a86..51a03d98b 100644 --- a/test/testmouse.c +++ b/test/testmouse.c @@ -11,6 +11,7 @@ */ #include +#include #ifdef __EMSCRIPTEN__ #include diff --git a/test/testmultiaudio.c b/test/testmultiaudio.c index 3d0632826..cb1d0bb6e 100644 --- a/test/testmultiaudio.c +++ b/test/testmultiaudio.c @@ -10,6 +10,7 @@ freely. */ #include +#include #include /* for fflush() and stdout */ diff --git a/test/testnative.c b/test/testnative.c index acb316b05..7ba65f3dd 100644 --- a/test/testnative.c +++ b/test/testnative.c @@ -17,6 +17,8 @@ #include "testnative.h" #include "testutils.h" +#include + #define WINDOW_W 640 #define WINDOW_H 480 #define NUM_SPRITES 100 diff --git a/test/testoffscreen.c b/test/testoffscreen.c index fed770b0b..e7112e8c2 100644 --- a/test/testoffscreen.c +++ b/test/testoffscreen.c @@ -20,6 +20,7 @@ #endif #include +#include #include static SDL_Renderer *renderer = NULL; diff --git a/test/testoverlay2.c b/test/testoverlay2.c index 737fa10b8..5f623cbd1 100644 --- a/test/testoverlay2.c +++ b/test/testoverlay2.c @@ -24,6 +24,7 @@ #include #include +#include #include "testutils.h" #define MOOSEPIC_W 64 diff --git a/test/testplatform.c b/test/testplatform.c index 213e46295..db5ca095d 100644 --- a/test/testplatform.c +++ b/test/testplatform.c @@ -10,6 +10,7 @@ freely. */ #include +#include /* * Watcom C flags these as Warning 201: "Unreachable code" if you just diff --git a/test/testpower.c b/test/testpower.c index ed4c538ec..2277cbf47 100644 --- a/test/testpower.c +++ b/test/testpower.c @@ -12,6 +12,7 @@ /* Simple test of power subsystem. */ #include +#include static void report_power(void) diff --git a/test/testqsort.c b/test/testqsort.c index b2503c191..3d4ceda29 100644 --- a/test/testqsort.c +++ b/test/testqsort.c @@ -11,6 +11,7 @@ */ #include +#include static int SDLCALL num_compare(const void *_a, const void *_b) diff --git a/test/testrelative.c b/test/testrelative.c index 871ab3503..ad9a610b2 100644 --- a/test/testrelative.c +++ b/test/testrelative.c @@ -16,6 +16,7 @@ #include #include +#include #ifdef __EMSCRIPTEN__ #include diff --git a/test/testrendercopyex.c b/test/testrendercopyex.c index a6f2ec9f3..170b111aa 100644 --- a/test/testrendercopyex.c +++ b/test/testrendercopyex.c @@ -18,6 +18,7 @@ #endif #include +#include #include "testutils.h" static SDLTest_CommonState *state; diff --git a/test/testrendertarget.c b/test/testrendertarget.c index 1e0adca48..2071decc6 100644 --- a/test/testrendertarget.c +++ b/test/testrendertarget.c @@ -18,6 +18,7 @@ #endif #include +#include #include "testutils.h" static SDLTest_CommonState *state; diff --git a/test/testresample.c b/test/testresample.c index df2758d9a..80fa7a935 100644 --- a/test/testresample.c +++ b/test/testresample.c @@ -11,6 +11,7 @@ */ #include +#include int main(int argc, char **argv) { diff --git a/test/testrumble.c b/test/testrumble.c index 8a88c62ef..be7b718ea 100644 --- a/test/testrumble.c +++ b/test/testrumble.c @@ -26,6 +26,7 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * includes */ #include +#include static SDL_Haptic *haptic; diff --git a/test/testscale.c b/test/testscale.c index 8398bdcfa..9e3d49d84 100644 --- a/test/testscale.c +++ b/test/testscale.c @@ -18,6 +18,7 @@ #endif #include +#include #include "testutils.h" #define WINDOW_WIDTH 640 diff --git a/test/testsem.c b/test/testsem.c index 9b977ba1e..5d3411d4c 100644 --- a/test/testsem.c +++ b/test/testsem.c @@ -15,6 +15,7 @@ #include #include +#include #define NUM_THREADS 10 /* This value should be smaller than the maximum count of the */ diff --git a/test/testsensor.c b/test/testsensor.c index 308e6a1a0..203f21d83 100644 --- a/test/testsensor.c +++ b/test/testsensor.c @@ -13,6 +13,7 @@ /* Simple test of the SDL sensor code */ #include +#include static const char *GetSensorTypeString(SDL_SensorType type) { diff --git a/test/testshader.c b/test/testshader.c index a89fea928..da1668c48 100644 --- a/test/testshader.c +++ b/test/testshader.c @@ -12,6 +12,7 @@ /* This is a simple example of using GLSL shaders with SDL */ #include +#include #include diff --git a/test/testshape.c b/test/testshape.c index 3f004bb70..605f072d8 100644 --- a/test/testshape.c +++ b/test/testshape.c @@ -12,6 +12,7 @@ #include #include +#include #define SHAPED_WINDOW_X 150 #define SHAPED_WINDOW_Y 150 diff --git a/test/testsprite2.c b/test/testsprite2.c index a7414e742..4b59ce295 100644 --- a/test/testsprite2.c +++ b/test/testsprite2.c @@ -20,6 +20,7 @@ #include #include +#include #include "testutils.h" #define NUM_SPRITES 100 diff --git a/test/testspriteminimal.c b/test/testspriteminimal.c index a58fccb04..41a14880e 100644 --- a/test/testspriteminimal.c +++ b/test/testspriteminimal.c @@ -19,6 +19,7 @@ #endif #include +#include #include "testutils.h" #define WINDOW_WIDTH 640 diff --git a/test/teststreaming.c b/test/teststreaming.c index ab9edfcb7..7d7efe3c0 100644 --- a/test/teststreaming.c +++ b/test/teststreaming.c @@ -22,6 +22,7 @@ #endif #include +#include #include "testutils.h" #define MOOSEPIC_W 64 diff --git a/test/testsurround.c b/test/testsurround.c index a6a8d0307..dad9fb153 100644 --- a/test/testsurround.c +++ b/test/testsurround.c @@ -12,6 +12,7 @@ /* Program to test surround sound audio channels */ #include +#include static int total_channels; static int active_channel; diff --git a/test/testthread.c b/test/testthread.c index facbdb850..011bf3983 100644 --- a/test/testthread.c +++ b/test/testthread.c @@ -16,6 +16,7 @@ #include #include +#include static SDL_TLSID tls; static int alive = 0; diff --git a/test/testtimer.c b/test/testtimer.c index baa34e2d3..7f17c97af 100644 --- a/test/testtimer.c +++ b/test/testtimer.c @@ -14,6 +14,7 @@ platform */ #include +#include #define DEFAULT_RESOLUTION 1 diff --git a/test/testurl.c b/test/testurl.c index c51e63bfc..c9622567b 100644 --- a/test/testurl.c +++ b/test/testurl.c @@ -10,6 +10,7 @@ freely. */ #include +#include static void tryOpenURL(const char *url) { diff --git a/test/testver.c b/test/testver.c index cad5268ab..b2a432c4b 100644 --- a/test/testver.c +++ b/test/testver.c @@ -14,6 +14,7 @@ version of SDL */ #include +#include int main(int argc, char *argv[]) { diff --git a/test/testviewport.c b/test/testviewport.c index 6b9b29481..1e250022b 100644 --- a/test/testviewport.c +++ b/test/testviewport.c @@ -19,6 +19,7 @@ #include #include +#include #include "testutils.h" static SDLTest_CommonState *state; diff --git a/test/testvulkan.c b/test/testvulkan.c index 4a618d26d..d9cfc7e88 100644 --- a/test/testvulkan.c +++ b/test/testvulkan.c @@ -12,6 +12,7 @@ #include #include +#include #if defined(__ANDROID__) && defined(__ARM_EABI__) && !defined(__ARM_ARCH_7A__) diff --git a/test/testwm2.c b/test/testwm2.c index a7c30bf64..0472cd8f0 100644 --- a/test/testwm2.c +++ b/test/testwm2.c @@ -18,6 +18,7 @@ #include #include +#include static SDLTest_CommonState *state; int done; diff --git a/test/testyuv.c b/test/testyuv.c index 063f25162..76228fac6 100644 --- a/test/testyuv.c +++ b/test/testyuv.c @@ -10,6 +10,7 @@ freely. */ #include +#include #include #include "testyuv_cvt.h" diff --git a/test/torturethread.c b/test/torturethread.c index fb59993f0..0ede9e7d2 100644 --- a/test/torturethread.c +++ b/test/torturethread.c @@ -16,6 +16,7 @@ #include #include +#include #define NUMTHREADS 10