summaryrefslogtreecommitdiff
path: root/Include/pystate.h
diff options
context:
space:
mode:
authorZachary Ware <zachary.ware@gmail.com>2015-04-13 16:44:05 -0500
committerZachary Ware <zachary.ware@gmail.com>2015-04-13 16:44:05 -0500
commit8cc6d42d475c53396afaf972f03bee07ee4739bd (patch)
treeff70de39fc13210d28c609aa90ff93d35a9db359 /Include/pystate.h
parent187d9878e860b66d78bfd4c8d538130c72cc724a (diff)
parent81833b5e59153c758f894c851ad1ec4e7942c4b5 (diff)
downloadcpython-8cc6d42d475c53396afaf972f03bee07ee4739bd.tar.gz
Closes #23730: merge with 3.4
Diffstat (limited to 'Include/pystate.h')
-rw-r--r--Include/pystate.h10
1 files changed, 7 insertions, 3 deletions
diff --git a/Include/pystate.h b/Include/pystate.h
index 4992c22684..8539b65013 100644
--- a/Include/pystate.h
+++ b/Include/pystate.h
@@ -174,12 +174,16 @@ PyAPI_FUNC(int) PyThreadState_SetAsyncExc(long, PyObject *);
/* Variable and macro for in-line access to current thread state */
/* Assuming the current thread holds the GIL, this is the
- PyThreadState for the current thread. */
-#ifndef Py_LIMITED_API
+ PyThreadState for the current thread.
+
+ Issue #23644: pyatomic.h is incompatible with C++ (yet). Disable
+ PyThreadState_GET() optimization: declare it as an alias to
+ PyThreadState_Get(), as done for limited API. */
+#if !defined(Py_LIMITED_API) && !defined(__cplusplus)
PyAPI_DATA(_Py_atomic_address) _PyThreadState_Current;
#endif
-#if defined(Py_DEBUG) || defined(Py_LIMITED_API)
+#if defined(Py_DEBUG) || defined(Py_LIMITED_API) || defined(__cplusplus)
#define PyThreadState_GET() PyThreadState_Get()
#else
#define PyThreadState_GET() \