From b7373b6de5b41a4b420741da9ebf0570e36c11c7 Mon Sep 17 00:00:00 2001 From: Haru Date: Sat, 24 May 2014 00:38:25 +0200 Subject: Improved CFLAGS/CPPFLAGS handling - Language extensions, such as _GNU_SOURCE are now enabled through CPPFLAGS by the configure script, rather than within the source code. - Moved some configure-time CFLAGS to CPPFLAGS, where appropriate. - Fixes bugreport:8211, thanks to Neoth http://hercules.ws/board/tracker/issue-8211-compiling-warning-in-linux Signed-off-by: Haru --- src/common/Makefile.in | 8 +++++--- src/common/strlib.h | 9 +-------- 2 files changed, 6 insertions(+), 11 deletions(-) (limited to 'src/common') diff --git a/src/common/Makefile.in b/src/common/Makefile.in index 623c59c2e..5dfdd35bd 100644 --- a/src/common/Makefile.in +++ b/src/common/Makefile.in @@ -1,6 +1,8 @@ # Copyright (c) Hercules Dev Team, licensed under GNU GPL. # See the LICENSE file +# @configure_input@ + CONFIG_D = ../config CONFIG_H = $(wildcard $(CONFIG_D)/*.h) $(wildcard $(CONFIG_D)/*/*.h) @@ -114,15 +116,15 @@ obj_all/sysinfo.o: sysinfo.c $(COMMON_H) $(CONFIG_H) $(MT19937AR_H) $(LIBCONFIG_ obj_all/%.o: %.c $(COMMON_H) $(CONFIG_H) $(MT19937AR_H) $(LIBCONFIG_H) | $(SYSINFO_INC) obj_all @echo " CC $<" - @$(CC) @CFLAGS@ $(MT19937AR_INCLUDE) $(LIBCONFIG_INCLUDE) @CPPFLAGS@ -c $(OUTPUT_OPTION) $< + @$(CC) @CFLAGS@ @DEFS@ $(MT19937AR_INCLUDE) $(LIBCONFIG_INCLUDE) @CPPFLAGS@ -c $(OUTPUT_OPTION) $< obj_all/mini%.o: %.c $(COMMON_H) $(CONFIG_H) $(MT19937AR_H) $(LIBCONFIG_H) | $(SYSINFO_INC) obj_all @echo " CC $<" - @$(CC) @CFLAGS@ $(MT19937AR_INCLUDE) $(LIBCONFIG_INCLUDE) -DMINICORE @CPPFLAGS@ -c $(OUTPUT_OPTION) $< + @$(CC) @CFLAGS@ @DEFS@ $(MT19937AR_INCLUDE) $(LIBCONFIG_INCLUDE) -DMINICORE @CPPFLAGS@ -c $(OUTPUT_OPTION) $< obj_sql/%.o: %.c $(COMMON_H) $(COMMON_SQL_H) $(CONFIG_H) $(LIBCONFIG_H) | $(SYSINFO_INC) obj_sql @echo " CC $<" - @$(CC) @CFLAGS@ $(LIBCONFIG_INCLUDE) @MYSQL_CFLAGS@ @CPPFLAGS@ -c $(OUTPUT_OPTION) $< + @$(CC) @CFLAGS@ @DEFS@ $(LIBCONFIG_INCLUDE) @MYSQL_CFLAGS@ @CPPFLAGS@ -c $(OUTPUT_OPTION) $< # missing object files $(MT19937AR_OBJ): diff --git a/src/common/strlib.h b/src/common/strlib.h index decf661a6..f93d8ad67 100644 --- a/src/common/strlib.h +++ b/src/common/strlib.h @@ -6,17 +6,10 @@ #define _COMMON_STRLIB_H_ #include +#include #include "../common/cbasetypes.h" -#ifndef __USE_GNU -# define __USE_GNU // required to enable strnlen on some platforms -# include -# undef __USE_GNU -#else -# include -#endif - #ifdef WIN32 #define HAVE_STRTOK_R #define strtok_r(s,delim,save_ptr) _strtok_r((s),(delim),(save_ptr)) -- cgit v1.2.3-60-g2f50