diff --git a/AMBuildScript b/AMBuildScript index e33cddf5..b5c9d2b6 100644 --- a/AMBuildScript +++ b/AMBuildScript @@ -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 diff --git a/core/logic/AMBuilder b/core/logic/AMBuilder index a7b58aa9..8f5f49ac 100644 --- a/core/logic/AMBuilder +++ b/core/logic/AMBuilder @@ -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': diff --git a/core/logic/PluginSys.cpp b/core/logic/PluginSys.cpp index dafaab49..557a3244 100644 --- a/core/logic/PluginSys.cpp +++ b/core/logic/PluginSys.cpp @@ -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; } diff --git a/core/logic/RootConsoleMenu.cpp b/core/logic/RootConsoleMenu.cpp index d529b324..12bf2afc 100644 --- a/core/logic/RootConsoleMenu.cpp +++ b/core/logic/RootConsoleMenu.cpp @@ -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()); diff --git a/core/logic/smn_sorting.cpp b/core/logic/smn_sorting.cpp index 084453f3..0ad99fd0 100644 --- a/core/logic/smn_sorting.cpp +++ b/core/logic/smn_sorting.cpp @@ -37,6 +37,7 @@ #include "CellArray.h" #include #include +#include /*********************************** * 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 set_context(&sSortContext, pContext); + ke::SaveAndSet 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; diff --git a/plugins/admin-flatfile.sp b/plugins/admin-flatfile.sp index ca14b1db..c6a35cce 100644 --- a/plugins/admin-flatfile.sp +++ b/plugins/admin-flatfile.sp @@ -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; diff --git a/public/amtl b/public/amtl index 44e73d48..52bac96f 160000 --- a/public/amtl +++ b/public/amtl @@ -1 +1 @@ -Subproject commit 44e73d48620c6f880d4243fdeb51e8160b379a9b +Subproject commit 52bac96f46050084d801012b3965591ae53cd9a7 diff --git a/sourcepawn b/sourcepawn index f2d11ff1..62a0c091 160000 --- a/sourcepawn +++ b/sourcepawn @@ -1 +1 @@ -Subproject commit f2d11ff1a80ac891b7fb7ba81ad78646d9232c3e +Subproject commit 62a0c0915a4032dff2c737721d65217f231ee4f2