diff options
| author | Fabrice Desclaux <fabrice.desclaux@cea.fr> | 2019-02-25 11:09:54 +0100 |
|---|---|---|
| committer | Fabrice Desclaux <fabrice.desclaux@cea.fr> | 2019-03-05 16:52:49 +0100 |
| commit | 02bbb30efea4980c9d133947cbbf69fb599071ad (patch) | |
| tree | 3fea6826fcc5354840a27cb1dc99ff31eef81896 /miasm2/jitter/Jitgcc.c | |
| parent | eab809932871f91d6f4aa770fc321af9e156e0f5 (diff) | |
| download | miasm-02bbb30efea4980c9d133947cbbf69fb599071ad.tar.gz miasm-02bbb30efea4980c9d133947cbbf69fb599071ad.zip | |
Support python2/python3
Diffstat (limited to 'miasm2/jitter/Jitgcc.c')
| -rw-r--r-- | miasm2/jitter/Jitgcc.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/miasm2/jitter/Jitgcc.c b/miasm2/jitter/Jitgcc.c index 329b7db4..0a39c998 100644 --- a/miasm2/jitter/Jitgcc.c +++ b/miasm2/jitter/Jitgcc.c @@ -1,6 +1,7 @@ #include <Python.h> #include <inttypes.h> #include <stdint.h> +#include "compat_py23.h" typedef struct { uint8_t is_local; @@ -90,17 +91,16 @@ static PyMethodDef GccMethods[] = { {NULL, NULL, 0, NULL} /* Sentinel */ }; -PyMODINIT_FUNC -initJitgcc(void) + + +MOD_INIT(Jitgcc) { - PyObject *m; + PyObject *module; - m = Py_InitModule("Jitgcc", GccMethods); - if (m == NULL) - return; + MOD_DEF(module, "Jitgcc", "gcc module", GccMethods); - GccError = PyErr_NewException("gcc.error", NULL, NULL); - Py_INCREF(GccError); - PyModule_AddObject(m, "error", GccError); -} + if (module == NULL) + return NULL; + return module; +} |