Define SDL_MAIN_HANDLED in all tests
Each test defines its own main() function. If this flag is not set, then SDL redefines it to SDL_main(), causing compilation failures.
This commit is contained in:
parent
ad92a192b5
commit
ba1b36758e
2 changed files with 2 additions and 2 deletions
|
@ -174,6 +174,7 @@ tests = [
|
||||||
foreach t : tests
|
foreach t : tests
|
||||||
exe = executable(t[0], t[1],
|
exe = executable(t[0], t[1],
|
||||||
include_directories: src_dir,
|
include_directories: src_dir,
|
||||||
dependencies: dependencies)
|
dependencies: dependencies,
|
||||||
|
c_args: ['-DSDL_MAIN_HANDLED'])
|
||||||
test(t[0], exe)
|
test(t[0], exe)
|
||||||
endforeach
|
endforeach
|
||||||
|
|
|
@ -2,7 +2,6 @@
|
||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#define SDL_MAIN_HANDLED // avoid to redefine main to SDL_main
|
|
||||||
#include <SDL2/SDL.h>
|
#include <SDL2/SDL.h>
|
||||||
|
|
||||||
#include "util/str_util.h"
|
#include "util/str_util.h"
|
||||||
|
|
Loading…
Reference in a new issue