diff options
Diffstat (limited to 'gdb/python/python.c')
-rw-r--r-- | gdb/python/python.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/gdb/python/python.c b/gdb/python/python.c index 05df234322b..073d7c57b65 100644 --- a/gdb/python/python.c +++ b/gdb/python/python.c @@ -105,7 +105,7 @@ const struct extension_language_defn extension_language_python = int gdb_python_initialized; -static PyMethodDef GdbMethods[]; +static PyMethodDef *get_GdbMethods (void); #ifdef IS_PY3K static struct PyModuleDef GdbModuleDef; @@ -1684,7 +1684,7 @@ message == an error message without a stack will be printed."), /* Add _gdb module to the list of known built-in modules. */ _PyImport_FixupBuiltin (gdb_module, "_gdb"); #else - gdb_module = Py_InitModule ("_gdb", GdbMethods); + gdb_module = Py_InitModule ("_gdb", get_GdbMethods()); #endif if (gdb_module == NULL) goto fail; @@ -1997,6 +1997,12 @@ Return a tuple containing all inferiors." }, {NULL, NULL, 0, NULL} }; +static PyMethodDef * +get_GdbMethods (void) +{ + return GdbMethods; +} + #ifdef IS_PY3K static struct PyModuleDef GdbModuleDef = { |