Work around a GCC bug

This commit is contained in:
Romain Goyet
2017-10-19 09:56:47 +02:00
committed by EmilieNumworks
parent 1636d45588
commit e5010b1621
2 changed files with 12 additions and 3 deletions

View File

@@ -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 \