diff --git a/AMBuildScript b/AMBuildScript index 3265f86..151df4c 100644 --- a/AMBuildScript +++ b/AMBuildScript @@ -121,6 +121,7 @@ class MMSConfig(object): '-Wall', '-Werror', '-Wno-uninitialized', + '-Wno-sign-compare', '-Wno-unused', '-Wno-switch', '-Wno-unknown-pragmas', @@ -142,6 +143,7 @@ class MMSConfig(object): '-fno-threadsafe-statics', '-Wno-non-virtual-dtor', '-Wno-overloaded-virtual', + '-Wno-register', ] if (cxx.version >= 'gcc-4.7' or cxx.family == 'clang'): cxx.cxxflags += ['-Wno-delete-non-virtual-dtor'] @@ -225,7 +227,7 @@ class MMSConfig(object): # Platform-specifics if cxx.target.platform == 'linux': - cxx.defines += ['_LINUX', 'POSIX', '_FILE_OFFSET_BITS=64'] + cxx.defines += ['LINUX', '_LINUX', 'POSIX', '_FILE_OFFSET_BITS=64'] if cxx.family == 'gcc': cxx.linkflags += ['-static-libgcc'] elif cxx.family == 'clang': diff --git a/core/AMBuilder b/core/AMBuilder index 5c673f5..586a1da 100644 --- a/core/AMBuilder +++ b/core/AMBuilder @@ -25,6 +25,7 @@ for sdk_target in MMS.sdk_targets: 'gamedll_bridge.cpp', 'vsp_bridge.cpp' ] + binary.compiler.defines += ['_ALLOW_KEYWORD_MACROS'] if binary.compiler.target.arch == 'x86': binary.sources += ['sourcehook/sourcehook_hookmangen_x86.cpp'] diff --git a/core/metamod_convar.h b/core/metamod_convar.h new file mode 100644 index 0000000..9365d53 --- /dev/null +++ b/core/metamod_convar.h @@ -0,0 +1,36 @@ +/** + * vim: set ts=4 : + * ====================================================== + * Metamod:Source + * Copyright (C) 2004-2025 AlliedModders LLC and authors. + * All rights reserved. + * ====================================================== + * + * This software is provided 'as-is', without any express or implied warranty. + * In no event will the authors be held liable for any damages arising from + * the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software in a + * product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + * Version: $Id$ + */ + +#pragma once + +#define protected public +#define private public + +#include + +#undef protected +#undef private diff --git a/core/metamod_plugins.h b/core/metamod_plugins.h index 5bf4f90..779c02e 100644 --- a/core/metamod_plugins.h +++ b/core/metamod_plugins.h @@ -35,7 +35,6 @@ #include #include -#include #include #include #include diff --git a/core/provider/console.cpp b/core/provider/console.cpp index 7d665b7..d699cfb 100644 --- a/core/provider/console.cpp +++ b/core/provider/console.cpp @@ -42,7 +42,7 @@ bool SMConVarAccessor::RegisterConCommandBase(ConCommandBase *pCommand) { m_RegisteredCommands.push_back(pCommand); #if SOURCE_ENGINE < SE_ALIENSWARM - pCommand->SetNext(NULL); + pCommand->m_pNext = NULL; #endif icvar->RegisterConCommand(pCommand); @@ -52,7 +52,7 @@ bool SMConVarAccessor::RegisterConCommandBase(ConCommandBase *pCommand) bool SMConVarAccessor::Register(ConCommandBase *pCommand) { #if SOURCE_ENGINE < SE_ALIENSWARM - pCommand->SetNext(NULL); + pCommand->m_pNext = NULL; #endif icvar->RegisterConCommand(pCommand); @@ -163,7 +163,7 @@ void SMConVarAccessor::Unregister(ConCommandBase *pCommand) if (pCur == pCommand) { *m_TopConCommandBase = const_cast(pCommand->GetNext()); - pCommand->SetNext(NULL); + pCommand->m_pNext = NULL; return; } @@ -174,8 +174,8 @@ void SMConVarAccessor::Unregister(ConCommandBase *pCommand) { if (pCur == pCommand) { - pPrev->SetNext(const_cast(pCommand->GetNext())); - pCommand->SetNext(NULL); + pPrev->m_pNext = const_cast(pCommand->GetNext()); + pCommand->m_pNext = NULL; } pPrev = pCur; diff --git a/core/provider/console.h b/core/provider/console.h index dbae221..513b2f0 100644 --- a/core/provider/console.h +++ b/core/provider/console.h @@ -29,7 +29,7 @@ #define _INCLUDE_CONSOLE_MMS_H_ #include -#include "convar.h" +#include "../metamod_convar.h" #include #include diff --git a/core/provider/provider_ep2.h b/core/provider/provider_ep2.h index 59f79d2..d6af98b 100644 --- a/core/provider/provider_ep2.h +++ b/core/provider/provider_ep2.h @@ -26,6 +26,8 @@ #ifndef _INCLUDE_METAMOD_SOURCE_BASE_PROVIDER_H_ #define _INCLUDE_METAMOD_SOURCE_BASE_PROVIDER_H_ +#include "../metamod_convar.h" + #if defined _DEBUG #define DEBUG2 #undef _DEBUG diff --git a/support/buildbot/generate_headers.py b/support/buildbot/generate_headers.py index c730ee7..578dcb7 100644 --- a/support/buildbot/generate_headers.py +++ b/support/buildbot/generate_headers.py @@ -51,7 +51,7 @@ def output_version_header(): with open(os.path.join(SourceFolder, 'product.version')) as fp: contents = fp.read() - m = re.match('(\d+)\.(\d+)\.(\d+)-?(.*)', contents) + m = re.match(r'(\d+)\.(\d+)\.(\d+)-?(.*)', contents) if m == None: raise Exception('Could not detremine product version') major, minor, release, tag = m.groups()