diff --git a/paddle/fluid/framework/io/shell.h b/paddle/fluid/framework/io/shell.h index c571302cc000a5de8139237e57f80a2aa6e72fc2..487c2aa95d05a88ce6eca73f2e1f8701655c9536 100644 --- a/paddle/fluid/framework/io/shell.h +++ b/paddle/fluid/framework/io/shell.h @@ -21,6 +21,10 @@ #ifndef NOMINMAX #define NOMINMAX // msvc max/min macro conflict with std::min/max #endif +// Avoid a problem with copysign defined in pyconfig.h on Windows. +#ifdef copysign +#undef copysign +#endif #include #else #include diff --git a/paddle/fluid/pybind/const_value.h b/paddle/fluid/pybind/const_value.h index 2fab3160d1d95af7f6a49c472c2e211c19e67cac..b4c3b861a80811181e6e5952cb0398de33e3752e 100644 --- a/paddle/fluid/pybind/const_value.h +++ b/paddle/fluid/pybind/const_value.h @@ -14,6 +14,10 @@ limitations under the License. */ #pragma once #include +// Avoid a problem with copysign defined in pyconfig.h on Windows. +#ifdef copysign +#undef copysign +#endif #include "paddle/fluid/platform/enforce.h" #include "pybind11/pybind11.h" diff --git a/paddle/fluid/pybind/eager.cc b/paddle/fluid/pybind/eager.cc index d7977a1a6447dcc294c713d983a2e093eb4506f2..2e7fc1d2e4796b8d8452f267cd2752d56a100843 100644 --- a/paddle/fluid/pybind/eager.cc +++ b/paddle/fluid/pybind/eager.cc @@ -12,6 +12,10 @@ limitations under the License. */ #include "paddle/fluid/pybind/eager.h" #include +// Avoid a problem with copysign defined in pyconfig.h on Windows. +#ifdef copysign +#undef copysign +#endif #include #include diff --git a/paddle/fluid/pybind/eager.h b/paddle/fluid/pybind/eager.h index 8a4a42b82a253a47210ef8eacaeff79c62edad52..5b4a637c609a4fdea7d43da8bf9e7894e71249f5 100644 --- a/paddle/fluid/pybind/eager.h +++ b/paddle/fluid/pybind/eager.h @@ -11,6 +11,10 @@ limitations under the License. */ #pragma once #include +// Avoid a problem with copysign defined in pyconfig.h on Windows. +#ifdef copysign +#undef copysign +#endif #include "paddle/fluid/eager/hooks.h" #include "paddle/fluid/eager/pylayer/py_layer_node.h" diff --git a/paddle/fluid/pybind/eager_functions.cc b/paddle/fluid/pybind/eager_functions.cc index e1a050178585f9f0d817938efce60fb9f3116a74..97343b51142053c4248d692bfc57c27a82a2df77 100644 --- a/paddle/fluid/pybind/eager_functions.cc +++ b/paddle/fluid/pybind/eager_functions.cc @@ -16,6 +16,10 @@ typedef SSIZE_T ssize_t; #endif #include +// Avoid a problem with copysign defined in pyconfig.h on Windows. +#ifdef copysign +#undef copysign +#endif #include #include diff --git a/paddle/fluid/pybind/eager_math_op_patch.cc b/paddle/fluid/pybind/eager_math_op_patch.cc index ef8ff4d6c1c75a547df2346427a9c0512882e6e1..fa38a40f8fba1b5c8c8dcc6bf13cbcfcba69b13a 100644 --- a/paddle/fluid/pybind/eager_math_op_patch.cc +++ b/paddle/fluid/pybind/eager_math_op_patch.cc @@ -16,6 +16,10 @@ typedef SSIZE_T ssize_t; #endif #include +// Avoid a problem with copysign defined in pyconfig.h on Windows. +#ifdef copysign +#undef copysign +#endif #include #include diff --git a/paddle/fluid/pybind/eager_method.cc b/paddle/fluid/pybind/eager_method.cc index 34132e199e7326059dddd3970ab571ccc52dd22d..c6051a7f04692ef1561ffd9056039a72a1cad05e 100644 --- a/paddle/fluid/pybind/eager_method.cc +++ b/paddle/fluid/pybind/eager_method.cc @@ -16,6 +16,10 @@ typedef SSIZE_T ssize_t; #endif #include +// Avoid a problem with copysign defined in pyconfig.h on Windows. +#ifdef copysign +#undef copysign +#endif #include #include diff --git a/paddle/fluid/pybind/eager_properties.cc b/paddle/fluid/pybind/eager_properties.cc index c328b1258cdeb7b49b486185fbbf5fb1c54e7163..e8fc670c4910503da84c0b68ab6e515395ed881e 100644 --- a/paddle/fluid/pybind/eager_properties.cc +++ b/paddle/fluid/pybind/eager_properties.cc @@ -10,6 +10,10 @@ See the License for the specific language governing permissions and limitations under the License. */ // disable numpy compile error #include +// Avoid a problem with copysign defined in pyconfig.h on Windows. +#ifdef copysign +#undef copysign +#endif #include #include diff --git a/paddle/fluid/pybind/eager_py_layer.cc b/paddle/fluid/pybind/eager_py_layer.cc index 89bad2bfc924d4cb9ec0b38870f11d132dd724d4..28c1f179bc491947edbf4c97829b68aa616ad146 100644 --- a/paddle/fluid/pybind/eager_py_layer.cc +++ b/paddle/fluid/pybind/eager_py_layer.cc @@ -10,6 +10,10 @@ See the License for the specific language governing permissions and limitations under the License. */ // disable numpy compile error #include +// Avoid a problem with copysign defined in pyconfig.h on Windows. +#ifdef copysign +#undef copysign +#endif #include #include diff --git a/paddle/fluid/pybind/eager_utils.cc b/paddle/fluid/pybind/eager_utils.cc index b3ed1df95709f9a8b86ad0a6f4d056a9fe4e0742..835a27ed995bb5f208557487d8b3a4fb78717b21 100644 --- a/paddle/fluid/pybind/eager_utils.cc +++ b/paddle/fluid/pybind/eager_utils.cc @@ -12,6 +12,10 @@ limitations under the License. */ #include "paddle/fluid/pybind/eager_utils.h" #include +// Avoid a problem with copysign defined in pyconfig.h on Windows. +#ifdef copysign +#undef copysign +#endif #include #include diff --git a/paddle/fluid/pybind/eager_utils.h b/paddle/fluid/pybind/eager_utils.h index 063e14903cf9d832c11d568aa1db55b10ec19b26..3b6cb53dc0f7249fd173327c41a633ee593eea7f 100644 --- a/paddle/fluid/pybind/eager_utils.h +++ b/paddle/fluid/pybind/eager_utils.h @@ -16,6 +16,10 @@ typedef SSIZE_T ssize_t; #endif #include +// Avoid a problem with copysign defined in pyconfig.h on Windows. +#ifdef copysign +#undef copysign +#endif #include "paddle/fluid/eager/hooks.h" #include "paddle/fluid/framework/lod_tensor.h" diff --git a/paddle/fluid/pybind/io.h b/paddle/fluid/pybind/io.h index 10c42582283530e1a3fd76542a1489811b2afe99..4930f06fadce6116586684d86bf865bacb646ff5 100644 --- a/paddle/fluid/pybind/io.h +++ b/paddle/fluid/pybind/io.h @@ -20,6 +20,10 @@ typedef SSIZE_T ssize_t; #endif #include +// Avoid a problem with copysign defined in pyconfig.h on Windows. +#ifdef copysign +#undef copysign +#endif #include "paddle/fluid/pybind/pybind_variant_caster.h" diff --git a/paddle/fluid/pybind/protobuf.h b/paddle/fluid/pybind/protobuf.h index 93064de7d92bdd51873144384a65e619ec22cf4f..c0b2849fd7fa37ae31099f0b600657a25331e714 100644 --- a/paddle/fluid/pybind/protobuf.h +++ b/paddle/fluid/pybind/protobuf.h @@ -19,6 +19,10 @@ limitations under the License. */ typedef SSIZE_T ssize_t; #endif #include +// Avoid a problem with copysign defined in pyconfig.h on Windows. +#ifdef copysign +#undef copysign +#endif #include #include diff --git a/paddle/fluid/pybind/pybind_variant_caster.h b/paddle/fluid/pybind/pybind_variant_caster.h index 2a25990944d141c3be962b6f901219ed0b177cba..4aa4fee280ae639f26d272ac1a8a6c8adc4a1741 100644 --- a/paddle/fluid/pybind/pybind_variant_caster.h +++ b/paddle/fluid/pybind/pybind_variant_caster.h @@ -14,6 +14,10 @@ limitations under the License. */ #pragma once #include +// Avoid a problem with copysign defined in pyconfig.h on Windows. +#ifdef copysign +#undef copysign +#endif #include