From ba1b36758e8a6cbebe8215d9bb0936d4598d6045 Mon Sep 17 00:00:00 2001 From: Romain Vimont Date: Mon, 9 Dec 2019 23:08:10 +0100 Subject: [PATCH] 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. --- app/meson.build | 3 ++- app/tests/test_strutil.c | 1 - 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/meson.build b/app/meson.build index 7aaf936a..b3d30458 100644 --- a/app/meson.build +++ b/app/meson.build @@ -174,6 +174,7 @@ tests = [ foreach t : tests exe = executable(t[0], t[1], include_directories: src_dir, - dependencies: dependencies) + dependencies: dependencies, + c_args: ['-DSDL_MAIN_HANDLED']) test(t[0], exe) endforeach diff --git a/app/tests/test_strutil.c b/app/tests/test_strutil.c index baa2fd38..200e0f63 100644 --- a/app/tests/test_strutil.c +++ b/app/tests/test_strutil.c @@ -2,7 +2,6 @@ #include #include #include -#define SDL_MAIN_HANDLED // avoid to redefine main to SDL_main #include #include "util/str_util.h"