mirroed sdk fixes
--HG-- extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%401656
This commit is contained in:
parent
afb4bd6d8b
commit
45f99fbb9c
@ -269,11 +269,15 @@ extern IServerGameDLL *gamedll;
|
|||||||
#define SM_GET_IFACE(prefix, addr) \
|
#define SM_GET_IFACE(prefix, addr) \
|
||||||
if (!g_pShareSys->RequestInterface(SM_MKIFACE(prefix), myself, (SMInterface **)&addr)) \
|
if (!g_pShareSys->RequestInterface(SM_MKIFACE(prefix), myself, (SMInterface **)&addr)) \
|
||||||
{ \
|
{ \
|
||||||
if (error) \
|
if (error != NULL && maxlength) \
|
||||||
{ \
|
{ \
|
||||||
snprintf(error, maxlength, "Could not find interface: %s (version: %d)", SMINTERFACE_##prefix##_NAME, SMINTERFACE_##prefix##_VERSION); \
|
size_t len = snprintf(error, maxlength, "Could not find interface: %s", SMINTERFACE_##prefix##_NAME); \
|
||||||
return false; \
|
if (len >= maxlength) \
|
||||||
|
{ \
|
||||||
|
error[maxlength - 1] = '\0'; \
|
||||||
|
} \
|
||||||
} \
|
} \
|
||||||
|
return false; \
|
||||||
}
|
}
|
||||||
/** Automates retrieving SourceMod interfaces when needed outside of SDK_OnLoad() */
|
/** Automates retrieving SourceMod interfaces when needed outside of SDK_OnLoad() */
|
||||||
#define SM_GET_LATE_IFACE(prefix, addr) \
|
#define SM_GET_LATE_IFACE(prefix, addr) \
|
||||||
@ -282,11 +286,15 @@ extern IServerGameDLL *gamedll;
|
|||||||
#define SM_CHECK_IFACE(prefix, addr) \
|
#define SM_CHECK_IFACE(prefix, addr) \
|
||||||
if (!addr) \
|
if (!addr) \
|
||||||
{ \
|
{ \
|
||||||
if (error) \
|
if (error != NULL && maxlength) \
|
||||||
{ \
|
{ \
|
||||||
snprintf(error, maxlength, "Could not find interface: %s", SMINTERFACE_##prefix##_NAME); \
|
size_t len = snprintf(error, maxlength, "Could not find interface: %s", SMINTERFACE_##prefix##_NAME); \
|
||||||
return false; \
|
if (len >= maxlength) \
|
||||||
|
{ \
|
||||||
|
error[maxlength - 1] = '\0'; \
|
||||||
|
} \
|
||||||
} \
|
} \
|
||||||
|
return false; \
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // _INCLUDE_SOURCEMOD_EXTENSION_BASESDK_H_
|
#endif // _INCLUDE_SOURCEMOD_EXTENSION_BASESDK_H_
|
||||||
|
@ -273,11 +273,15 @@ extern IServerGameDLL *gamedll;
|
|||||||
#define SM_GET_IFACE(prefix, addr) \
|
#define SM_GET_IFACE(prefix, addr) \
|
||||||
if (!g_pShareSys->RequestInterface(SM_MKIFACE(prefix), myself, (SMInterface **)&addr)) \
|
if (!g_pShareSys->RequestInterface(SM_MKIFACE(prefix), myself, (SMInterface **)&addr)) \
|
||||||
{ \
|
{ \
|
||||||
if (error) \
|
if (error != NULL && maxlength) \
|
||||||
{ \
|
{ \
|
||||||
snprintf(error, maxlength, "Could not find interface: %s (version: %d)", SMINTERFACE_##prefix##_NAME, SMINTERFACE_##prefix##_VERSION); \
|
size_t len = snprintf(error, maxlength, "Could not find interface: %s", SMINTERFACE_##prefix##_NAME); \
|
||||||
return false; \
|
if (len >= maxlength) \
|
||||||
|
{ \
|
||||||
|
error[maxlength - 1] = '\0'; \
|
||||||
|
} \
|
||||||
} \
|
} \
|
||||||
|
return false; \
|
||||||
}
|
}
|
||||||
/** Automates retrieving SourceMod interfaces when needed outside of SDK_OnLoad() */
|
/** Automates retrieving SourceMod interfaces when needed outside of SDK_OnLoad() */
|
||||||
#define SM_GET_LATE_IFACE(prefix, addr) \
|
#define SM_GET_LATE_IFACE(prefix, addr) \
|
||||||
@ -286,11 +290,15 @@ extern IServerGameDLL *gamedll;
|
|||||||
#define SM_CHECK_IFACE(prefix, addr) \
|
#define SM_CHECK_IFACE(prefix, addr) \
|
||||||
if (!addr) \
|
if (!addr) \
|
||||||
{ \
|
{ \
|
||||||
if (error) \
|
if (error != NULL && maxlength) \
|
||||||
{ \
|
{ \
|
||||||
snprintf(error, maxlength, "Could not find interface: %s", SMINTERFACE_##prefix##_NAME); \
|
size_t len = snprintf(error, maxlength, "Could not find interface: %s", SMINTERFACE_##prefix##_NAME); \
|
||||||
return false; \
|
if (len >= maxlength) \
|
||||||
|
{ \
|
||||||
|
error[maxlength - 1] = '\0'; \
|
||||||
|
} \
|
||||||
} \
|
} \
|
||||||
|
return false; \
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // _INCLUDE_SOURCEMOD_EXTENSION_BASESDK_H_
|
#endif // _INCLUDE_SOURCEMOD_EXTENSION_BASESDK_H_
|
||||||
|
@ -269,11 +269,15 @@ extern IServerGameDLL *gamedll;
|
|||||||
#define SM_GET_IFACE(prefix, addr) \
|
#define SM_GET_IFACE(prefix, addr) \
|
||||||
if (!g_pShareSys->RequestInterface(SM_MKIFACE(prefix), myself, (SMInterface **)&addr)) \
|
if (!g_pShareSys->RequestInterface(SM_MKIFACE(prefix), myself, (SMInterface **)&addr)) \
|
||||||
{ \
|
{ \
|
||||||
if (error) \
|
if (error != NULL && maxlength) \
|
||||||
{ \
|
{ \
|
||||||
snprintf(error, maxlength, "Could not find interface: %s (version: %d)", SMINTERFACE_##prefix##_NAME, SMINTERFACE_##prefix##_VERSION); \
|
size_t len = snprintf(error, maxlength, "Could not find interface: %s", SMINTERFACE_##prefix##_NAME); \
|
||||||
return false; \
|
if (len >= maxlength) \
|
||||||
|
{ \
|
||||||
|
error[maxlength - 1] = '\0'; \
|
||||||
|
} \
|
||||||
} \
|
} \
|
||||||
|
return false; \
|
||||||
}
|
}
|
||||||
/** Automates retrieving SourceMod interfaces when needed outside of SDK_OnLoad() */
|
/** Automates retrieving SourceMod interfaces when needed outside of SDK_OnLoad() */
|
||||||
#define SM_GET_LATE_IFACE(prefix, addr) \
|
#define SM_GET_LATE_IFACE(prefix, addr) \
|
||||||
@ -282,11 +286,15 @@ extern IServerGameDLL *gamedll;
|
|||||||
#define SM_CHECK_IFACE(prefix, addr) \
|
#define SM_CHECK_IFACE(prefix, addr) \
|
||||||
if (!addr) \
|
if (!addr) \
|
||||||
{ \
|
{ \
|
||||||
if (error) \
|
if (error != NULL && maxlength) \
|
||||||
{ \
|
{ \
|
||||||
snprintf(error, maxlength, "Could not find interface: %s", SMINTERFACE_##prefix##_NAME); \
|
size_t len = snprintf(error, maxlength, "Could not find interface: %s", SMINTERFACE_##prefix##_NAME); \
|
||||||
return false; \
|
if (len >= maxlength) \
|
||||||
|
{ \
|
||||||
|
error[maxlength - 1] = '\0'; \
|
||||||
|
} \
|
||||||
} \
|
} \
|
||||||
|
return false; \
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // _INCLUDE_SOURCEMOD_EXTENSION_BASESDK_H_
|
#endif // _INCLUDE_SOURCEMOD_EXTENSION_BASESDK_H_
|
||||||
|
@ -269,11 +269,15 @@ extern IServerGameDLL *gamedll;
|
|||||||
#define SM_GET_IFACE(prefix, addr) \
|
#define SM_GET_IFACE(prefix, addr) \
|
||||||
if (!g_pShareSys->RequestInterface(SM_MKIFACE(prefix), myself, (SMInterface **)&addr)) \
|
if (!g_pShareSys->RequestInterface(SM_MKIFACE(prefix), myself, (SMInterface **)&addr)) \
|
||||||
{ \
|
{ \
|
||||||
if (error) \
|
if (error != NULL && maxlength) \
|
||||||
{ \
|
{ \
|
||||||
snprintf(error, maxlength, "Could not find interface: %s (version: %d)", SMINTERFACE_##prefix##_NAME, SMINTERFACE_##prefix##_VERSION); \
|
size_t len = snprintf(error, maxlength, "Could not find interface: %s", SMINTERFACE_##prefix##_NAME); \
|
||||||
return false; \
|
if (len >= maxlength) \
|
||||||
|
{ \
|
||||||
|
error[maxlength - 1] = '\0'; \
|
||||||
|
} \
|
||||||
} \
|
} \
|
||||||
|
return false; \
|
||||||
}
|
}
|
||||||
/** Automates retrieving SourceMod interfaces when needed outside of SDK_OnLoad() */
|
/** Automates retrieving SourceMod interfaces when needed outside of SDK_OnLoad() */
|
||||||
#define SM_GET_LATE_IFACE(prefix, addr) \
|
#define SM_GET_LATE_IFACE(prefix, addr) \
|
||||||
@ -282,11 +286,15 @@ extern IServerGameDLL *gamedll;
|
|||||||
#define SM_CHECK_IFACE(prefix, addr) \
|
#define SM_CHECK_IFACE(prefix, addr) \
|
||||||
if (!addr) \
|
if (!addr) \
|
||||||
{ \
|
{ \
|
||||||
if (error) \
|
if (error != NULL && maxlength) \
|
||||||
{ \
|
{ \
|
||||||
snprintf(error, maxlength, "Could not find interface: %s", SMINTERFACE_##prefix##_NAME); \
|
size_t len = snprintf(error, maxlength, "Could not find interface: %s", SMINTERFACE_##prefix##_NAME); \
|
||||||
return false; \
|
if (len >= maxlength) \
|
||||||
|
{ \
|
||||||
|
error[maxlength - 1] = '\0'; \
|
||||||
|
} \
|
||||||
} \
|
} \
|
||||||
|
return false; \
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // _INCLUDE_SOURCEMOD_EXTENSION_BASESDK_H_
|
#endif // _INCLUDE_SOURCEMOD_EXTENSION_BASESDK_H_
|
||||||
|
@ -279,11 +279,15 @@ extern IServerGameDLL *gamedll;
|
|||||||
#define SM_GET_IFACE(prefix, addr) \
|
#define SM_GET_IFACE(prefix, addr) \
|
||||||
if (!g_pShareSys->RequestInterface(SM_MKIFACE(prefix), myself, (SMInterface **)&addr)) \
|
if (!g_pShareSys->RequestInterface(SM_MKIFACE(prefix), myself, (SMInterface **)&addr)) \
|
||||||
{ \
|
{ \
|
||||||
if (error) \
|
if (error != NULL && maxlength) \
|
||||||
{ \
|
{ \
|
||||||
snprintf(error, maxlength, "Could not find interface: %s (version: %d)", SMINTERFACE_##prefix##_NAME, SMINTERFACE_##prefix##_VERSION); \
|
size_t len = snprintf(error, maxlength, "Could not find interface: %s", SMINTERFACE_##prefix##_NAME); \
|
||||||
return false; \
|
if (len >= maxlength) \
|
||||||
|
{ \
|
||||||
|
error[maxlength - 1] = '\0'; \
|
||||||
|
} \
|
||||||
} \
|
} \
|
||||||
|
return false; \
|
||||||
}
|
}
|
||||||
/** Automates retrieving SourceMod interfaces when needed outside of SDK_OnLoad() */
|
/** Automates retrieving SourceMod interfaces when needed outside of SDK_OnLoad() */
|
||||||
#define SM_GET_LATE_IFACE(prefix, addr) \
|
#define SM_GET_LATE_IFACE(prefix, addr) \
|
||||||
@ -292,11 +296,15 @@ extern IServerGameDLL *gamedll;
|
|||||||
#define SM_CHECK_IFACE(prefix, addr) \
|
#define SM_CHECK_IFACE(prefix, addr) \
|
||||||
if (!addr) \
|
if (!addr) \
|
||||||
{ \
|
{ \
|
||||||
if (error) \
|
if (error != NULL && maxlength) \
|
||||||
{ \
|
{ \
|
||||||
snprintf(error, maxlength, "Could not find interface: %s", SMINTERFACE_##prefix##_NAME); \
|
size_t len = snprintf(error, maxlength, "Could not find interface: %s", SMINTERFACE_##prefix##_NAME); \
|
||||||
return false; \
|
if (len >= maxlength) \
|
||||||
|
{ \
|
||||||
|
error[maxlength - 1] = '\0'; \
|
||||||
|
} \
|
||||||
} \
|
} \
|
||||||
|
return false; \
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // _INCLUDE_SOURCEMOD_EXTENSION_BASESDK_H_
|
#endif // _INCLUDE_SOURCEMOD_EXTENSION_BASESDK_H_
|
||||||
|
@ -269,11 +269,15 @@ extern IServerGameDLL *gamedll;
|
|||||||
#define SM_GET_IFACE(prefix, addr) \
|
#define SM_GET_IFACE(prefix, addr) \
|
||||||
if (!g_pShareSys->RequestInterface(SM_MKIFACE(prefix), myself, (SMInterface **)&addr)) \
|
if (!g_pShareSys->RequestInterface(SM_MKIFACE(prefix), myself, (SMInterface **)&addr)) \
|
||||||
{ \
|
{ \
|
||||||
if (error) \
|
if (error != NULL && maxlength) \
|
||||||
{ \
|
{ \
|
||||||
snprintf(error, maxlength, "Could not find interface: %s (version: %d)", SMINTERFACE_##prefix##_NAME, SMINTERFACE_##prefix##_VERSION); \
|
size_t len = snprintf(error, maxlength, "Could not find interface: %s", SMINTERFACE_##prefix##_NAME); \
|
||||||
return false; \
|
if (len >= maxlength) \
|
||||||
|
{ \
|
||||||
|
error[maxlength - 1] = '\0'; \
|
||||||
|
} \
|
||||||
} \
|
} \
|
||||||
|
return false; \
|
||||||
}
|
}
|
||||||
/** Automates retrieving SourceMod interfaces when needed outside of SDK_OnLoad() */
|
/** Automates retrieving SourceMod interfaces when needed outside of SDK_OnLoad() */
|
||||||
#define SM_GET_LATE_IFACE(prefix, addr) \
|
#define SM_GET_LATE_IFACE(prefix, addr) \
|
||||||
@ -282,11 +286,15 @@ extern IServerGameDLL *gamedll;
|
|||||||
#define SM_CHECK_IFACE(prefix, addr) \
|
#define SM_CHECK_IFACE(prefix, addr) \
|
||||||
if (!addr) \
|
if (!addr) \
|
||||||
{ \
|
{ \
|
||||||
if (error) \
|
if (error != NULL && maxlength) \
|
||||||
{ \
|
{ \
|
||||||
snprintf(error, maxlength, "Could not find interface: %s", SMINTERFACE_##prefix##_NAME); \
|
size_t len = snprintf(error, maxlength, "Could not find interface: %s", SMINTERFACE_##prefix##_NAME); \
|
||||||
return false; \
|
if (len >= maxlength) \
|
||||||
|
{ \
|
||||||
|
error[maxlength - 1] = '\0'; \
|
||||||
|
} \
|
||||||
} \
|
} \
|
||||||
|
return false; \
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // _INCLUDE_SOURCEMOD_EXTENSION_BASESDK_H_
|
#endif // _INCLUDE_SOURCEMOD_EXTENSION_BASESDK_H_
|
||||||
|
@ -290,11 +290,15 @@ extern IServerGameDLL *gamedll;
|
|||||||
#define SM_GET_IFACE(prefix, addr) \
|
#define SM_GET_IFACE(prefix, addr) \
|
||||||
if (!g_pShareSys->RequestInterface(SM_MKIFACE(prefix), myself, (SMInterface **)&addr)) \
|
if (!g_pShareSys->RequestInterface(SM_MKIFACE(prefix), myself, (SMInterface **)&addr)) \
|
||||||
{ \
|
{ \
|
||||||
if (error) \
|
if (error != NULL && maxlength) \
|
||||||
{ \
|
{ \
|
||||||
snprintf(error, maxlength, "Could not find interface: %s (version: %d)", SMINTERFACE_##prefix##_NAME, SMINTERFACE_##prefix##_VERSION); \
|
size_t len = snprintf(error, maxlength, "Could not find interface: %s", SMINTERFACE_##prefix##_NAME); \
|
||||||
return false; \
|
if (len >= maxlength) \
|
||||||
|
{ \
|
||||||
|
error[maxlength - 1] = '\0'; \
|
||||||
|
} \
|
||||||
} \
|
} \
|
||||||
|
return false; \
|
||||||
}
|
}
|
||||||
/** Automates retrieving SourceMod interfaces when needed outside of SDK_OnLoad() */
|
/** Automates retrieving SourceMod interfaces when needed outside of SDK_OnLoad() */
|
||||||
#define SM_GET_LATE_IFACE(prefix, addr) \
|
#define SM_GET_LATE_IFACE(prefix, addr) \
|
||||||
@ -303,11 +307,15 @@ extern IServerGameDLL *gamedll;
|
|||||||
#define SM_CHECK_IFACE(prefix, addr) \
|
#define SM_CHECK_IFACE(prefix, addr) \
|
||||||
if (!addr) \
|
if (!addr) \
|
||||||
{ \
|
{ \
|
||||||
if (error) \
|
if (error != NULL && maxlength) \
|
||||||
{ \
|
{ \
|
||||||
snprintf(error, maxlength, "Could not find interface: %s", SMINTERFACE_##prefix##_NAME); \
|
size_t len = snprintf(error, maxlength, "Could not find interface: %s", SMINTERFACE_##prefix##_NAME); \
|
||||||
return false; \
|
if (len >= maxlength) \
|
||||||
|
{ \
|
||||||
|
error[maxlength - 1] = '\0'; \
|
||||||
|
} \
|
||||||
} \
|
} \
|
||||||
|
return false; \
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // _INCLUDE_SOURCEMOD_EXTENSION_BASESDK_H_
|
#endif // _INCLUDE_SOURCEMOD_EXTENSION_BASESDK_H_
|
||||||
|
Loading…
Reference in New Issue
Block a user