Skip to content

Commit

Permalink
actually fix megatest for real
Browse files Browse the repository at this point in the history
  • Loading branch information
slime73 committed Oct 12, 2024
1 parent 61f1ba2 commit 8c52dce
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions src/test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#include <freetype/freetype.h>
#if __has_include(<SDL3/SDL.h>)
#include <SDL3/SDL.h>
#include <SDL3/SDL_version.h>
#else
#include <SDL.h>
#endif
Expand Down Expand Up @@ -89,21 +90,23 @@ int main(int argc, char **argv)
vfunc SDL = [](strs &c, strs &l)
{
#if SDL_VERSION_ATLEAST(3, 0, 0)
SDL_Version compiled;
SDL_Version linked;
int compiled = SDL_VERSION;
int linked = SDL_GetVersion();

c << SDL_VERSIONNUM_MAJOR(compiled) << "." << SDL_VERSIONNUM_MINOR(compiled) << "." << SDL_VERSIONNUM_MICRO(compiled);
l << SDL_VERSIONNUM_MAJOR(linked) << "." << SDL_VERSIONNUM_MINOR(linked) << "." << SDL_VERSIONNUM_MICRO(linked);

return "SDL3";
#else
SDL_version compiled;
SDL_version linked;
#endif

SDL_VERSION(&compiled);
SDL_GetVersion(&linked);

c << (int)compiled.major << "." << (int)compiled.minor << "." << (int)compiled.patch;
l << (int)linked.major << "." << (int)linked.minor << "." << (int)linked.patch;
#if SDL_VERSION_ATLEAST(3, 0, 0)
return "SDL3";
#else

return "SDL2";
#endif
};
Expand Down

0 comments on commit 8c52dce

Please sign in to comment.