summaryrefslogtreecommitdiffstats
path: root/Include/pyerrors.h
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@redhat.com>2018-08-01 14:41:25 (GMT)
committerGitHub <noreply@github.com>2018-08-01 14:41:25 (GMT)
commitcfc8831f5ed607048679427f7d76d6cb4f8a2e8a (patch)
tree93887fde4a58d448b9b0488ab75fc55bdbbe1a09 /Include/pyerrors.h
parentfc96437db4fa95dff99d43d4500beaf12bad5bff (diff)
downloadcpython-cfc8831f5ed607048679427f7d76d6cb4f8a2e8a.zip
cpython-cfc8831f5ed607048679427f7d76d6cb4f8a2e8a.tar.gz
cpython-cfc8831f5ed607048679427f7d76d6cb4f8a2e8a.tar.bz2
Define _Py_NO_RETURN for Microsoft C compiler (GH-8606)
Diffstat (limited to 'Include/pyerrors.h')
-rw-r--r--Include/pyerrors.h8
1 files changed, 5 insertions, 3 deletions
diff --git a/Include/pyerrors.h b/Include/pyerrors.h
index 416d750..4e29954 100644
--- a/Include/pyerrors.h
+++ b/Include/pyerrors.h
@@ -97,13 +97,15 @@ PyAPI_FUNC(void) PyErr_SetExcInfo(PyObject *, PyObject *, PyObject *);
(defined(__GNUC_MAJOR__) && \
((__GNUC_MAJOR__ >= 3) || \
(__GNUC_MAJOR__ == 2) && (__GNUC_MINOR__ >= 5)))
-#define _Py_NO_RETURN __attribute__((__noreturn__))
+# define _Py_NO_RETURN __attribute__((__noreturn__))
+#elif defined(_MSC_VER)
+# define _Py_NO_RETURN __declspec(noreturn)
#else
-#define _Py_NO_RETURN
+# define _Py_NO_RETURN
#endif
/* Defined in Python/pylifecycle.c */
-PyAPI_FUNC(void) Py_FatalError(const char *message) _Py_NO_RETURN;
+PyAPI_FUNC(void) _Py_NO_RETURN Py_FatalError(const char *message);
#if defined(Py_DEBUG) || defined(Py_LIMITED_API)
#define _PyErr_OCCURRED() PyErr_Occurred()