From 1f7f7193bbff55dbb5acd0e16e3c7b33f3e31653 Mon Sep 17 00:00:00 2001 From: Sing_chan <51314274+betterpig@users.noreply.github.com> Date: Fri, 15 Jul 2022 12:20:30 +0800 Subject: [PATCH] fix python3.10 compile bug on window (#44330) --- paddle/fluid/pybind/op_function_generator.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/paddle/fluid/pybind/op_function_generator.cc b/paddle/fluid/pybind/op_function_generator.cc index 7eeadac7ce..f659a671c3 100644 --- a/paddle/fluid/pybind/op_function_generator.cc +++ b/paddle/fluid/pybind/op_function_generator.cc @@ -553,6 +553,11 @@ int main(int argc, char* argv[]) { std::ofstream out(path + "op_function" + std::to_string(i + 1) + ".cc.tmp", std::ios::out); + out << "#if defined(_MSC_VER)\n" + << "#include \n" + << "typedef SSIZE_T ssize_t;\n" + << "#endif\n"; + for (auto& header : headers) { out << "#include " + header + "\n"; } -- GitLab