From 5fdb81a453e23229191ec5d2ae764626f22352fa Mon Sep 17 00:00:00 2001 From: Jinzhe Zeng Date: Tue, 28 Feb 2023 19:12:14 -0500 Subject: [PATCH 1/2] fix: add declaration of strlen to deepmd.hpp MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix `error: ‘strlen’ was not declared in this scope` Signed-off-by: Jinzhe Zeng --- source/api_c/include/deepmd.hpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/source/api_c/include/deepmd.hpp b/source/api_c/include/deepmd.hpp index 3bb81078c1..4319c2d690 100644 --- a/source/api_c/include/deepmd.hpp +++ b/source/api_c/include/deepmd.hpp @@ -11,6 +11,7 @@ This header-only library provides a C++ 11 interface to the DeePMD-kit C API. #include #include #include +#include #include #include "c_api.h" @@ -34,7 +35,7 @@ struct deepmd_exception : public std::runtime_error { */ #define DP_CHECK_OK(check_func, dp) \ const char *err_msg = check_func(dp); \ - if (strlen(err_msg)) \ + if (std::strlen(err_msg)) \ throw deepmd::hpp::deepmd_exception(std::string(err_msg)); template From f062e4f601c970667d4cd251d6a94188a314b675 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 1 Mar 2023 00:12:54 +0000 Subject: [PATCH 2/2] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- source/api_c/include/deepmd.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/api_c/include/deepmd.hpp b/source/api_c/include/deepmd.hpp index 4319c2d690..1867ac34ad 100644 --- a/source/api_c/include/deepmd.hpp +++ b/source/api_c/include/deepmd.hpp @@ -8,10 +8,10 @@ This header-only library provides a C++ 11 interface to the DeePMD-kit C API. #include #include +#include #include #include #include -#include #include #include "c_api.h" @@ -35,7 +35,7 @@ struct deepmd_exception : public std::runtime_error { */ #define DP_CHECK_OK(check_func, dp) \ const char *err_msg = check_func(dp); \ - if (std::strlen(err_msg)) \ + if (std::strlen(err_msg)) \ throw deepmd::hpp::deepmd_exception(std::string(err_msg)); template