diff options
Diffstat (limited to 'Include')
-rw-r--r-- | Include/pydebug.h | 2 | ||||
-rw-r--r-- | Include/pyerrors.h | 12 |
2 files changed, 11 insertions, 3 deletions
diff --git a/Include/pydebug.h b/Include/pydebug.h index 70c88f6..cafbfd0 100644 --- a/Include/pydebug.h +++ b/Include/pydebug.h @@ -26,8 +26,6 @@ PyAPI_DATA(int) Py_UnbufferedStdioFlag; PYTHONPATH and PYTHONHOME from the environment */ #define Py_GETENV(s) (Py_IgnoreEnvironmentFlag ? NULL : getenv(s)) -PyAPI_FUNC(void) Py_FatalError(const char *message); - #ifdef __cplusplus } #endif diff --git a/Include/pyerrors.h b/Include/pyerrors.h index 4bb3c01..edc8218 100644 --- a/Include/pyerrors.h +++ b/Include/pyerrors.h @@ -70,7 +70,17 @@ PyAPI_FUNC(PyObject *) PyErr_Occurred(void); PyAPI_FUNC(void) PyErr_Clear(void); PyAPI_FUNC(void) PyErr_Fetch(PyObject **, PyObject **, PyObject **); PyAPI_FUNC(void) PyErr_Restore(PyObject *, PyObject *, PyObject *); -PyAPI_FUNC(void) Py_FatalError(const char *message); + +#if defined(__clang__) || \ + (defined(__GNUC__) && \ + ((__GNUC_MAJOR__ >= 3) || \ + (__GNUC_MAJOR__ == 2) && (__GNUC_MINOR__ >= 5))) +#define _Py_NO_RETURN __attribute__((__noreturn__)) +#else +#define _Py_NO_RETURN +#endif + +PyAPI_FUNC(void) Py_FatalError(const char *message) _Py_NO_RETURN; #if defined(Py_DEBUG) || defined(Py_LIMITED_API) #define _PyErr_OCCURRED() PyErr_Occurred() |