From b5ebb234ddbb3683441ec1a6f2492ea0190d2615 Mon Sep 17 00:00:00 2001 From: Romain Vimont Date: Wed, 27 Nov 2019 13:53:29 +0100 Subject: [PATCH] Replace BUILD_DEBUG by NDEBUG Use the "standard" NDEBUG definition, which is used by assert(). --- app/meson.build | 2 +- app/src/main.c | 2 +- app/src/tiny_xpm.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/meson.build b/app/meson.build index 005239b8..843bfd9d 100644 --- a/app/meson.build +++ b/app/meson.build @@ -85,7 +85,7 @@ endif conf = configuration_data() # expose the build type -conf.set('BUILD_DEBUG', get_option('buildtype') == 'debug') +conf.set('NDEBUG', get_option('buildtype') != 'debug') # the version, updated on release conf.set_quoted('SCRCPY_VERSION', meson.project_version()) diff --git a/app/src/main.c b/app/src/main.c index cdd8c2ef..78bdcfd2 100644 --- a/app/src/main.c +++ b/app/src/main.c @@ -625,7 +625,7 @@ main(int argc, char *argv[]) { return 1; } -#ifdef BUILD_DEBUG +#ifndef NDEBUG SDL_LogSetAllPriority(SDL_LOG_PRIORITY_DEBUG); #endif diff --git a/app/src/tiny_xpm.c b/app/src/tiny_xpm.c index e96981fb..29e0b54f 100644 --- a/app/src/tiny_xpm.c +++ b/app/src/tiny_xpm.c @@ -36,7 +36,7 @@ find_color(struct index *index, int len, char c, uint32_t *color) { // (non-const) "char *" SDL_Surface * read_xpm(char *xpm[]) { -#if SDL_ASSERT_LEVEL >= 2 +#ifndef NDEBUG // patch the XPM to change the icon color in debug mode xpm[2] = ". c #CC00CC"; #endif