mirror of
https://github.com/H-uru/korman.git
synced 2025-07-13 18:17:38 -04:00
Implement Korlib API versioning
A common error when developing with Korman and Korlib is to forget to recompile _korlib on changes in the upstream C++ code. This will prevent the errors from being catastrophic and will revert the user to the python reference implementation with a minimum of fuss.
This commit is contained in:
@ -18,6 +18,9 @@
|
||||
#include "sound.h"
|
||||
#include "texture.h"
|
||||
|
||||
// This konstant is compared against that in the Python module to prevent sneaky errors...
|
||||
#define KORLIB_API_VERSION 1
|
||||
|
||||
extern "C" {
|
||||
|
||||
static PyMethodDef korlib_Methods[] = {
|
||||
@ -46,6 +49,9 @@ PyMODINIT_FUNC PyInit__korlib() {
|
||||
// Module classes...
|
||||
PyModule_AddObject(module, "GLTexture", Init_pyGLTexture_Type());
|
||||
|
||||
// Konstants
|
||||
PyModule_AddIntConstant(module, "_KORLIB_API_VERSION", KORLIB_API_VERSION);
|
||||
|
||||
return module;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user