mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-19 00:37:25 +01:00
Work around a GCC bug
This commit is contained in:
committed by
EmilieNumworks
parent
1636d45588
commit
e5010b1621
@@ -9,7 +9,12 @@ SFLAGS += -Iion/include -DKD_CONFIG_H=1
|
||||
include ion/src/$(PLATFORM)/Makefile
|
||||
include ion/src/shared/tools/Makefile
|
||||
|
||||
ion/src/shared/software_version.o: SFLAGS += -DPATCH_LEVEL=$(PATCH_LEVEL) -DVERSION=$(VERSION)
|
||||
# We need to work around a GCC bug (concerning versions < 5.1). It is valid in
|
||||
# C++11 to initialize a character array by providing a string litteral (e.g.
|
||||
# char test[4]= "ab"; is valid and should initialize test to 'a','b',0,0).
|
||||
# Older versions of GCC are not conformant so we resort to an initializer list.
|
||||
initializer_list = $(shell echo $(1) | sed "s/\(.\)/'\1',/g")0
|
||||
ion/src/shared/software_version.o: SFLAGS += -DPATCH_LEVEL="$(call initializer_list,$(PATCH_LEVEL))" -DVERSION="$(call initializer_list,$(VERSION))"
|
||||
|
||||
objs += $(addprefix ion/src/shared/, \
|
||||
events.o \
|
||||
|
||||
@@ -8,6 +8,10 @@
|
||||
#error This file expects PATCH_LEVEL to be defined
|
||||
#endif
|
||||
|
||||
#ifndef VERSION
|
||||
#error This file expects VERSION to be defined
|
||||
#endif
|
||||
|
||||
#ifndef HEADER_SECTION
|
||||
#define HEADER_SECTION
|
||||
#endif
|
||||
@@ -16,8 +20,8 @@ class VersionInfo {
|
||||
public:
|
||||
constexpr VersionInfo() :
|
||||
m_header(Magic),
|
||||
m_version(STR(VERSION)),
|
||||
m_patchLevel(STR(PATCH_LEVEL)),
|
||||
m_version{VERSION},
|
||||
m_patchLevel{PATCH_LEVEL},
|
||||
m_footer(Magic) { }
|
||||
const char * version() const {
|
||||
assert(m_header == Magic);
|
||||
|
||||
Reference in New Issue
Block a user