From c7d0e212303993e65238a7a0c03088c4085482b2 Mon Sep 17 00:00:00 2001 From: "hongcai.dhc" Date: Sat, 28 Jan 2017 19:50:09 +0800 Subject: [PATCH] fix: gcc compilation http://stackoverflow.com/questions/11869593/c99-printf-formatters-vs-c11-user-defined-literals --- src/Makefile | 2 +- src/shm_list.h | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Makefile b/src/Makefile index edbc51b..7680a4e 100644 --- a/src/Makefile +++ b/src/Makefile @@ -30,7 +30,7 @@ libshmcache.a: $(SHMCACHE_STATIC_OBJS) .c: $(COMPILE) -o $@ $< $(SHMCACHE_STATIC_OBJS) $(LIB_PATH) $(INC_PATH) .c.o: - $(COMPILE) -c -o $@ $< $(INC_PATH) + $(COMPILE) -c -fPIC -o $@ $< $(INC_PATH) .c.lo: $(COMPILE) -c -fPIC -o $@ $< $(INC_PATH) install: diff --git a/src/shm_list.h b/src/shm_list.h index 2596f13..c6d0c49 100644 --- a/src/shm_list.h +++ b/src/shm_list.h @@ -1,5 +1,9 @@ //shm_list.h +#ifndef __STDC_FORMAT_MACROS +#define __STDC_FORMAT_MACROS +#endif + #ifndef _SHM_LIST_H #define _SHM_LIST_H