未验证 提交 0e439210 编写于 作者: H HongyuJia 提交者: GitHub

[Fix Compile Error] Fix copysign compile error on Windows (#50387)

* fix copysign compile error on Windows

* fix more files' macro
上级 d5b55112
......@@ -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 <windows.h>
#else
#include <sys/syscall.h>
......
......@@ -14,6 +14,10 @@ limitations under the License. */
#pragma once
#include <Python.h>
// 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"
......
......@@ -12,6 +12,10 @@ limitations under the License. */
#include "paddle/fluid/pybind/eager.h"
#include <Python.h>
// Avoid a problem with copysign defined in pyconfig.h on Windows.
#ifdef copysign
#undef copysign
#endif
#include <string>
#include <vector>
......
......@@ -11,6 +11,10 @@ limitations under the License. */
#pragma once
#include <Python.h>
// 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"
......
......@@ -16,6 +16,10 @@ typedef SSIZE_T ssize_t;
#endif
#include <Python.h>
// Avoid a problem with copysign defined in pyconfig.h on Windows.
#ifdef copysign
#undef copysign
#endif
#include <string>
#include <vector>
......
......@@ -16,6 +16,10 @@ typedef SSIZE_T ssize_t;
#endif
#include <Python.h>
// Avoid a problem with copysign defined in pyconfig.h on Windows.
#ifdef copysign
#undef copysign
#endif
#include <string>
#include <unordered_map>
......
......@@ -16,6 +16,10 @@ typedef SSIZE_T ssize_t;
#endif
#include <Python.h>
// Avoid a problem with copysign defined in pyconfig.h on Windows.
#ifdef copysign
#undef copysign
#endif
#include <string>
#include <unordered_map>
......
......@@ -10,6 +10,10 @@ See the License for the specific language governing permissions and
limitations under the License. */
// disable numpy compile error
#include <Python.h>
// Avoid a problem with copysign defined in pyconfig.h on Windows.
#ifdef copysign
#undef copysign
#endif
#include <string>
#include <vector>
......
......@@ -10,6 +10,10 @@ See the License for the specific language governing permissions and
limitations under the License. */
// disable numpy compile error
#include <Python.h>
// Avoid a problem with copysign defined in pyconfig.h on Windows.
#ifdef copysign
#undef copysign
#endif
#include <set>
#include <string>
......
......@@ -12,6 +12,10 @@ limitations under the License. */
#include "paddle/fluid/pybind/eager_utils.h"
#include <Python.h>
// Avoid a problem with copysign defined in pyconfig.h on Windows.
#ifdef copysign
#undef copysign
#endif
#include <string>
#include <vector>
......
......@@ -16,6 +16,10 @@ typedef SSIZE_T ssize_t;
#endif
#include <Python.h>
// 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"
......
......@@ -20,6 +20,10 @@ typedef SSIZE_T ssize_t;
#endif
#include <Python.h>
// Avoid a problem with copysign defined in pyconfig.h on Windows.
#ifdef copysign
#undef copysign
#endif
#include "paddle/fluid/pybind/pybind_variant_caster.h"
......
......@@ -19,6 +19,10 @@ limitations under the License. */
typedef SSIZE_T ssize_t;
#endif
#include <Python.h>
// Avoid a problem with copysign defined in pyconfig.h on Windows.
#ifdef copysign
#undef copysign
#endif
#include <fstream>
#include <vector>
......
......@@ -14,6 +14,10 @@ limitations under the License. */
#pragma once
#include <Python.h>
// Avoid a problem with copysign defined in pyconfig.h on Windows.
#ifdef copysign
#undef copysign
#endif
#include <vector>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册