From 89a245a05be6c088e18557ca17a8476a31dcd07c Mon Sep 17 00:00:00 2001 From: Emiel Bruijntjes Date: Mon, 24 Apr 2023 11:04:09 +0200 Subject: [PATCH] fix compiling on win32 --- src/connectionstartframe.h | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/src/connectionstartframe.h b/src/connectionstartframe.h index a7658e9..42a23a6 100644 --- a/src/connectionstartframe.h +++ b/src/connectionstartframe.h @@ -11,8 +11,10 @@ /** * Dependencies */ +#ifndef _WIN32 #include "programname.h" #include "platformname.h" +#endif /** * Cause we want to print out version string that is passed to compiled with -D @@ -218,13 +220,21 @@ public: capabilities["consumer_cancel_notify"] = true; // fill the peer properties - if (!properties.contains("product")) properties["product"] = ProgramName(); if (!properties.contains("version")) properties["version"] = "AMQP-CPP " VERSION_NAME; - if (!properties.contains("platform")) properties["platform"] = PlatformName(); if (!properties.contains("copyright")) properties["copyright"] = "Copernica AMQP-CPP library :: Copyright 2015-2023 Copernica BV"; if (!properties.contains("information")) properties["information"] = "https://github.com/CopernicaMarketingSoftware/AMQP-CPP"; if (!properties.contains("capabilities")) properties["capabilities"] = capabilities; - + +#ifdef _WIN32 + // i don't know that much about win32, so let's use hardcoded string + if (!properties.contains("product")) properties["product"] = "application based on AMQP-CPP"; + if (!properties.contains("platform")) properties["platform"] = "windows"; +#else + // on unix-like systems I know how to retrieve application and platform info + if (!properties.contains("product")) properties["product"] = ProgramName(); + if (!properties.contains("platform")) properties["platform"] = PlatformName(); +#endif + // send back a connection start ok frame connection->send(ConnectionStartOKFrame(properties, "PLAIN", connection->login().saslPlain(), "en_US"));