From 06ff49c6b609e373da42d62862956be58ae07fbf Mon Sep 17 00:00:00 2001 From: Daniel Gibson Date: Sat, 17 Jul 2021 18:24:46 +0200 Subject: [PATCH] Restore C++98 compatibility (NULL instead of nullptr) and print a message when libcurl has been found --- neo/CMakeLists.txt | 1 + neo/d3xp/Game_local.cpp | 2 +- neo/game/Game_local.cpp | 2 +- neo/sound/snd_system.cpp | 1 + neo/sys/events.cpp | 3 ++- neo/tools/debugger/DebuggerServer.cpp | 10 +++++----- 6 files changed, 11 insertions(+), 8 deletions(-) diff --git a/neo/CMakeLists.txt b/neo/CMakeLists.txt index 2736e6d7..a34b1917 100644 --- a/neo/CMakeLists.txt +++ b/neo/CMakeLists.txt @@ -184,6 +184,7 @@ find_package(CURL QUIET) if(CURL_FOUND) set(ID_ENABLE_CURL ON) include_directories(${CURL_INCLUDE_DIR}) + message(STATUS "libcurl found and enabled") else() message(WARNING "libcurl not found, server downloads won't be available (apart from that dhewm3 will work)") set(ID_ENABLE_CURL OFF) diff --git a/neo/d3xp/Game_local.cpp b/neo/d3xp/Game_local.cpp index f7a8ca8b..9a5db97b 100644 --- a/neo/d3xp/Game_local.cpp +++ b/neo/d3xp/Game_local.cpp @@ -305,7 +305,7 @@ void idGameLocal::Clear( void ) { static bool ( *updateDebuggerFnPtr )( idInterpreter *interpreter, idProgram *program, int instructionPointer ) = NULL; bool updateGameDebugger( idInterpreter *interpreter, idProgram *program, int instructionPointer ) { bool ret = false; - if ( interpreter != nullptr && program != nullptr ) { + if ( interpreter != NULL && program != NULL ) { ret = updateDebuggerFnPtr ? updateDebuggerFnPtr( interpreter , program, instructionPointer ) : false; } return ret; diff --git a/neo/game/Game_local.cpp b/neo/game/Game_local.cpp index f7bc67e6..fd42c320 100644 --- a/neo/game/Game_local.cpp +++ b/neo/game/Game_local.cpp @@ -273,7 +273,7 @@ bool IsDoom3DemoVersion() static bool ( *updateDebuggerFnPtr )( idInterpreter *interpreter, idProgram *program, int instructionPointer ) = NULL; bool updateGameDebugger( idInterpreter *interpreter, idProgram *program, int instructionPointer ) { bool ret = false; - if ( interpreter != nullptr && program != nullptr ) { + if ( interpreter != NULL && program != NULL ) { ret = updateDebuggerFnPtr ? updateDebuggerFnPtr( interpreter, program, instructionPointer ) : false; } return ret; diff --git a/neo/sound/snd_system.cpp b/neo/sound/snd_system.cpp index 804a0f84..3b070a8a 100644 --- a/neo/sound/snd_system.cpp +++ b/neo/sound/snd_system.cpp @@ -29,6 +29,7 @@ If you have questions concerning this license or the applicable additional terms #include "sys/platform.h" #include "sound/snd_local.h" +#include #ifdef ID_DEDICATED idCVar idSoundSystemLocal::s_noSound( "s_noSound", "1", CVAR_SOUND | CVAR_BOOL | CVAR_ROM, "" ); diff --git a/neo/sys/events.cpp b/neo/sys/events.cpp index faa46033..064b7c58 100644 --- a/neo/sys/events.cpp +++ b/neo/sys/events.cpp @@ -59,7 +59,8 @@ If you have questions concerning this license or the applicable additional terms #define SDLK_PRINTSCREEN SDLK_PRINT #endif -static const char *kbdNames[] = { +// NOTE: g++-4.7 doesn't like when this is static (for idCmdSystem::ArgCompletion_String) +const char *kbdNames[] = { #if SDL_VERSION_ATLEAST(2, 0, 0) // auto-detection is only available for SDL2 "auto", #endif diff --git a/neo/tools/debugger/DebuggerServer.cpp b/neo/tools/debugger/DebuggerServer.cpp index 612c22a4..2cfac7ad 100644 --- a/neo/tools/debugger/DebuggerServer.cpp +++ b/neo/tools/debugger/DebuggerServer.cpp @@ -187,13 +187,13 @@ bool rvDebuggerServer::ProcessMessages ( void ) case DBMSG_CONNECT: mConnected = true; SendMessage ( DBMSG_CONNECTED ); - HandleInspectScripts ( nullptr ); + HandleInspectScripts ( NULL ); com_editors |= EDITOR_DEBUGGER; break; case DBMSG_CONNECTED: mConnected = true; - HandleInspectScripts( nullptr ); + HandleInspectScripts( NULL ); com_editors |= EDITOR_DEBUGGER; break; @@ -555,7 +555,7 @@ void rvDebuggerServer::CheckBreakpoints ( idInterpreter* interpreter, idProgram* // See if we are supposed to break on the next script line if ( mBreakNext ) { - HandleInspectScripts(nullptr); + HandleInspectScripts(NULL); Break ( interpreter, program, instructionPointer ); return; } @@ -574,7 +574,7 @@ void rvDebuggerServer::CheckBreakpoints ( idInterpreter* interpreter, idProgram* // See if we are supposed to break on the next line if ( mBreakStepInto ) { - HandleInspectScripts(nullptr); + HandleInspectScripts(NULL); // Break Break ( interpreter, program, instructionPointer ); return; @@ -625,7 +625,7 @@ void rvDebuggerServer::CheckBreakpoints ( idInterpreter* interpreter, idProgram* // Pop out of the critical section so we dont get stuck SDL_UnlockMutex( mCriticalSection ); - HandleInspectScripts(nullptr); + HandleInspectScripts(NULL); // We hit a breakpoint, so break Break ( interpreter, program, instructionPointer );