Define SDL_PLATFORM_* macros instead of underscored ones (#8875)

This commit is contained in:
Anonymous Maarten
2024-01-24 02:40:51 +01:00
committed by GitHub
parent ceccf24519
commit 31d133db40
208 changed files with 1293 additions and 1138 deletions

View File

@@ -9,16 +9,17 @@
including commercial applications, and to alter it and redistribute it
freely.
*/
#include <stdlib.h>
#ifdef __EMSCRIPTEN__
#include <emscripten/emscripten.h>
#endif
#include <SDL3/SDL_test_common.h>
#include <SDL3/SDL_main.h>
#if defined(__IOS__) || defined(__ANDROID__) || defined(__EMSCRIPTEN__) || defined(__WINDOWS__) || defined(__LINUX__)
#ifdef SDL_PLATFORM_EMSCRIPTEN
#include <emscripten/emscripten.h>
#endif
#include <stdlib.h>
#if defined(SDL_PLATFORM_IOS) || defined(SDL_PLATFORM_ANDROID) || defined(SDL_PLATFORM_EMSCRIPTEN) || defined(SDL_PLATFORM_WINDOWS) || defined(SDL_PLATFORM_LINUX)
#define HAVE_OPENGLES2
#endif
@@ -535,7 +536,7 @@ Render(unsigned int width, unsigned int height, shader_data *data)
static int done;
static Uint32 frames;
static shader_data *datas;
#ifndef __EMSCRIPTEN__
#ifndef SDL_PLATFORM_EMSCRIPTEN
static thread_data *threads;
#endif
@@ -560,7 +561,7 @@ render_window(int index)
++frames;
}
#ifndef __EMSCRIPTEN__
#ifndef SDL_PLATFORM_EMSCRIPTEN
static int SDLCALL
render_thread_fn(void *render_ctx)
{
@@ -652,7 +653,7 @@ loop(void)
render_window(i);
}
}
#ifdef __EMSCRIPTEN__
#ifdef SDL_PLATFORM_EMSCRIPTEN
else {
emscripten_cancel_main_loop();
}
@@ -912,7 +913,7 @@ int main(int argc, char *argv[])
then = SDL_GetTicks();
done = 0;
#ifdef __EMSCRIPTEN__
#ifdef SDL_PLATFORM_EMSCRIPTEN
emscripten_set_main_loop(loop, 0, 1);
#else
if (threaded) {
@@ -950,7 +951,7 @@ int main(int argc, char *argv[])
SDL_Log("%2.2f frames per second\n",
((double)frames * 1000) / (now - then));
}
#ifndef __ANDROID__
#ifndef SDL_PLATFORM_ANDROID
quit(0);
#endif
return 0;