From 68a0d8a7aa344de31b6c40c738b707879706bf18 Mon Sep 17 00:00:00 2001 From: Dan Date: Fri, 9 Aug 2024 21:08:03 -0700 Subject: [PATCH] Added a version number to the source --- Helios/Helios.cpp | 7 +++++++ Helios/HeliosConfig.h | 17 +++++++++++++++++ 2 files changed, 24 insertions(+) diff --git a/Helios/Helios.cpp b/Helios/Helios.cpp index 9309eb33..49c924fb 100644 --- a/Helios/Helios.cpp +++ b/Helios/Helios.cpp @@ -38,6 +38,13 @@ bool Helios::keepgoing; bool Helios::sleeping; #endif +#define HELIOS_VERSION 1.1.125 +#define HELIOS_VERSION_STR STR(HELIOS_VERSION) +#define _STR(x) #x +#define STR(x) _STR(x) + +volatile char helios_version[] = HELIOS_VERSION_STR; + bool Helios::init() { // first initialize all the components of helios diff --git a/Helios/HeliosConfig.h b/Helios/HeliosConfig.h index 10bb08ca..5afcc7b5 100644 --- a/Helios/HeliosConfig.h +++ b/Helios/HeliosConfig.h @@ -1,6 +1,23 @@ #ifndef HELIOS_CONFIG_H #define HELIOS_CONFIG_H +// Helper macros to expand out the version into a string +#define _STR(x) #x +#define STR(x) _STR(x) + +// Helios Version Number +// +// It is expected that HELIOS_VERSION will be provided on the command line to the +// compiler as a -DHELIOS_VERSION=a.b.c but if it's not it will default here +#ifndef HELIOS_VERSION +#define HELIOS_VERSION 0.0.1 +#endif + +// Helios Version String +// +// This is the string literal equivalent of HELIOS_VERSION above +#define HELIOS_VERSION_STR STR(HELIOS_VERSION) + // Short Click Threshold // // The length of time in milliseconds for a click to