Skip to content

Commit a4da877

Browse files
committed
fix: add preprocessor macro to MSVC
1 parent 79ebafb commit a4da877

File tree

8 files changed

+8
-8
lines changed

8 files changed

+8
-8
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ endif()
6565
target_link_libraries(${PROJECT_NAME} PRIVATE ${CPPLM_LINK_LIBRARIES})
6666

6767
if(MSVC)
68-
target_compile_options(${PROJECT_NAME} PRIVATE /W4 /WX)
68+
target_compile_options(${PROJECT_NAME} PRIVATE /W4 /WX /Zc:preprocessor)
6969
else()
7070
target_compile_options(${PROJECT_NAME} PRIVATE -Wextra -Wshadow -Wconversion -Wpedantic -Werror)
7171
endif()

test/cross_call_master/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ add_library(${PROJECT_NAME} SHARED ${PLUGIN_SOURCES})
3636
target_include_directories(${PROJECT_NAME} PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/external/plugify/include")
3737

3838
if(MSVC)
39-
target_compile_options(${PROJECT_NAME} PRIVATE /W4 /WX)
39+
target_compile_options(${PROJECT_NAME} PRIVATE /W4 /WX /Zc:preprocessor)
4040
else()
4141
target_compile_options(${PROJECT_NAME} PRIVATE -Wextra -Wshadow -Wconversion -Wpedantic -Werror)
4242
endif()

test/cross_call_master/external/plugify/include/plg/config.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ namespace plg {
4343
}
4444
}
4545
} // namespace plg
46-
# define PLUGIFY_THROW(str, exp, ...) ::plg::throw_exception<exp>(str, ##__VA_ARGS__);
46+
# define PLUGIFY_THROW(str, exp, ...) ::plg::throw_exception<exp>(str __VA_OPT__(,) __VA_ARGS__);
4747
#else
4848
# include <cstdlib>
4949
# include <cstdio>

test/cross_call_worker/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ add_library(${PROJECT_NAME} SHARED ${PLUGIN_SOURCES})
3636
target_include_directories(${PROJECT_NAME} PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/external/plugify/include")
3737

3838
if(MSVC)
39-
target_compile_options(${PROJECT_NAME} PRIVATE /W4 /WX)
39+
target_compile_options(${PROJECT_NAME} PRIVATE /W4 /WX /Zc:preprocessor)
4040
else()
4141
target_compile_options(${PROJECT_NAME} PRIVATE -Wextra -Wshadow -Wconversion -Wpedantic -Werror)
4242
endif()

test/cross_call_worker/external/plugify/include/plg/config.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ namespace plg {
4343
}
4444
}
4545
} // namespace plg
46-
# define PLUGIFY_THROW(str, exp, ...) ::plg::throw_exception<exp>(str, ##__VA_ARGS__);
46+
# define PLUGIFY_THROW(str, exp, ...) ::plg::throw_exception<exp>(str __VA_OPT__(,) __VA_ARGS__);
4747
#else
4848
# include <cstdlib>
4949
# include <cstdio>

test/example_plugin/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ add_library(${PROJECT_NAME} SHARED ${PLUGIN_SOURCES})
3636
target_include_directories(${PROJECT_NAME} PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/external/plugify/include")
3737

3838
if(MSVC)
39-
target_compile_options(${PROJECT_NAME} PRIVATE /W4 /WX)
39+
target_compile_options(${PROJECT_NAME} PRIVATE /W4 /WX /Zc:preprocessor)
4040
else()
4141
target_compile_options(${PROJECT_NAME} PRIVATE -Wextra -Wshadow -Wconversion -Wpedantic -Werror)
4242
endif()

test/example_plugin/external/plugify/include/plg/config.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ namespace plg {
4343
}
4444
}
4545
} // namespace plg
46-
# define PLUGIFY_THROW(str, exp, ...) ::plg::throw_exception<exp>(str, ##__VA_ARGS__);
46+
# define PLUGIFY_THROW(str, exp, ...) ::plg::throw_exception<exp>(str __VA_OPT__(,) __VA_ARGS__);
4747
#else
4848
# include <cstdlib>
4949
# include <cstdio>

0 commit comments

Comments
 (0)