File tree Expand file tree Collapse file tree 8 files changed +14
-10
lines changed Expand file tree Collapse file tree 8 files changed +14
-10
lines changed Original file line number Diff line number Diff line change @@ -96,7 +96,7 @@ class AdminClient: public KafkaClient
9696 static std::list<SimpleError> getPerTopicPartitionResults (const rd_kafka_topic_partition_list_t * partitionResults);
9797 static SimpleError combineErrors (const std::list<SimpleError>& errors);
9898
99- #if __cplusplus >= 201703L
99+ #if COMPILER_SUPPORTS_CPP_17
100100 static constexpr int DEFAULT_COMMAND_TIMEOUT_MS = 30000 ;
101101 static constexpr int EVENT_POLLING_INTERVAL_MS = 100 ;
102102#else
Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ namespace Consumer
2828 /* *
2929 * Null RebalanceCallback
3030 */
31- #if __cplusplus >= 201703L
31+ #if COMPILER_SUPPORTS_CPP_17
3232 const inline RebalanceCallback NullRebalanceCallback = RebalanceCallback{};
3333#else
3434 const static RebalanceCallback NullRebalanceCallback = RebalanceCallback{};
@@ -42,7 +42,7 @@ namespace Consumer
4242 /* *
4343 * Null OffsetCommitCallback
4444 */
45- #if __cplusplus >= 201703L
45+ #if COMPILER_SUPPORTS_CPP_17
4646 const inline OffsetCommitCallback NullOffsetCommitCallback = OffsetCommitCallback{};
4747#else
4848 const static OffsetCommitCallback NullOffsetCommitCallback = OffsetCommitCallback{};
Original file line number Diff line number Diff line change @@ -42,7 +42,7 @@ using Headers = std::vector<Header>;
4242/* *
4343 * Null Headers.
4444 */
45- #if __cplusplus >= 201703L || (defined(_MSVC_LANG) && _MSVC_LANG >= 201703L)
45+ #if COMPILER_SUPPORTS_CPP_17
4646const inline Headers NullHeaders = Headers{};
4747#else
4848const static Headers NullHeaders = Headers{};
Original file line number Diff line number Diff line change @@ -200,7 +200,7 @@ class KafkaClient
200200 static const constexpr char * SECURITY_PROTOCOL = " security.protocol" ;
201201 static const constexpr char * SASL_KERBEROS_SERVICE_NAME = " sasl.kerberos.service.name" ;
202202
203- #if __cplusplus >= 201703L
203+ #if COMPILER_SUPPORTS_CPP_17
204204 static constexpr int DEFAULT_METADATA_TIMEOUT_MS = 10000 ;
205205#else
206206 enum { DEFAULT_METADATA_TIMEOUT_MS = 10000 };
Original file line number Diff line number Diff line change @@ -225,7 +225,7 @@ class KafkaConsumer: public KafkaClient
225225 static const constexpr char * ENABLE_AUTO_COMMIT = " enable.auto.commit" ;
226226 static const constexpr char * AUTO_COMMIT_INTERVAL_MS = " auto.commit.interval.ms" ;
227227
228- #if __cplusplus >= 201703L
228+ #if COMPILER_SUPPORTS_CPP_17
229229 static constexpr int DEFAULT_SUBSCRIBE_TIMEOUT_MS = 30000 ;
230230 static constexpr int DEFAULT_UNSUBSCRIBE_TIMEOUT_MS = 10000 ;
231231 static constexpr int DEFAULT_QUERY_TIMEOUT_MS = 10000 ;
Original file line number Diff line number Diff line change @@ -100,7 +100,7 @@ class KafkaProducer: public KafkaClient
100100
101101 static constexpr int CALLBACK_POLLING_INTERVAL_MS = 10 ;
102102
103- #if __cplusplus >= 201703L
103+ #if COMPILER_SUPPORTS_CPP_17
104104 static constexpr int DEFAULT_INIT_TRANSACTIONS_TIMEOUT_MS = 10000 ;
105105 static constexpr int DEFAULT_COMMIT_TRANSACTION_TIMEOUT_MS = 10000 ;
106106#else
Original file line number Diff line number Diff line change 1212
1313#if defined(WIN32) && !defined(NOMINMAX)
1414#define NOMINMAX
15+
16+ #define COMPILER_SUPPORTS_CPP_17 ((__cplusplus >= 201703L ) || (defined (_MSVC_LANG) && _MSVC_LANG >= 201703L ))
17+
1518#endif
19+
Original file line number Diff line number Diff line change 1616
1717
1818// Use `boost::optional` for C++14, which doesn't support `std::optional`
19- #if (__cplusplus >= 201703L) || (defined(_MSVC_LANG) && _MSVC_LANG >= 201703L)
19+ #if COMPILER_SUPPORTS_CPP_17
2020#include < optional>
2121template <class T >
2222using Optional = std::optional<T>;
@@ -84,7 +84,7 @@ using KeySize = std::size_t;
8484/* *
8585 * Null Key.
8686 */
87- #if (__cplusplus >= 201703L) || (defined(_MSVC_LANG) && _MSVC_LANG >= 201703L)
87+ #if COMPILER_SUPPORTS_CPP_17
8888const inline Key NullKey = Key{};
8989#else
9090const static Key NullKey = Key{};
@@ -99,7 +99,7 @@ using ValueSize = std::size_t;
9999/* *
100100 * Null Value.
101101 */
102- #if (__cplusplus >= 201703L) || (defined(_MSVC_LANG) && _MSVC_LANG >= 201703L)
102+ #if COMPILER_SUPPORTS_CPP_17
103103const inline Value NullValue = Value{};
104104#else
105105const static Value NullValue = Value{};
You can’t perform that action at this time.
0 commit comments