aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitrij D. Czarkoff <czarkoff@gmail.com>2016-05-13 05:57:03 +0200
committerDmitrij D. Czarkoff <czarkoff@gmail.com>2016-05-13 06:30:52 +0200
commit8e9c6f5e57ad3998a150ce34e75a2864cd85fcc1 (patch)
tree0609268b4dcc9678160ea61be26f75877b00392c
parentaac1d79e772700115b8b0b19c8fac0894d62fb04 (diff)
downloadimv-8e9c6f5e57ad3998a150ce34e75a2864cd85fcc1.tar.gz
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 `<string.h>` 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.)
-rw-r--r--Makefile2
-rw-r--r--src/loader.c1
2 files changed, 2 insertions, 1 deletions
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 <limits.h>
#include <stdlib.h>
+#include <string.h>
#include <pthread.h>
#include <signal.h>