Commit e6f508dc14a1cd1daf1dbb37b27b6f6464346b5f
1 parent
27cb792c
Fix for redefinition warning
Showing
1 changed file
with
6 additions
and
0 deletions
include/CLI/Optional.hpp
| @@ -12,18 +12,24 @@ | @@ -12,18 +12,24 @@ | ||
| 12 | #if defined(CLI11_CPP17) && __has_include(<optional>) | 12 | #if defined(CLI11_CPP17) && __has_include(<optional>) |
| 13 | #include <optional> | 13 | #include <optional> |
| 14 | #ifdef __cpp_lib_optional | 14 | #ifdef __cpp_lib_optional |
| 15 | +#ifndef CLI11_STD_OPTIONAL | ||
| 15 | #define CLI11_STD_OPTIONAL | 16 | #define CLI11_STD_OPTIONAL |
| 16 | #endif | 17 | #endif |
| 17 | #endif | 18 | #endif |
| 19 | +#endif | ||
| 18 | #if defined(CLI11_CPP14) && __has_include(<experimental/optional>) | 20 | #if defined(CLI11_CPP14) && __has_include(<experimental/optional>) |
| 19 | #include <experimental/optional> | 21 | #include <experimental/optional> |
| 22 | +#ifndef CLI11_EXPERIMENTAL_OPTIONAL | ||
| 20 | #define CLI11_EXPERIMENTAL_OPTIONAL | 23 | #define CLI11_EXPERIMENTAL_OPTIONAL |
| 21 | #endif | 24 | #endif |
| 25 | +#endif | ||
| 22 | #if __has_include(<boost/optional.hpp>) | 26 | #if __has_include(<boost/optional.hpp>) |
| 23 | #include <boost/optional.hpp> | 27 | #include <boost/optional.hpp> |
| 28 | +#ifndef CLI11_BOOST_OPTIONAL | ||
| 24 | #define CLI11_BOOST_OPTIONAL | 29 | #define CLI11_BOOST_OPTIONAL |
| 25 | #endif | 30 | #endif |
| 26 | #endif | 31 | #endif |
| 32 | +#endif | ||
| 27 | // [CLI11:verbatim] | 33 | // [CLI11:verbatim] |
| 28 | 34 | ||
| 29 | namespace CLI { | 35 | namespace CLI { |