From ec692b17fd94fbb497428ffd52d547f8597de5f4 Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Wed, 16 Oct 2024 15:26:25 -0400 Subject: [PATCH] Redo how the #define works --- Python/ceval.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/Python/ceval.c b/Python/ceval.c index ee49cea7f81bca..98d95b28488fd0 100644 --- a/Python/ceval.c +++ b/Python/ceval.c @@ -767,13 +767,14 @@ _PyObjectArray_Free(PyObject **array, PyObject **scratch) this function only. If this is fixed upstream, we should gate this on the version of MSVC. */ -#define DO_NOT_OPTIMIZE_INTERP_LOOP ( \ - (defined(_MSC_VER) && \ +#if (defined(_MSC_VER) && \ defined(_Py_USING_PGO) && \ (defined(_Py_JIT) || \ - defined(Py_GIL_DISABLED)))) + defined(Py_GIL_DISABLED))) +#define DO_NOT_OPTIMIZE_INTERP_LOOP +#endif -#if DO_NOT_OPTIMIZE_INTERP_LOOP +#ifdef DO_NOT_OPTIMIZE_INTERP_LOOP # pragma optimize("t", off) /* This setting is reversed below following _PyEval_EvalFrameDefault */ #endif @@ -1153,7 +1154,7 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, _PyInterpreterFrame *frame, int } -#if DO_NOT_OPTIMIZE_INTERP_LOOP +#ifdef DO_NOT_OPTIMIZE_INTERP_LOOP # pragma optimize("", on) #endif