Skip to content

Commit 5dbbdf4

Browse files
committed
Use #if and #error
1 parent a537cc3 commit 5dbbdf4

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Objects/typeobject.c

+3-2
Original file line numberDiff line numberDiff line change
@@ -1214,8 +1214,9 @@ _PyType_GetVersionForCurrentState(PyTypeObject *tp)
12141214

12151215

12161216
#define MAX_VERSIONS_PER_CLASS 1000
1217-
static_assert(MAX_VERSIONS_PER_CLASS < _Py_ATTR_CACHE_UNUSED,
1218-
"_Py_ATTR_CACHE_UNUSED must be bigger than max");
1217+
#if _Py_ATTR_CACHE_UNUSED < MAX_VERSIONS_PER_CLASS
1218+
#error "_Py_ATTR_CACHE_UNUSED must be bigger than max"
1219+
#endif
12191220

12201221
static int
12211222
assign_version_tag(PyInterpreterState *interp, PyTypeObject *type)

0 commit comments

Comments
 (0)