Update pinned commit for SourceMod, and adjust for API changes.

This commit is contained in:
David Anderson
2026-09-01 18:58:42 -07:00
parent 17eb8c2652
commit 02c56a6a42
8 changed files with 34 additions and 34 deletions
+1 -1
View File
@@ -438,7 +438,7 @@ class SMConfig(object):
return lambda builder, name: self.StaticLibrary(builder, cxx, name)
extra_vars = {'Configure': get_configure_fn(cxx)}
libamtl = builder.Build('public/amtl/amtl/AMBuilder', extra_vars)
self.libamtl[cxx.target.arch] = libamtl.binary
self.libamtl[cxx.target] = libamtl.binary
def BinaryOutputName(self, binary, binary_type):
target = binary.compiler.target
+7 -4
View File
@@ -8,6 +8,8 @@ for cxx in builder.targets:
os.path.join(builder.sourcePath, 'core', 'logic'),
os.path.join(builder.sourcePath, 'public'),
os.path.join(builder.sourcePath, 'sourcepawn', 'include'),
os.path.join(builder.sourcePath, 'sourcepawn'),
os.path.join(builder.sourcePath, 'sourcepawn', 'vm'),
os.path.join(builder.sourcePath, 'public', 'amtl', 'amtl'),
os.path.join(builder.sourcePath, 'public', 'amtl'),
os.path.join(SM.mms_root, 'core', 'sourcehook')
@@ -24,11 +26,12 @@ for cxx in builder.targets:
binary.compiler.cflags += ['-Wno-deprecated-declarations']
binary.compiler.postlink += ['-framework', 'CoreServices', '-lm']
arch = binary.compiler.target.arch
target = binary.compiler.target
binary.compiler.linkflags += [
SP.static_libsp[arch],
SP.libamtl[arch],
SP.zlib[arch],
SP.static_libsp[target],
SP.libamtl[target],
SP.zlib[target],
SP.mimalloc[target],
]
if binary.compiler.family == 'gcc' or binary.compiler.family == 'clang':
+2 -3
View File
@@ -486,10 +486,9 @@ bool CPlugin::TryCompile()
char fullpath[PLATFORM_MAX_PATH];
g_pSM->BuildPath(Path_SM, fullpath, sizeof(fullpath), "plugins/%s", m_filename);
char loadmsg[255];
m_pRuntime.reset(g_pPawnEnv->LoadBinaryFromFile(fullpath, loadmsg, sizeof(loadmsg)));
m_pRuntime.reset(g_pPawnEnv->LoadBinaryFromFile(fullpath));
if (!m_pRuntime) {
EvictWithError(Plugin_BadLoad, "Unable to load plugin (%s)", loadmsg);
EvictWithError(Plugin_BadLoad, "Unable to load plugin (%s)", m_filename);
return false;
}
+1 -1
View File
@@ -236,7 +236,7 @@ void RootConsoleMenu::OnRootConsoleCommand(const char *cmdname, const ICommandAr
{
ConsolePrint(" SourceMod Version Information:");
ConsolePrint(" SourceMod Version: %s", SOURCEMOD_VERSION);
if (g_pPawnEnv->IsJitEnabled())
if (g_pPawnEnv->IsJitAllowed())
ConsolePrint(" SourcePawn Engine: %s (build %s)", g_pPawnEnv->GetEngineName(), g_pPawnEnv->GetVersionString());
else
ConsolePrint(" SourcePawn Engine: %s (build %s NO JIT)", g_pPawnEnv->GetEngineName(), g_pPawnEnv->GetVersionString());
+21 -20
View File
@@ -37,6 +37,7 @@
#include "CellArray.h"
#include <IHandleSys.h>
#include <amtl/am-raii.h>
#include <sourcepawn/vm/base-runtime.h>
/***********************************
* About the double array hack *
@@ -269,21 +270,21 @@ static cell_t sm_SortStrings_Legacy(IPluginContext *pContext, const cell_t *para
return 1;
}
static IPluginContext* sSortContext = nullptr;
static sp::BaseRuntime* sSortRuntime = nullptr;
int sort_strings_asc(const void *blk1, const void *blk2)
{
cell_t str_addr1 = *(cell_t *)blk1;
cell_t str_addr2 = *(cell_t *)blk2;
ARRAY_PTR h1, h2;
if (sSortContext->LocalToArrayPtr(str_addr1, &h1) != SP_ERROR_NONE ||
sSortContext->LocalToArrayPtr(str_addr2, &h2) != SP_ERROR_NONE)
sp::ARRAY_PTR h1, h2;
if (sSortRuntime->LocalToArrayPtr(str_addr1, &h1) != SP_ERROR_NONE ||
sSortRuntime->LocalToArrayPtr(str_addr2, &h2) != SP_ERROR_NONE)
{
return 0;
}
char *str1 = (char *)sSortContext->GetArrayData(h1);
char *str2 = (char *)sSortContext->GetArrayData(h2);
char *str1 = (char *)sSortRuntime->GetArrayData(h1);
char *str2 = (char *)sSortRuntime->GetArrayData(h2);
if (!str1 || !str2)
return 0;
@@ -296,14 +297,14 @@ int sort_strings_desc(const void *blk1, const void *blk2)
cell_t str_addr1 = *(cell_t *)blk1;
cell_t str_addr2 = *(cell_t *)blk2;
ARRAY_PTR h1, h2;
if (sSortContext->LocalToArrayPtr(str_addr1, &h1) != SP_ERROR_NONE ||
sSortContext->LocalToArrayPtr(str_addr2, &h2) != SP_ERROR_NONE)
sp::ARRAY_PTR h1, h2;
if (sSortRuntime->LocalToArrayPtr(str_addr1, &h1) != SP_ERROR_NONE ||
sSortRuntime->LocalToArrayPtr(str_addr2, &h2) != SP_ERROR_NONE)
{
return 0;
}
char *str1 = (char *)sSortContext->GetArrayData(h1);
char *str2 = (char *)sSortContext->GetArrayData(h2);
char *str1 = (char *)sSortRuntime->GetArrayData(h1);
char *str2 = (char *)sSortRuntime->GetArrayData(h2);
if (!str1 || !str2)
return 0;
@@ -313,19 +314,19 @@ int sort_strings_desc(const void *blk1, const void *blk2)
static cell_t sm_SortStrings(IPluginContext *pContext, const cell_t *params)
{
auto rt = pContext->GetRuntime();
auto rt = pContext->GetBaseRuntime();
if (!rt->UsesDirectArrays())
return sm_SortStrings_Legacy(pContext, params);
ARRAY_PTR handle;
if (pContext->LocalToArrayPtr(params[1], &handle) != SP_ERROR_NONE)
sp::ARRAY_PTR handle;
if (rt->LocalToArrayPtr(params[1], &handle) != SP_ERROR_NONE)
return 0;
cell_t *array = (cell_t *)pContext->GetArrayData(handle);
cell_t *array = (cell_t *)rt->GetArrayData(handle);
cell_t array_size = params[2];
cell_t type = params[3];
ke::SaveAndSet<IPluginContext*> set_context(&sSortContext, pContext);
ke::SaveAndSet<sp::BaseRuntime*> set_runtime(&sSortRuntime, rt);
if (type == Sort_Ascending)
{
@@ -498,15 +499,15 @@ static int sort2d_amx_custom(const void *elem1, const void *elem2)
static cell_t sm_SortCustom2D(IPluginContext *pContext, const cell_t *params)
{
auto rt = pContext->GetRuntime();
auto rt = pContext->GetBaseRuntime();
if (!rt->UsesDirectArrays())
return sm_SortCustom2D_Legacy(pContext, params);
ARRAY_PTR handle;
if (pContext->LocalToArrayPtr(params[1], &handle) != SP_ERROR_NONE)
sp::ARRAY_PTR handle;
if (rt->LocalToArrayPtr(params[1], &handle) != SP_ERROR_NONE)
return 0;
cell_t *array = (cell_t *)pContext->GetArrayData(handle);
cell_t *array = (cell_t *)rt->GetArrayData(handle);
cell_t array_size = params[2];
IPluginFunction *pFunction;
-3
View File
@@ -47,7 +47,6 @@ public Plugin myinfo =
/** Various parsing globals */
bool g_LoggedFileName = false; /* Whether or not the file name has been logged */
int g_ErrorCount = 0; /* Current error count */
int g_IgnoreLevel = 0; /* Nested ignored section count, so users can screw up files safely */
int g_CurrentLine = 0; /* Current line we're on */
char g_Filename[PLATFORM_MAX_PATH]; /* Used for error messages */
@@ -84,12 +83,10 @@ void ParseError(const char[] format, any ...)
LogError(" (line %d) %s", g_CurrentLine, buffer);
g_ErrorCount++;
}
void InitGlobalStates()
{
g_ErrorCount = 0;
g_IgnoreLevel = 0;
g_CurrentLine = 0;
g_LoggedFileName = false;