Skip to content

Commit e5de18e

Browse files
committed
Port S1 tf2/css/dods/hl2dm build fixes from master
1 parent 117ba23 commit e5de18e

File tree

8 files changed

+49
-9
lines changed

8 files changed

+49
-9
lines changed

AMBuildScript

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ class MMSConfig(object):
121121
'-Wall',
122122
'-Werror',
123123
'-Wno-uninitialized',
124+
'-Wno-sign-compare',
124125
'-Wno-unused',
125126
'-Wno-switch',
126127
'-Wno-unknown-pragmas',
@@ -142,6 +143,7 @@ class MMSConfig(object):
142143
'-fno-threadsafe-statics',
143144
'-Wno-non-virtual-dtor',
144145
'-Wno-overloaded-virtual',
146+
'-Wno-register',
145147
]
146148
if (cxx.version >= 'gcc-4.7' or cxx.family == 'clang'):
147149
cxx.cxxflags += ['-Wno-delete-non-virtual-dtor']
@@ -225,7 +227,7 @@ class MMSConfig(object):
225227

226228
# Platform-specifics
227229
if cxx.target.platform == 'linux':
228-
cxx.defines += ['_LINUX', 'POSIX', '_FILE_OFFSET_BITS=64']
230+
cxx.defines += ['LINUX', '_LINUX', 'POSIX', '_FILE_OFFSET_BITS=64']
229231
if cxx.family == 'gcc':
230232
cxx.linkflags += ['-static-libgcc']
231233
elif cxx.family == 'clang':

core/AMBuilder

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ for sdk_target in MMS.sdk_targets:
2525
'gamedll_bridge.cpp',
2626
'vsp_bridge.cpp'
2727
]
28+
binary.compiler.defines += ['_ALLOW_KEYWORD_MACROS']
2829

2930
if binary.compiler.target.arch == 'x86':
3031
binary.sources += ['sourcehook/sourcehook_hookmangen_x86.cpp']

core/metamod_convar.h

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
/**
2+
* vim: set ts=4 :
3+
* ======================================================
4+
* Metamod:Source
5+
* Copyright (C) 2004-2025 AlliedModders LLC and authors.
6+
* All rights reserved.
7+
* ======================================================
8+
*
9+
* This software is provided 'as-is', without any express or implied warranty.
10+
* In no event will the authors be held liable for any damages arising from
11+
* the use of this software.
12+
*
13+
* Permission is granted to anyone to use this software for any purpose,
14+
* including commercial applications, and to alter it and redistribute it
15+
* freely, subject to the following restrictions:
16+
*
17+
* 1. The origin of this software must not be misrepresented; you must not
18+
* claim that you wrote the original software. If you use this software in a
19+
* product, an acknowledgment in the product documentation would be
20+
* appreciated but is not required.
21+
* 2. Altered source versions must be plainly marked as such, and must not be
22+
* misrepresented as being the original software.
23+
* 3. This notice may not be removed or altered from any source distribution.
24+
*
25+
* Version: $Id$
26+
*/
27+
28+
#pragma once
29+
30+
#define protected public
31+
#define private public
32+
33+
#include <convar.h>
34+
35+
#undef protected
36+
#undef private

core/metamod_plugins.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@
3535

3636
#include <interface.h>
3737
#include <eiface.h>
38-
#include <convar.h>
3938
#include <sh_list.h>
4039
#include <sh_string.h>
4140
#include <IPluginManager.h>

core/provider/console.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ bool SMConVarAccessor::RegisterConCommandBase(ConCommandBase *pCommand)
4242
{
4343
m_RegisteredCommands.push_back(pCommand);
4444
#if SOURCE_ENGINE < SE_ALIENSWARM
45-
pCommand->SetNext(NULL);
45+
pCommand->m_pNext = NULL;
4646
#endif
4747
icvar->RegisterConCommand(pCommand);
4848

@@ -52,7 +52,7 @@ bool SMConVarAccessor::RegisterConCommandBase(ConCommandBase *pCommand)
5252
bool SMConVarAccessor::Register(ConCommandBase *pCommand)
5353
{
5454
#if SOURCE_ENGINE < SE_ALIENSWARM
55-
pCommand->SetNext(NULL);
55+
pCommand->m_pNext = NULL;
5656
#endif
5757
icvar->RegisterConCommand(pCommand);
5858

@@ -163,7 +163,7 @@ void SMConVarAccessor::Unregister(ConCommandBase *pCommand)
163163
if (pCur == pCommand)
164164
{
165165
*m_TopConCommandBase = const_cast<ConCommandBase *>(pCommand->GetNext());
166-
pCommand->SetNext(NULL);
166+
pCommand->m_pNext = NULL;
167167
return;
168168
}
169169

@@ -174,8 +174,8 @@ void SMConVarAccessor::Unregister(ConCommandBase *pCommand)
174174
{
175175
if (pCur == pCommand)
176176
{
177-
pPrev->SetNext(const_cast<ConCommandBase *>(pCommand->GetNext()));
178-
pCommand->SetNext(NULL);
177+
pPrev->m_pNext = const_cast<ConCommandBase *>(pCommand->GetNext());
178+
pCommand->m_pNext = NULL;
179179
}
180180

181181
pPrev = pCur;

core/provider/console.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
#define _INCLUDE_CONSOLE_MMS_H_
3030

3131
#include <interface.h>
32-
#include "convar.h"
32+
#include "../metamod_convar.h"
3333
#include <eiface.h>
3434
#include <sh_list.h>
3535

core/provider/provider_ep2.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@
2626
#ifndef _INCLUDE_METAMOD_SOURCE_BASE_PROVIDER_H_
2727
#define _INCLUDE_METAMOD_SOURCE_BASE_PROVIDER_H_
2828

29+
#include "../metamod_convar.h"
30+
2931
#if defined _DEBUG
3032
#define DEBUG2
3133
#undef _DEBUG

support/buildbot/generate_headers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ def output_version_header():
5151

5252
with open(os.path.join(SourceFolder, 'product.version')) as fp:
5353
contents = fp.read()
54-
m = re.match('(\d+)\.(\d+)\.(\d+)-?(.*)', contents)
54+
m = re.match(r'(\d+)\.(\d+)\.(\d+)-?(.*)', contents)
5555
if m == None:
5656
raise Exception('Could not detremine product version')
5757
major, minor, release, tag = m.groups()

0 commit comments

Comments
 (0)