Update SourcePawn.

This brings in a few breaking changes.

One, INVALID_FUNCTION is now 0 instead of -1. This is long overdue.
Plugins should transparently work except in two cases:

  1. Third-party extensions that have a hardcoded test for -1 will no
     longer work. A new API has been provided for this,
     GetFunctionByIdOrNull.
  2. If a plugin "framework" uses INVALID_FUNCTION anywhere in its
     exported API, then all plugins using that framework need to be
     recompiled together, so they agree on the value of
     INVALID_FUNCTION.

Hopefully the damage here is minimal. The core plugin version has been
bumped to 7 to try and limit conflicts.

Second, braceless functions are no longer supported. There wasn't really
any way around this and it's better to bite the bullet now. This affects
source compatibility, but not binary compatibility.

Third, the "using" keyword is no longer implemented. SourceMod now has a
Handle methodmap again. Plugins compiled against this new methodmap will
require a "Handle.~Handle" native, which 1.12 now provides.
This commit is contained in:
David Anderson
2023-11-02 18:38:30 -10:00
parent 8c9fd3746b
commit 060c832f89
9 changed files with 23 additions and 19 deletions
+1 -1
View File
@@ -38,7 +38,7 @@
#include <version>
/** If this gets changed, you need to update Core's check. */
#define SOURCEMOD_PLUGINAPI_VERSION 6
#define SOURCEMOD_PLUGINAPI_VERSION 7
struct PlVers
{
+5 -1
View File
@@ -75,7 +75,11 @@ native void CloseHandle(Handle hndl);
*/
native Handle CloneHandle(Handle hndl, Handle plugin=INVALID_HANDLE);
using __intrinsics__.Handle;
methodmap Handle __nullable__ {
public native ~Handle();
public native void Close();
};
/**
* Do not use this function. Returns if a Handle and its contents