Skip to content

Commit

Permalink
Fix macro issue with multiple arguments (#3016)
Browse files Browse the repository at this point in the history
Modified the `DPMD_CVT_STR` macro to handle multiple arguments by using
`__VA_ARGS__`. This resolves #2952, 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 <[email protected]>
  • Loading branch information
njzjz authored Nov 29, 2023
1 parent b4bb3a9 commit 12baf12
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion source/lmp/deepmd_version.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 12baf12

Please sign in to comment.