take linkage def outside of WITH_THREAD conditional (closes #14569)
diff --git a/Python/pystate.c b/Python/pystate.c
index 3b4c6a2..9fc4c12 100644
--- a/Python/pystate.c
+++ b/Python/pystate.c
@@ -22,6 +22,9 @@
 #endif
 #endif
 
+#ifdef __cplusplus
+extern "C" {
+#endif
 
 #ifdef WITH_THREAD
 #include "pythread.h"
@@ -30,10 +33,6 @@
 #define HEAD_LOCK() PyThread_acquire_lock(head_mutex, WAIT_LOCK)
 #define HEAD_UNLOCK() PyThread_release_lock(head_mutex)
 
-#ifdef __cplusplus
-extern "C" {
-#endif
-
 /* The single PyInterpreterState used by this process'
    GILState implementation
 */