From 9a55f5d3196c4279c06a7e7285d04bfa06d720eb Mon Sep 17 00:00:00 2001 From: Jinzhe Zeng Date: Tue, 28 Nov 2023 17:26:47 -0500 Subject: [PATCH] Fix macro issue with multiple arguments Modified the `DPMD_CVT_STR` macro to handle multiple arguments by using `__VA_ARGS__`. This resolves the error caused by commas in the branch name during compilation. This commit (including the above message) is entirely generated by ChatGPT 3.5. Signed-off-by: Jinzhe Zeng --- source/lmp/deepmd_version.h.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/lmp/deepmd_version.h.in b/source/lmp/deepmd_version.h.in index f4c72c8413..4b99bc7c33 100644 --- a/source/lmp/deepmd_version.h.in +++ b/source/lmp/deepmd_version.h.in @@ -5,7 +5,7 @@ #define DEEPMD_ROOT @CMAKE_INSTALL_PREFIX@ #define TensorFlow_INCLUDE_DIRS @TensorFlow_INCLUDE_DIRS@ #define TensorFlow_LIBRARY @TensorFlow_LIBRARY@ -#define DPMD_CVT_STR(x) #x +#define DPMD_CVT_STR(...) #__VA_ARGS__ #define DPMD_CVT_ASSTR(X) DPMD_CVT_STR(X) #define STR_GIT_SUMM DPMD_CVT_ASSTR(GIT_SUMM) #define STR_GIT_HASH DPMD_CVT_ASSTR(GIT_HASH)