Skip to content

Commit 8d0abfb

Browse files
DinoVmeta-codesync[bot]
authored andcommitted
Workaround mimalloc __THROW decl in cpp files
Summary: This fixes an issue with the 3.15 build. When we include the mimalloc header in our cinderx/python.h we end up getting lots of build errors in C++ files. These are from the presence of `__THROW` being defined which mimalloc is checking for and using for `mimalloc_throw`. So we just undefine it away as we don't really care about this. Reviewed By: jbower-fb Differential Revision: D88178338 fbshipit-source-id: 2612373dc341599500986d491c58f39e1e6a5715
1 parent 07cd422 commit 8d0abfb

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

cinderx/python.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@
1010
#include <Python.h>
1111

1212
#if PY_VERSION_HEX >= 0x030E0000
13+
#ifdef __THROW
14+
// mi_decl_throw is defined to be __THROW and breaks in C++ files.
15+
#undef __THROW
16+
#define __THROW
17+
#endif
1318
#include "internal/pycore_mimalloc.h"
1419
#endif
1520

0 commit comments

Comments
 (0)