From 8e9c6f5e57ad3998a150ce34e75a2864cd85fcc1 Mon Sep 17 00:00:00 2001 From: "Dmitrij D. Czarkoff" Date: Fri, 13 May 2016 05:57:03 +0200 Subject: Fix build of imv on GNU libc Previously imv used -std=gnu11 flag which activated GNU "extensions" of C11 standard. This masked a portability issue in imv: strduo(3) should not have been visible in `src/loader.c` without inclusion of `` header. This have been fixed. To remidy GNU libc's stange choice to hide X/Open interfaces in C99 code by default _XOPEN_SOURCE macro was also set. (This should have no effect on most other platforms.) --- Makefile | 2 +- src/loader.c | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index e8c43e1..39ffdc7 100644 --- a/Makefile +++ b/Makefile @@ -10,7 +10,7 @@ MUTE := @ endif CFLAGS ?= -W -Wall -pedantic -Wmissing-prototypes -CFLAGS += -std=c99 $(shell sdl2-config --cflags) +CFLAGS += -std=c99 $(shell sdl2-config --cflags) -D_XOPEN_SOURCE=700 LDFLAGS += $(shell sdl2-config --libs) -lfreeimage -lSDL2_ttf -lfontconfig -lpthread BUILDDIR ?= build diff --git a/src/loader.c b/src/loader.c index 91d0d2f..0e7079e 100644 --- a/src/loader.c +++ b/src/loader.c @@ -19,6 +19,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "texture.h" #include #include +#include #include #include -- cgit v1.2.3