From: Tim Goya Date: Thu, 19 Nov 2009 17:18:08 +0000 (+0000) Subject: play with CMakeLists.txt compile flags, change from using DEBUG to NDEBUG (the way... X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=f0eca3366385d513651f695942c0ee8474a7de3b;p=supertux.git play with CMakeLists.txt compile flags, change from using DEBUG to NDEBUG (the way assert works) and use CMAKE_BUILD_TYPE to control DEBUG-ness SVN-Revision: 6052 --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 52faff5fb..249b9fff2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -47,22 +47,7 @@ ENDIF(COMMAND cmake_policy) SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${SUPERTUX_SOURCE_DIR}/mk/cmake) -# move some config clutter to the advanced section -MARK_AS_ADVANCED( - CMAKE_BACKWARDS_COMPATIBILITY - CMAKE_BUILD_TYPE - CMAKE_INSTALL_PREFIX - EXECUTABLE_OUTPUT_PATH - LIBRARY_OUTPUT_PATH - CMAKE_OSX_ARCHITECTURES - CMAKE_OSX_SYSROOT -) - ## For autopackage -MARK_AS_ADVANCED( - ENABLE_BINRELOC - APPDATADIR -) OPTION(ENABLE_BINRELOC "Enable autopackage's BINRELOC features" OFF) SET(APPDATADIR "${CMAKE_INSTALL_PREFIX}/share/games/supertux2") @@ -74,18 +59,9 @@ TEST_BIG_ENDIAN(WORDS_BIGENDIAN) ## Add lots of dependencies to compiler switches FIND_PACKAGE(SDL REQUIRED) -MARK_AS_ADVANCED( - SDLMAIN_LIBRARY - SDL_INCLUDE_DIR - SDL_LIBRARY -) INCLUDE_DIRECTORIES(${SDL_INCLUDE_DIR}) FIND_PACKAGE(SDL_image REQUIRED) -MARK_AS_ADVANCED( - SDLIMAGE_INCLUDE_DIR - SDLIMAGE_LIBRARY -) INCLUDE_DIRECTORIES(${SDLIMAGE_INCLUDE_DIR}) OPTION(ENABLE_OPENGL "Enable OpenGL support" ON) @@ -98,27 +74,12 @@ IF(ENABLE_OPENGL) ENDIF(ENABLE_OPENGL) FIND_PACKAGE(OpenAL REQUIRED) -MARK_AS_ADVANCED( - OPENAL_INCLUDE_DIR - OPENAL_LIBRARY -) INCLUDE_DIRECTORIES(${OPENAL_INCLUDE_DIR}) FIND_PACKAGE(OggVorbis REQUIRED) -MARK_AS_ADVANCED( - OGG_LIBRARY - VORBISENC_LIBRARY - VORBISFILE_LIBRARY - VORBIS_INCLUDE_DIR - VORBIS_LIBRARY -) INCLUDE_DIRECTORIES(${OGGVORBIS_INCLUDE_DIR}) FIND_PACKAGE(PhysFS REQUIRED) -MARK_AS_ADVANCED( - PHYSFS_INCLUDE_DIR - PHYSFS_LIBRARY -) INCLUDE_DIRECTORIES(${PHYSFS_INCLUDE_DIR}) FIND_PACKAGE(CURL) @@ -168,11 +129,13 @@ include_directories (${SUPERTUX_SOURCE_DIR}/external/obstack/) ## Build list of sources for supertux binary -FILE(GLOB SUPERTUX_SOURCES RELATIVE ${SUPERTUX_SOURCE_DIR} src/*.cpp src/*/*.cpp src/supertux/menu/*.cpp src/video/sdl/*.cpp external/obstack/*.c external/tinygettext/*.cpp external/findlocale/findlocale.c) +FILE(GLOB SUPERTUX_SOURCES_C RELATIVE ${SUPERTUX_SOURCE_DIR} external/obstack/*.c external/findlocale/findlocale.c) + +FILE(GLOB SUPERTUX_SOURCES_CXX RELATIVE ${SUPERTUX_SOURCE_DIR} src/main.cpp src/*/*.cpp src/supertux/menu/*.cpp src/video/sdl/*.cpp external/tinygettext/*.cpp) IF(HAVE_OPENGL) FILE(GLOB SUPERTUX_OPENGL_SOURCES RELATIVE ${SUPERTUX_SOURCE_DIR} src/video/gl/*.cpp) - SET(SUPERTUX_SOURCES ${SUPERTUX_SOURCES} ${SUPERTUX_OPENGL_SOURCES}) + SET(SUPERTUX_SOURCES_CXX ${SUPERTUX_SOURCES_CXX} ${SUPERTUX_OPENGL_SOURCES}) ENDIF(HAVE_OPENGL) ## Precompile "a few" headers in GCC @@ -195,7 +158,7 @@ IF(PRECOMPILE_HEADERS) COMMENT "Building precompiled header..." ) ## Make certain it is built - SET(SUPERTUX_SOURCES ${SUPERTUX_BINARY_DIR}/precompile.hh.gch ${SUPERTUX_SOURCES}) + SET(SUPERTUX_SOURCES_CXX ${SUPERTUX_BINARY_DIR}/precompile.hh.gch ${SUPERTUX_SOURCES_CXX}) SET(CMAKE_CXX_FLAGS "-include ${SUPERTUX_BINARY_DIR}/precompile.hh" ${CMAKE_CXX_FLAGS}) ELSE(PRECOMPILE_HEADERS) IF(EXISTS ${SUPERTUX_BINARY_DIR}/precompile.hh) @@ -209,17 +172,12 @@ ENDIF(PRECOMPILE_HEADERS) ## Debug options -OPTION(DEBUG "Build with debugging options" ON) -OPTION(WERROR "Stop on first compiler warning" ON) +OPTION(WERROR "Stop on first compiler warning" OFF) +OPTION(WARNINGS "Enable long list of warnings for compiler to check" ON) IF(CMAKE_COMPILER_IS_GNUCC) - ADD_DEFINITIONS(-Wall -Wextra -W) - IF (DEBUG) - REMOVE_DEFINITIONS(-O2) - ADD_DEFINITIONS(-O0 -g) - ELSE (DEBUG) - ADD_DEFINITIONS(-O2) - REMOVE_DEFINITIONS(-O0 -g) - ENDIF (DEBUG) + ADD_DEFINITIONS(-Wall -Wextra -funit-at-a-time) + SET(CMAKE_CXX_FLAGS_DEBUG "-O0 -g") + SET(CMAKE_C_FLAGS_DEBUG "-O0 -g") SET(CMAKE_CXX_FLAGS_PROFILE "-pg") SET(CMAKE_C_FLAGS_PROFILE "-pg") SET(CMAKE_LD_FLAGS_PROFILE "-pg") @@ -228,6 +186,12 @@ IF(CMAKE_COMPILER_IS_GNUCC) ELSE(WERROR) REMOVE_DEFINITIONS(-Werror) ENDIF(WERROR) + IF(WARNINGS) + SET(CMAKE_C_FLAGS "-fdiagnostics-show-option -pedantic -Wno-long-long -Wcast-align -Wdisabled-optimization -Winit-self -Winvalid-pch -Wlogical-op -Wmissing-include-dirs -Wmissing-noreturn -Wpacked -Wredundant-decls -Wstack-protector") + SET(CMAKE_CXX_FLAGS "-fdiagnostics-show-option -pedantic -Wno-long-long -Weffc++ -Wabi -Wctor-dtor-privacy -Wstrict-null-sentinel -Wcast-align -Wdisabled-optimization -Winit-self -Winvalid-pch -Wlogical-op -Wmissing-include-dirs -Wmissing-noreturn -Wpacked -Wredundant-decls -Wstack-protector") + # -ansi fails in MinGW + # still left: -Wold-style-cast -Wpadded -Wconversion -Wundef -Wsign-conversion -Wshadow -Winline -Wunsafe-loop-optimizations -Wfloat-equal -Wswitch-default -Wswitch-enum -Wcast-qual -Wsign-promo -Woverloaded-virtual -Wmissing-format-attribute -Wstrict-overflow=5 -Wformat=2 + ENDIF(WARNINGS) ENDIF(CMAKE_COMPILER_IS_GNUCC) ## Add in squirrel debug stuff @@ -236,7 +200,7 @@ OPTION(ENABLE_SQDBG "Build squirrel script interpreter with debugging options" O IF(ENABLE_SQDBG) include_directories (${SUPERTUX_SOURCE_DIR}/external/squirrel/) FILE(GLOB SQDBG_SOURCES RELATIVE ${SUPERTUX_SOURCE_DIR} external/squirrel/sqdbg/*.cpp) - SET(SUPERTUX_SOURCES ${SQDBG_SOURCES} ${SUPERTUX_SOURCES}) + SET(SUPERTUX_SOURCES_CXX ${SQDBG_SOURCES} ${SUPERTUX_SOURCES_CXX}) ENDIF(ENABLE_SQDBG) ## Build miniswig and generate miniswig wrapper @@ -256,7 +220,7 @@ IF(GENERATE_WRAPPER) ENDIF(GENERATE_WRAPPER) IF(NOT EXISTS ${SUPERTUX_SOURCE_DIR}/src/scripting/wrapper.cpp) - SET(SUPERTUX_SOURCES ${SUPERTUX_SOURCES} ${SUPERTUX_SOURCE_DIR}/src/scripting/wrapper.cpp) + SET(SUPERTUX_SOURCES_CXX ${SUPERTUX_SOURCES_CXX} ${SUPERTUX_SOURCE_DIR}/src/scripting/wrapper.cpp) ENDIF(NOT EXISTS ${SUPERTUX_SOURCE_DIR}/src/scripting/wrapper.cpp) ## If xgettext is available, generate messages.pot for sources @@ -276,8 +240,8 @@ IF(GENERATE_MESSAGESPOT) ADD_CUSTOM_COMMAND( OUTPUT ${MESSAGES_POT_FILE} COMMAND ${XGETTEXT_EXECUTABLE} - ARGS --keyword=_ --language=C++ --output=${MESSAGES_POT_FILE} ${SUPERTUX_SOURCES} - DEPENDS ${SUPERTUX_SOURCES} + ARGS --keyword=_ --language=C++ --output=${MESSAGES_POT_FILE} ${SUPERTUX_SOURCES_CXX} + DEPENDS ${SUPERTUX_SOURCES_CXX} WORKING_DIRECTORY ${SUPERTUX_SOURCE_DIR} COMMENT "Generating POT file ${MESSAGES_POT_FILE}" ) @@ -325,12 +289,12 @@ ENDIF(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") ## On Windows, add an icon IF(WIN32) - SET(SUPERTUX_SOURCES ${SUPERTUX_SOURCES} ${SUPERTUX_SOURCE_DIR}/data/images/engine/icons/supertux.rc) + SET(SUPERTUX_SOURCES_C ${SUPERTUX_SOURCES_C} ${SUPERTUX_SOURCE_DIR}/data/images/engine/icons/supertux.rc) IF(MINGW) ADD_CUSTOM_COMMAND( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/supertux_rc.o COMMAND windres.exe -I${CMAKE_CURRENT_SOURCE_DIR}/data/images/engine/icons -i${CMAKE_CURRENT_SOURCE_DIR}/data/images/engine/icons/supertux.rc -o ${CMAKE_CURRENT_BINARY_DIR}/supertux_rc.o) - SET(SUPERTUX_SOURCES ${SUPERTUX_SOURCES} ${CMAKE_CURRENT_BINARY_DIR}/supertux_rc.o) + SET(SUPERTUX_SOURCES_C ${SUPERTUX_SOURCES_C} ${CMAKE_CURRENT_BINARY_DIR}/supertux_rc.o) ELSE(MINGW) SET(SUPERTUX_EXE_SRCS ${SUPERTUX_EXE_SRCS} supertux.rc) ENDIF(MINGW) @@ -338,7 +302,7 @@ ENDIF(WIN32) ## Add binreloc.c if enabled IF(ENABLE_BINRELOC) - SET(SUPERTUX_SOURCES ${SUPERTUX_SOURCES} ${SUPERTUX_SOURCE_DIR}/external/binreloc/binreloc.c) + SET(SUPERTUX_SOURCES_C ${SUPERTUX_SOURCES_C} ${SUPERTUX_SOURCE_DIR}/external/binreloc/binreloc.c) ENDIF(ENABLE_BINRELOC) @@ -348,7 +312,7 @@ SET(EXECUTABLE_OUTPUT_PATH ${SUPERTUX_SOURCE_DIR}) ## Add target for supertux binary -ADD_EXECUTABLE(supertux2 ${SUPERTUX_SOURCES}) +ADD_EXECUTABLE(supertux2 ${SUPERTUX_SOURCES_C} ${SUPERTUX_SOURCES_CXX}) ## Link supertux binary with squirrel and other libraries @@ -365,15 +329,6 @@ IF(HAVE_LIBCURL) TARGET_LINK_LIBRARIES(supertux2 ${CURL_LIBRARY}) ENDIF(HAVE_LIBCURL) -# Warnings to add -OPTION(WARNINGS "Enable long list of warnings for compiler to check" ON) -IF(WARNINGS) - SET_PROPERTY(TARGET supertux2 APPEND PROPERTY COMPILE_FLAGS -# -ansi fails in MinGW -# still left: -Weffc++ -Wold-style-cast -Wpadded -Wconversion -Wundef -Wsign-conversion -Wshadow -Winline -Wunsafe-loop-optimizations -Wfloat-equal -Wswitch-default -Wswitch-enum -Wcast-qual -Wsign-promo -Woverloaded-virtual -Wmissing-format-attribute -Wstrict-overflow=5 -Wformat=2 - "-fdiagnostics-show-option -O3 -pedantic -Wno-long-long -Wabi -Wctor-dtor-privacy -Wstrict-null-sentinel -Wcast-align -Wdisabled-optimization -Winit-self -Winvalid-pch -Wlogical-op -Wmissing-include-dirs -Wmissing-noreturn -Wpacked -Wredundant-decls -Wstack-protector") -ENDIF(WARNINGS) - ## Install stuff IF(WIN32 AND NOT UNIX) @@ -466,3 +421,47 @@ ELSE(WIN32 AND NOT UNIX) ENDIF(WIN32 AND NOT UNIX) INCLUDE(CPack) +# move some config clutter to the advanced section +MARK_AS_ADVANCED( + CMAKE_BACKWARDS_COMPATIBILITY + CMAKE_BUILD_TYPE + CMAKE_INSTALL_PREFIX + EXECUTABLE_OUTPUT_PATH + LIBRARY_OUTPUT_PATH + CMAKE_OSX_ARCHITECTURES + CMAKE_OSX_SYSROOT +) + +MARK_AS_ADVANCED( + ENABLE_BINRELOC + APPDATADIR +) + +MARK_AS_ADVANCED( + SDLMAIN_LIBRARY + SDL_INCLUDE_DIR + SDL_LIBRARY +) + +MARK_AS_ADVANCED( + SDLIMAGE_INCLUDE_DIR + SDLIMAGE_LIBRARY +) + +MARK_AS_ADVANCED( + OPENAL_INCLUDE_DIR + OPENAL_LIBRARY +) + +MARK_AS_ADVANCED( + OGG_LIBRARY + VORBISENC_LIBRARY + VORBISFILE_LIBRARY + VORBIS_INCLUDE_DIR + VORBIS_LIBRARY +) + +MARK_AS_ADVANCED( + PHYSFS_INCLUDE_DIR + PHYSFS_LIBRARY +) diff --git a/SConscript b/SConscript index 2df0288e4..cc34733bf 100644 --- a/SConscript +++ b/SConscript @@ -84,7 +84,6 @@ class Project: config_h.write('#define APPDATADIR "data"\n') config_h.write('#define HAVE_LIBCURL 1\n') config_h.write('#define HAVE_OPENGL 1\n') - config_h.write('#define DEBUG 1\n') config_h.write('#define ICONV_CONST %s\n' % self.iconv_const) config_h.close() diff --git a/src/audio/ogg_sound_file.cpp b/src/audio/ogg_sound_file.cpp index 3d1cd246e..182371c38 100644 --- a/src/audio/ogg_sound_file.cpp +++ b/src/audio/ogg_sound_file.cpp @@ -16,6 +16,8 @@ #include "audio/ogg_sound_file.hpp" +#include + OggSoundFile::OggSoundFile(PHYSFS_file* file, double loop_begin, double loop_at) : file(), vorbis_file(), @@ -133,7 +135,7 @@ OggSoundFile::cb_seek(void* source, ogg_int64_t offset, int whence) return -1; break; default: -#ifdef DEBUG +#ifndef NDEBUG assert(false); #else return -1; diff --git a/src/audio/sound_manager.cpp b/src/audio/sound_manager.cpp index a5a47ae03..9a6b6c8df 100644 --- a/src/audio/sound_manager.cpp +++ b/src/audio/sound_manager.cpp @@ -27,7 +27,7 @@ #include "audio/stream_sound_source.hpp" #include "util/log.hpp" -#ifndef DEBUG +#ifdef NDEBUG /** Older openal versions often miss this function and it isn't that vital for * supertux... */ diff --git a/src/object/anchor_point.cpp b/src/object/anchor_point.cpp index 3b420c6c0..ad7db404b 100644 --- a/src/object/anchor_point.cpp +++ b/src/object/anchor_point.cpp @@ -91,7 +91,7 @@ Vector get_anchor_pos(const Rect& rect, AnchorPoint point) result.x = rect.get_right(); break; default: -#ifdef DEBUG +#ifndef NDEBUG throw std::runtime_error("Invalid anchor point found"); #endif log_warning << "Invalid anchor point found" << std::endl; @@ -110,7 +110,7 @@ Vector get_anchor_pos(const Rect& rect, AnchorPoint point) result.y = rect.get_bottom(); break; default: -#ifdef DEBUG +#ifndef NDEBUG throw std::runtime_error("Invalid anchor point found"); #endif log_warning << "Invalid anchor point found" << std::endl; @@ -137,7 +137,7 @@ Vector get_anchor_pos(const Rect& destrect, float width, float height, result.x = destrect.get_right() - width; break; default: -#ifdef DEBUG +#ifndef NDEBUG throw std::runtime_error("Invalid anchor point found"); #endif log_warning << "Invalid anchor point found" << std::endl; @@ -156,7 +156,7 @@ Vector get_anchor_pos(const Rect& destrect, float width, float height, result.y = destrect.get_bottom() - height; break; default: -#ifdef DEBUG +#ifndef NDEBUG throw std::runtime_error("Invalid anchor point found"); #endif log_warning << "Invalid anchor point found" << std::endl; diff --git a/src/object/player.cpp b/src/object/player.cpp index 052a4c594..a58f4aacf 100644 --- a/src/object/player.cpp +++ b/src/object/player.cpp @@ -1180,9 +1180,7 @@ Player::collision(GameObject& other, const CollisionHit& hit) if(hit.left || hit.right) { try_grab(); //grab objects right now, in update it will be too late } -#ifdef DEBUG assert(dynamic_cast (&other) != NULL); -#endif MovingObject* moving_object = static_cast (&other); if(moving_object->get_group() == COLGROUP_TOUCHABLE) { TriggerBase* trigger = dynamic_cast (&other); diff --git a/src/physfs/ifile_streambuf.cpp b/src/physfs/ifile_streambuf.cpp index 3d488ea41..224f37d1d 100644 --- a/src/physfs/ifile_streambuf.cpp +++ b/src/physfs/ifile_streambuf.cpp @@ -19,6 +19,8 @@ #include #include +#include + IFileStreambuf::IFileStreambuf(const std::string& filename) : file() { @@ -88,11 +90,8 @@ IFileStreambuf::seekoff(off_type off, std::ios_base::seekdir dir, pos += static_cast (PHYSFS_fileLength(file)); break; default: -#ifdef DEBUG assert(false); -#else return pos_type(off_type(-1)); -#endif } return seekpos(static_cast (pos), mode); diff --git a/src/sprite/sprite.cpp b/src/sprite/sprite.cpp index d497bf747..b159c9792 100644 --- a/src/sprite/sprite.cpp +++ b/src/sprite/sprite.cpp @@ -143,7 +143,7 @@ Sprite::draw_part(DrawingContext& context, const Vector& source, int frameidx = (int) frame; if(frameidx >= get_frames() || frameidx < 0) { -#ifndef DEBUG +#ifdef NDEBUG // in optimized mode we get some small rounding errors in floating point // number sometimes... log_warning << "frame out of range: " << frameidx << "/" << get_frames() << " at sprite: " << get_name() << "/" << get_action() << std::endl; diff --git a/src/supertux/main.cpp b/src/supertux/main.cpp index 0314797eb..d4c4f4679 100644 --- a/src/supertux/main.cpp +++ b/src/supertux/main.cpp @@ -441,7 +441,7 @@ Main::init_video() SDL_WM_SetIcon(icon, 0); SDL_FreeSurface(icon); } -#ifdef DEBUG +#ifndef NDEBUG else { log_warning << "Couldn't load icon '" << icon_fname << "'" << std::endl; } @@ -514,7 +514,7 @@ Main::wait_for_event(float min_delay, float max_delay) } } -#ifdef DEBUG +#ifndef NDEBUG static Uint32 last_timelog_ticks = 0; static const char* last_timelog_component = 0; diff --git a/src/supertux/tile.cpp b/src/supertux/tile.cpp index 0f5e2efd3..01cdff0ce 100644 --- a/src/supertux/tile.cpp +++ b/src/supertux/tile.cpp @@ -104,18 +104,18 @@ Tile::parse(const Reader& reader) } const lisp::Lisp* images; -#ifdef DEBUG +#ifndef NDEBUG images = reader.get_lisp("editor-images"); if(images) parse_images(*images); else { -#endif /*DEBUG*/ +#endif images = reader.get_lisp("images"); if(images) parse_images(*images); -#ifdef DEBUG +#ifndef NDEBUG } -#endif /*DEBUG*/ +#endif correct_attributes(); return id; diff --git a/src/supertux/title_screen.cpp b/src/supertux/title_screen.cpp index df3ab3ccf..76598e7c8 100644 --- a/src/supertux/title_screen.cpp +++ b/src/supertux/title_screen.cpp @@ -39,6 +39,8 @@ #include "util/reader.hpp" #include "video/drawing_context.hpp" +#include + TitleScreen::TitleScreen() : main_menu(), contrib_menu(), diff --git a/src/util/log.cpp b/src/util/log.cpp index 9b94c62ab..db49baffb 100644 --- a/src/util/log.cpp +++ b/src/util/log.cpp @@ -19,7 +19,7 @@ #include "math/rect.hpp" #include "supertux/console.hpp" -#ifdef DEBUG +#ifndef NDEBUG std::ostream& log_debug_f(const char* file, int line) { diff --git a/src/util/log.hpp b/src/util/log.hpp index 838791600..244c3f426 100644 --- a/src/util/log.hpp +++ b/src/util/log.hpp @@ -19,7 +19,7 @@ #include -#ifdef DEBUG +#ifndef NDEBUG #include diff --git a/src/video/color.hpp b/src/video/color.hpp index ef751b6f5..05d176c7c 100644 --- a/src/video/color.hpp +++ b/src/video/color.hpp @@ -38,7 +38,7 @@ public: blue(blue_), alpha(alpha_) { -#ifdef DEBUG +#ifndef NDEBUG check_color_ranges(); #endif } @@ -57,7 +57,7 @@ public: alpha = vals[3]; else alpha = 1.0; -#ifdef DEBUG +#ifndef NDEBUG check_color_ranges(); #endif } diff --git a/src/video/drawing_context.cpp b/src/video/drawing_context.cpp index 90cb1db28..070cffbb0 100644 --- a/src/video/drawing_context.cpp +++ b/src/video/drawing_context.cpp @@ -314,10 +314,8 @@ DrawingContext::get_light(const Vector& position, Color* color) void DrawingContext::do_drawing() { -#ifdef DEBUG assert(transformstack.empty()); assert(target_stack.empty()); -#endif transformstack.clear(); target_stack.clear(); diff --git a/src/video/glutil.hpp b/src/video/glutil.hpp index 4d5af6815..4ffea0050 100644 --- a/src/video/glutil.hpp +++ b/src/video/glutil.hpp @@ -37,7 +37,7 @@ static inline void check_gl_error(const char* message) { -#ifdef DEBUG +#ifndef NDEBUG GLenum error = glGetError(); if(error != GL_NO_ERROR) { std::ostringstream msg; @@ -82,7 +82,7 @@ static inline void check_gl_error(const char* message) static inline void assert_gl(const char* message) { -#ifdef DEBUG +#ifndef NDEBUG check_gl_error(message); #else (void) message;