Skip to content

Commit b4e5d58

Browse files
committed
undo #define copysign in pyconfig.h
1 parent 1376eb0 commit b4e5d58

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

include/pybind11/detail/common.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,9 @@
113113
#include <frameobject.h>
114114
#include <pythread.h>
115115

116+
/* Python #defines overrides on all sorts of core functions, which
117+
tends to weak havok in C++ codebases that expect these to work
118+
like regular functions (potentially with several overloads) */
116119
#if defined(isalnum)
117120
# undef isalnum
118121
# undef isalpha
@@ -123,6 +126,10 @@
123126
# undef toupper
124127
#endif
125128

129+
#if defined(copysign)
130+
# undef copysign
131+
#endif
132+
126133
#if defined(_MSC_VER)
127134
# if defined(PYBIND11_DEBUG_MARKER)
128135
# define _DEBUG

0 commit comments

Comments
 (0)