Skip to content

Commit ba1b367

Browse files
committed
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.
1 parent ad92a19 commit ba1b367

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

app/meson.build

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,7 @@ tests = [
174174
foreach t : tests
175175
exe = executable(t[0], t[1],
176176
include_directories: src_dir,
177-
dependencies: dependencies)
177+
dependencies: dependencies,
178+
c_args: ['-DSDL_MAIN_HANDLED'])
178179
test(t[0], exe)
179180
endforeach

app/tests/test_strutil.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
#include <limits.h>
33
#include <stdio.h>
44
#include <string.h>
5-
#define SDL_MAIN_HANDLED // avoid to redefine main to SDL_main
65
#include <SDL2/SDL.h>
76

87
#include "util/str_util.h"

0 commit comments

Comments
 (0)