From 3b1a2357ccca4dd01b85df6d37e4e0c9c4e91084 Mon Sep 17 00:00:00 2001 From: John Colvin Date: Wed, 12 Oct 2022 14:24:28 -0400 Subject: [PATCH] fix build (client): Change 'WIN32' macros to '_WIN32' Not sure exactly how this broke, but the WIN32 macro is no longer defined. --- src/lib/api/core/ApiClientInterop.cpp | 4 ++-- src/lib/config/ConfigurationState.cpp | 4 ++-- src/lib/domain_model/common.h | 2 +- src/lib/jetfix/common/OutFIX.cpp | 2 +- src/lib/jetfix/connection/AsyncReader.cpp | 2 +- src/lib/jetfix/connection/IConnection.cpp | 2 +- src/lib/jetfix/gateway/JetFIXGateway.cpp | 2 +- src/lib/logging/LogRec.h | 2 +- src/lib/logging/Sink.cpp | 6 +++--- src/lib/md/MDProducer.cpp | 2 +- src/lib/md/SecurityDB.cpp | 2 +- src/lib/md/SecurityIDRecorder.cpp | 2 +- src/lib/md/SecurityIDRecorder.h | 2 +- src/lib/md/SettlementRecorder.cpp | 2 +- src/lib/md/SyntheticSecurityService.cpp | 2 +- src/lib/md/test/md2_tests.cpp | 8 ++++---- src/lib/md/vendor/OnixsUtils.cpp | 2 +- src/lib/os/os.cpp | 6 +++--- src/lib/quickbus/pubsub/TablePublisher.cpp | 2 +- src/lib/quickbus/pubsub/TablePublisher.h | 2 +- src/lib/tracing/bts_trace.h | 2 +- src/lib/utils/PBUtils.h | 4 ++-- src/lib/utils/Sqlite_utils.cpp | 2 +- src/lib/utils/Sqlite_utils.h | 2 +- src/lib/utils/bts_debugger.h | 2 +- src/lib/utils/datetime.cpp | 2 +- src/lib/utils/thread_manager.cpp | 14 +++++++------- 27 files changed, 43 insertions(+), 43 deletions(-) diff --git a/src/lib/api/core/ApiClientInterop.cpp b/src/lib/api/core/ApiClientInterop.cpp index 36466d961..58aefdc2d 100644 --- a/src/lib/api/core/ApiClientInterop.cpp +++ b/src/lib/api/core/ApiClientInterop.cpp @@ -13,7 +13,7 @@ #include "lib/config/protos/quickbus_cfg.pb.h" #include "lib/config/protos/system.pb.h" -#ifdef WIN32 +#ifdef _WIN32 #include #endif @@ -59,7 +59,7 @@ CAPI Quickbus *api_create_quickbus(const char *qbconfig, long length) { } CAPI void api_destroy_quickbus(Quickbus *qbus) { -#ifndef WIN32 +#ifndef _WIN32 if (qbus != nullptr) { delete qbus; } diff --git a/src/lib/config/ConfigurationState.cpp b/src/lib/config/ConfigurationState.cpp index 62baa41e1..f30d882a8 100644 --- a/src/lib/config/ConfigurationState.cpp +++ b/src/lib/config/ConfigurationState.cpp @@ -29,7 +29,7 @@ #include "lib/config_defaults.h" #include "lib/config_proto_files.h" -#ifdef WIN32 +#ifdef _WIN32 #include #include #else @@ -566,7 +566,7 @@ void ConfigurationState::generate_all_config_proto( &bts_config_dp, config_message, message_desc, ++field_number); } } else { -#ifdef WIN32 +#ifdef _WIN32 // on linux the linker might throw away config protos that // are not used in sparkd. On windows we build a dll so that // should not happen diff --git a/src/lib/domain_model/common.h b/src/lib/domain_model/common.h index fa768fa32..4ab7472fd 100644 --- a/src/lib/domain_model/common.h +++ b/src/lib/domain_model/common.h @@ -1,6 +1,6 @@ #pragma once -#ifndef WIN32 +#ifndef _WIN32 #include #endif #include diff --git a/src/lib/jetfix/common/OutFIX.cpp b/src/lib/jetfix/common/OutFIX.cpp index 8fb37c858..2361696d9 100644 --- a/src/lib/jetfix/common/OutFIX.cpp +++ b/src/lib/jetfix/common/OutFIX.cpp @@ -1,4 +1,4 @@ -#ifndef WIN32 +#ifndef _WIN32 #include "OutFIX.h" namespace bts { diff --git a/src/lib/jetfix/connection/AsyncReader.cpp b/src/lib/jetfix/connection/AsyncReader.cpp index 28fd9cdbb..1de8ef3c3 100644 --- a/src/lib/jetfix/connection/AsyncReader.cpp +++ b/src/lib/jetfix/connection/AsyncReader.cpp @@ -1,4 +1,4 @@ -#ifndef WIN32 +#ifndef _WIN32 #include "AsyncReader.h" #include "IConnection.h" diff --git a/src/lib/jetfix/connection/IConnection.cpp b/src/lib/jetfix/connection/IConnection.cpp index 3b16fd124..ef7d13751 100644 --- a/src/lib/jetfix/connection/IConnection.cpp +++ b/src/lib/jetfix/connection/IConnection.cpp @@ -1,3 +1,3 @@ -#ifndef WIN32 +#ifndef _WIN32 #include "IConnection.h" #endif diff --git a/src/lib/jetfix/gateway/JetFIXGateway.cpp b/src/lib/jetfix/gateway/JetFIXGateway.cpp index df22ecb1b..cd1b16295 100644 --- a/src/lib/jetfix/gateway/JetFIXGateway.cpp +++ b/src/lib/jetfix/gateway/JetFIXGateway.cpp @@ -1,4 +1,4 @@ -#ifndef WIN32 +#ifndef _WIN32 #include "JetFIXGateway.h" namespace bts { diff --git a/src/lib/logging/LogRec.h b/src/lib/logging/LogRec.h index d95ce2460..96dce6c34 100644 --- a/src/lib/logging/LogRec.h +++ b/src/lib/logging/LogRec.h @@ -34,7 +34,7 @@ struct LogRec { }; GCC_DIAG_RESTORE() -#ifndef WIN32 +#ifndef _WIN32 // static_assert(sizeof(LogRec) == 256, "LogRec should be 128 bytes"); #endif diff --git a/src/lib/logging/Sink.cpp b/src/lib/logging/Sink.cpp index 4b8152fbc..d37e7821d 100644 --- a/src/lib/logging/Sink.cpp +++ b/src/lib/logging/Sink.cpp @@ -13,7 +13,7 @@ #include #include -#ifndef WIN32 +#ifndef _WIN32 #include #endif @@ -22,7 +22,7 @@ namespace log { struct InitSysLog { InitSysLog() { -#ifndef WIN32 +#ifndef _WIN32 openlog("spark", 0, LOG_USER); #endif } @@ -72,7 +72,7 @@ Sink console_sink(LoggingConfig const &) { } Sink syslog_sink(LoggingConfig const &cfg) { -#ifdef WIN32 +#ifdef _WIN32 return null_sink(); #else auto f = formatter(cfg); diff --git a/src/lib/md/MDProducer.cpp b/src/lib/md/MDProducer.cpp index 67e28d55f..7e173e981 100644 --- a/src/lib/md/MDProducer.cpp +++ b/src/lib/md/MDProducer.cpp @@ -134,7 +134,7 @@ MDProducer::MDProducer(Platform platform, MDProducerFlags flags) : _mutex(new std::mutex()), _producers(), _id_recorder(), _platform(platform), _flags(flags), _smapper(flags & MDProducerFlags::SecurityMapper) {} -#ifndef WIN32 +#ifndef _WIN32 MDProducer::MDProducer( Platform platform, SecurityIDRecorder recorder, MDProducerFlags flags) : _mutex(new std::mutex()), _producers(), diff --git a/src/lib/md/SecurityDB.cpp b/src/lib/md/SecurityDB.cpp index b2c2e51d3..05183fefc 100644 --- a/src/lib/md/SecurityDB.cpp +++ b/src/lib/md/SecurityDB.cpp @@ -1,6 +1,6 @@ #include "SecurityDB.h" #include "lib/logging/logging.h" -#ifndef WIN32 +#ifndef _WIN32 #include #include diff --git a/src/lib/md/SecurityIDRecorder.cpp b/src/lib/md/SecurityIDRecorder.cpp index e3738809c..cd491ee3d 100644 --- a/src/lib/md/SecurityIDRecorder.cpp +++ b/src/lib/md/SecurityIDRecorder.cpp @@ -1,5 +1,5 @@ #include "lib/domain_model/Security.h" -#ifndef WIN32 +#ifndef _WIN32 #include "SecurityIDRecorder.h" #include "lib/config/config.h" diff --git a/src/lib/md/SecurityIDRecorder.h b/src/lib/md/SecurityIDRecorder.h index 6ac662157..58ac0b2e4 100644 --- a/src/lib/md/SecurityIDRecorder.h +++ b/src/lib/md/SecurityIDRecorder.h @@ -1,5 +1,5 @@ #pragma once -#ifndef WIN32 +#ifndef _WIN32 #include "MDProducerHandle.h" #include "common.h" diff --git a/src/lib/md/SettlementRecorder.cpp b/src/lib/md/SettlementRecorder.cpp index de61e98fa..49edc7c01 100644 --- a/src/lib/md/SettlementRecorder.cpp +++ b/src/lib/md/SettlementRecorder.cpp @@ -1,4 +1,4 @@ -#ifndef WIN32 +#ifndef _WIN32 #include "SettlementRecorder.h" #include "lib/config/config.h" #include "lib/config/protos/system.pb.h" diff --git a/src/lib/md/SyntheticSecurityService.cpp b/src/lib/md/SyntheticSecurityService.cpp index 5781a1ef4..0ebebdd1c 100644 --- a/src/lib/md/SyntheticSecurityService.cpp +++ b/src/lib/md/SyntheticSecurityService.cpp @@ -1,4 +1,4 @@ -#ifndef WIN32 +#ifndef _WIN32 #include "SyntheticSecurityService.h" #include "lib/api/public/ServiceContext.h" diff --git a/src/lib/md/test/md2_tests.cpp b/src/lib/md/test/md2_tests.cpp index 22e050876..ef44d0afb 100644 --- a/src/lib/md/test/md2_tests.cpp +++ b/src/lib/md/test/md2_tests.cpp @@ -165,7 +165,7 @@ class Co2Tests { "}"); } -#ifndef WIN32 +#ifndef _WIN32 void test_security_id_recorder(const std::string &db_name) { // Verify callbacks happen after work complete auto db1 = sqlite::open_db(db_name.c_str()); @@ -1037,7 +1037,7 @@ class Co2Tests { REQUIRE(security_count == 5); } -#ifndef WIN32 +#ifndef _WIN32 void test_settlement_recorder() { using namespace datetime; security_key k1 = 401, k2 = 402; @@ -1136,7 +1136,7 @@ TEST_CASE("CO2Tests", "[md]") { co2_tests->setup(); -#ifndef WIN32 +#ifndef _WIN32 SECTION("test_security_id_recorder") { co2_tests->test_security_id_recorder(":memory:"); co2_tests->test_security_id_recorder("file::memory:?cache=shared"); @@ -1175,7 +1175,7 @@ TEST_CASE("CO2Tests", "[md]") { SECTION("test_retry_unresolved_spread") { co2_tests->test_retry_unresolved_spread(); } -#ifndef WIN32 +#ifndef _WIN32 SECTION("test_settlement_recorder") { co2_tests->test_settlement_recorder(); } diff --git a/src/lib/md/vendor/OnixsUtils.cpp b/src/lib/md/vendor/OnixsUtils.cpp index 04d90d38a..2d98a3232 100644 --- a/src/lib/md/vendor/OnixsUtils.cpp +++ b/src/lib/md/vendor/OnixsUtils.cpp @@ -1,4 +1,4 @@ -#ifndef WIN32 +#ifndef _WIN32 #include "OnixsUtils.h" #include "lib/config/config.h" #include "lib/config/protos/market_data.pb.h" diff --git a/src/lib/os/os.cpp b/src/lib/os/os.cpp index 7b41eebec..8e96df036 100644 --- a/src/lib/os/os.cpp +++ b/src/lib/os/os.cpp @@ -51,7 +51,7 @@ #include -#ifdef WIN32 +#ifdef _WIN32 #pragma comment(lib, "wbemuuid.lib") #endif @@ -616,7 +616,7 @@ std::string get_qualifier() { } void enable_core_dumps() { -#ifndef WIN32 +#ifndef _WIN32 struct rlimit core_limits; core_limits.rlim_cur = core_limits.rlim_max = RLIM_INFINITY; setrlimit(RLIMIT_CORE, &core_limits); @@ -629,7 +629,7 @@ int get_random_port() { } int num_cores() { -#ifdef WIN32 +#ifdef _WIN32 SYSTEM_INFO sysinfo; GetSystemInfo(&sysinfo); return sysinfo.dwNumberOfProcessors; diff --git a/src/lib/quickbus/pubsub/TablePublisher.cpp b/src/lib/quickbus/pubsub/TablePublisher.cpp index b53cb1040..0818d94f0 100644 --- a/src/lib/quickbus/pubsub/TablePublisher.cpp +++ b/src/lib/quickbus/pubsub/TablePublisher.cpp @@ -95,7 +95,7 @@ void TablePublisher::disconnect() { } } -#ifndef WIN32 +#ifndef _WIN32 void TablePublisher::publish(std::initializer_list const &changes) { publish(std::vector(changes)); } diff --git a/src/lib/quickbus/pubsub/TablePublisher.h b/src/lib/quickbus/pubsub/TablePublisher.h index 5bff8eed1..4eeb38f6f 100644 --- a/src/lib/quickbus/pubsub/TablePublisher.h +++ b/src/lib/quickbus/pubsub/TablePublisher.h @@ -29,7 +29,7 @@ class BTS_EXPORT TablePublisher { TablePublisher &operator=(TablePublisher &&src); bool is_null() const; -#ifndef WIN32 +#ifndef _WIN32 void publish(std::initializer_list const &changes); #endif diff --git a/src/lib/tracing/bts_trace.h b/src/lib/tracing/bts_trace.h index d4d198166..099cd0bcc 100644 --- a/src/lib/tracing/bts_trace.h +++ b/src/lib/tracing/bts_trace.h @@ -1,4 +1,4 @@ -#ifndef WIN32 +#ifndef _WIN32 #ifndef NO_CPP0X #ifndef __clang__ #pragma GCC diagnostic push diff --git a/src/lib/utils/PBUtils.h b/src/lib/utils/PBUtils.h index 9ec1101b4..9d2a67f28 100644 --- a/src/lib/utils/PBUtils.h +++ b/src/lib/utils/PBUtils.h @@ -4,7 +4,7 @@ #include #include -#ifndef WIN32 +#ifndef _WIN32 #include #endif @@ -37,7 +37,7 @@ template T from_string(const std::string &str) { return result; } -#ifndef WIN32 +#ifndef _WIN32 inline google::protobuf::Timestamp pb_now() { ::google::protobuf::Timestamp result; struct timeval tv; diff --git a/src/lib/utils/Sqlite_utils.cpp b/src/lib/utils/Sqlite_utils.cpp index af78045f4..f63421023 100644 --- a/src/lib/utils/Sqlite_utils.cpp +++ b/src/lib/utils/Sqlite_utils.cpp @@ -1,4 +1,4 @@ -#ifndef WIN32 +#ifndef _WIN32 #include "Sqlite_utils.h" #include "bts_assert.h" #include diff --git a/src/lib/utils/Sqlite_utils.h b/src/lib/utils/Sqlite_utils.h index 7db0ef4af..5a9f2ad5b 100644 --- a/src/lib/utils/Sqlite_utils.h +++ b/src/lib/utils/Sqlite_utils.h @@ -1,5 +1,5 @@ #pragma once -#ifndef WIN32 +#ifndef _WIN32 #include "lib/utils/bts_assert.h" #include #include diff --git a/src/lib/utils/bts_debugger.h b/src/lib/utils/bts_debugger.h index b300a8845..e4e3ba342 100644 --- a/src/lib/utils/bts_debugger.h +++ b/src/lib/utils/bts_debugger.h @@ -6,7 +6,7 @@ #include inline bool is_debugger_present() { -#ifdef WIN32 +#ifdef _WIN32 return IsDebuggerPresent(); #else char buf[1024]; diff --git a/src/lib/utils/datetime.cpp b/src/lib/utils/datetime.cpp index 3951b4a23..dfc553d78 100644 --- a/src/lib/utils/datetime.cpp +++ b/src/lib/utils/datetime.cpp @@ -231,7 +231,7 @@ void FIX_timestamp(PTime const &t, std::string *out) { int frac_ms = t.time_of_day().total_milliseconds() - whole_ms; out->resize(sizeof("20121204-14:44:02.000")); -#ifdef WIN32 +#ifdef _WIN32 _snprintf( &(*out)[0], out->size(), "%04d%02d%02d-%02d:%02d:%02d.%03d", (int)t.date().year(), t.date().month().as_number(), diff --git a/src/lib/utils/thread_manager.cpp b/src/lib/utils/thread_manager.cpp index d0e90acba..c053dfac8 100644 --- a/src/lib/utils/thread_manager.cpp +++ b/src/lib/utils/thread_manager.cpp @@ -7,7 +7,7 @@ #include #include -#ifndef WIN32 +#ifndef _WIN32 #include #endif @@ -26,7 +26,7 @@ config::ThreadGroupCfg get_thread_cfg(std::string const &name) { std::vector get_affinity(std::string const &name) { std::vector result; -#ifndef WIN32 +#ifndef _WIN32 auto cfg = get_thread_cfg(name); if (cfg.exclude()) { auto total_cpus = sysconf(_SC_NPROCESSORS_ONLN); @@ -42,7 +42,7 @@ std::vector get_affinity(std::string const &name) { return result; } -#ifndef WIN32 +#ifndef _WIN32 void configure_thread( std::string const &name, config::ThreadGroupCfg const &cfg, pthread_t t) { if (cfg.core().size()) { @@ -72,7 +72,7 @@ void configure_thread( #endif void configure_current_thread(std::string const &name) { -#ifndef WIN32 +#ifndef _WIN32 configure_thread(name, get_thread_cfg(name), pthread_self()); #endif os::set_thread_name(name); @@ -80,7 +80,7 @@ void configure_current_thread(std::string const &name) { void configure_current_thread( std::string const &name, config::ThreadGroupCfg const &cfg) { -#ifndef WIN32 +#ifndef _WIN32 configure_thread(name, cfg, pthread_self()); #endif os::set_thread_name(name); @@ -93,7 +93,7 @@ std::thread make_thread_from_function( c(); }); -#ifndef WIN32 +#ifndef _WIN32 configure_thread(name, get_thread_cfg(name), result.native_handle()); #endif return result; @@ -107,7 +107,7 @@ std::thread make_thread_from_function( os::set_thread_name(name); c(); }); -#ifndef WIN32 +#ifndef _WIN32 configure_thread(name, cfg, result.native_handle()); #endif return result;