From e0fb03b7230b039fd8e93bffd0765f9a757a5ece Mon Sep 17 00:00:00 2001 From: scoder Date: Fri, 20 Oct 2017 16:26:55 +0200 Subject: [PATCH] bpo-25658: make Py_tss_NEEDS_INIT usable in non-static initialisers Without the cast, the compound literal is not accepted as a regular RHS value of an assignment. --- Include/pythread.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Include/pythread.h b/Include/pythread.h index d6674685f289ff..e1bd4f96ca28cc 100644 --- a/Include/pythread.h +++ b/Include/pythread.h @@ -127,7 +127,7 @@ struct _Py_tss_t { #undef NATIVE_TSS_KEY_T /* When static allocation, you must initialize with Py_tss_NEEDS_INIT. */ -#define Py_tss_NEEDS_INIT {0} +#define Py_tss_NEEDS_INIT ((Py_tss_t) {0}) #endif /* !Py_LIMITED_API */ PyAPI_FUNC(Py_tss_t *) PyThread_tss_alloc(void);