PyAPI_FUNC(void) PyErr_SetExcInfo(PyObject *, PyObject *, PyObject *);
#endif
-#if defined(__clang__) || \
- (defined(__GNUC__) && \
- ((__GNUC__ >= 3) || \
- (__GNUC__ == 2) && (__GNUC_MINOR__ >= 5)))
-# define _Py_NO_RETURN __attribute__((__noreturn__))
-#elif defined(_MSC_VER)
-# define _Py_NO_RETURN __declspec(noreturn)
-#else
-# define _Py_NO_RETURN
-#endif
-
/* Defined in Python/pylifecycle.c */
PyAPI_FUNC(void) _Py_NO_RETURN Py_FatalError(const char *message);
# define _Py_FORCE_UTF8_FS_ENCODING
#endif
+/* Mark a function which cannot return. Example:
+
+ PyAPI_FUNC(void) _Py_NO_RETURN PyThread_exit_thread(void); */
+#if defined(__clang__) || \
+ (defined(__GNUC__) && \
+ ((__GNUC__ >= 3) || \
+ (__GNUC__ == 2) && (__GNUC_MINOR__ >= 5)))
+# define _Py_NO_RETURN __attribute__((__noreturn__))
+#elif defined(_MSC_VER)
+# define _Py_NO_RETURN __declspec(noreturn)
+#else
+# define _Py_NO_RETURN
+#endif
+
#endif /* Py_PYPORT_H */
PyAPI_FUNC(void) PyThread_init_thread(void);
PyAPI_FUNC(unsigned long) PyThread_start_new_thread(void (*)(void *), void *);
-PyAPI_FUNC(void) PyThread_exit_thread(void);
+PyAPI_FUNC(void) _Py_NO_RETURN PyThread_exit_thread(void);
PyAPI_FUNC(unsigned long) PyThread_get_thread_ident(void);
PyAPI_FUNC(PyThread_type_lock) PyThread_allocate_lock(void);
if (_Py_IsFinalizing() && !_Py_CURRENTLY_FINALIZING(tstate)) {
drop_gil(tstate);
PyThread_exit_thread();
- Py_UNREACHABLE();
}
}
return GetCurrentThreadId();
}
-void
+void _Py_NO_RETURN
PyThread_exit_thread(void)
{
dprintf(("%lu: PyThread_exit_thread called\n", PyThread_get_thread_ident()));
return (unsigned long) threadid;
}
-void
+void _Py_NO_RETURN
PyThread_exit_thread(void)
{
dprintf(("PyThread_exit_thread called\n"));