From 76ee7cdd7ff30ee8721067f8f3e80b3cba4691d1 Mon Sep 17 00:00:00 2001 From: Max Paperno Date: Tue, 19 Dec 2017 17:58:15 -0500 Subject: [PATCH] Fix libsimulator builds, especially MSVC. --- radio/src/stamp.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/radio/src/stamp.cpp b/radio/src/stamp.cpp index e826bde9c..f6387d7b0 100644 --- a/radio/src/stamp.cpp +++ b/radio/src/stamp.cpp @@ -51,8 +51,14 @@ */ #if defined(STM32) -__attribute__ ((section(".fwversiondata"), used)) const char firmware_version[] = "opentx-" FLAVOUR "-" VERSION " (" GIT_STR ")"; -__attribute__ ((section(".bootversiondata"), used)) const char boot_version[] = "opentx-" FLAVOUR "-" VERSION " (" GIT_STR ")"; +#if defined(SIMU) + #define ATTRIBUTE_SECTION(s) +#else + #define ATTRIBUTE_SECTION(s) __attribute__ ((section(s), used)) +#endif + +ATTRIBUTE_SECTION(".fwversiondata") const char firmware_version[] = "opentx-" FLAVOUR "-" VERSION " (" GIT_STR ")"; +ATTRIBUTE_SECTION(".bootversiondata") const char boot_version[] = "opentx-" FLAVOUR "-" VERSION " (" GIT_STR ")"; /** * Tries to find opentx version in the first 1024 byte of either firmware/bootloader (the one not running) or the buffer