1 Star 0 Fork 78

xiexing/ceph

forked from src-openEuler/ceph 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0004-cmake-add-support-python-3.10.patch 2.42 KB
一键复制 编辑 原始数据 按行查看 历史
wangzengliang 提交于 2022-04-08 11:37 . cmake: add support python 3.10
From a13d33c47c0e713429f7cfbd6106a497838f6396 Mon Sep 17 00:00:00 2001
From: wangzengliang <wangzengliang1@huawei.com>
Date: Fri, 8 Apr 2022 11:35:38 +0800
Subject: [PATCH] cmake: add support python 3.10
---
cmake/modules/BuildBoost.cmake | 2 +-
cmake/modules/FindPython/Support.cmake | 2 +-
src/boost/libs/python/src/exec.cpp | 4 ++--
3 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/cmake/modules/BuildBoost.cmake b/cmake/modules/BuildBoost.cmake
index 468ae419c..320c2dcd5 100644
--- a/cmake/modules/BuildBoost.cmake
+++ b/cmake/modules/BuildBoost.cmake
@@ -70,7 +70,7 @@ function(do_build_boost version)
if(c MATCHES "^python([0-9])\$")
set(with_python_version "${CMAKE_MATCH_1}")
list(APPEND boost_with_libs "python")
- elseif(c MATCHES "^python([0-9])\\.?([0-9])\$")
+ elseif(c MATCHES "^python([0-9])\\.?([0-9]+)\$")
set(with_python_version "${CMAKE_MATCH_1}.${CMAKE_MATCH_2}")
list(APPEND boost_with_libs "python")
else()
diff --git a/cmake/modules/FindPython/Support.cmake b/cmake/modules/FindPython/Support.cmake
index c05bbe330..fb362bfe2 100644
--- a/cmake/modules/FindPython/Support.cmake
+++ b/cmake/modules/FindPython/Support.cmake
@@ -17,7 +17,7 @@ if (NOT DEFINED _${_PYTHON_PREFIX}_REQUIRED_VERSION_MAJOR)
message (FATAL_ERROR "FindPython: INTERNAL ERROR")
endif()
if (_${_PYTHON_PREFIX}_REQUIRED_VERSION_MAJOR EQUAL 3)
- set(_${_PYTHON_PREFIX}_VERSIONS 3.9 3.8 3.7 3.6 3.5 3.4 3.3 3.2 3.1 3.0)
+ set(_${_PYTHON_PREFIX}_VERSIONS 3.10 3.9 3.8 3.7 3.6 3.5 3.4 3.3 3.2 3.1 3.0)
elseif (_${_PYTHON_PREFIX}_REQUIRED_VERSION_MAJOR EQUAL 2)
set(_${_PYTHON_PREFIX}_VERSIONS 2.7 2.6 2.5 2.4 2.3 2.2 2.1 2.0)
else()
diff --git a/src/boost/libs/python/src/exec.cpp b/src/boost/libs/python/src/exec.cpp
index 171c6f418..caa7d0864 100644
--- a/src/boost/libs/python/src/exec.cpp
+++ b/src/boost/libs/python/src/exec.cpp
@@ -106,10 +106,10 @@ object BOOST_PYTHON_DECL exec_file(char const *filename, object global, object l
char *f = const_cast<char *>(filename);
// Let python open the file to avoid potential binary incompatibilities.
#if PY_VERSION_HEX >= 0x03040000
- FILE *fs = _Py_fopen(f, "r");
+ FILE *fs = fopen(f, "r");
#elif PY_VERSION_HEX >= 0x03000000
PyObject *fo = Py_BuildValue("s", f);
- FILE *fs = _Py_fopen(fo, "r");
+ FILE *fs = fopen(fo, "r");
Py_DECREF(fo);
#else
PyObject *pyfile = PyFile_FromString(f, const_cast<char*>("r"));
--
2.30.0
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/xiexing01/ceph.git
git@gitee.com:xiexing01/ceph.git
xiexing01
ceph
ceph
master

搜索帮助