2
0
Fork 0

[core] only use feature test macros on linux

This commit is contained in:
Stefan Bühler 2013-07-20 11:45:09 +02:00
parent 42ce5eda8f
commit e762189fb5
3 changed files with 10 additions and 5 deletions

View File

@ -32,9 +32,15 @@
# warning "unknown OS, please report this"
#endif
#define _XOPEN_SOURCE 600
#ifndef _GNU_SOURCE
#define _GNU_SOURCE
/* FreeBSD doesn't export special stuff if any feature test macro is set */
#ifdef LIGHTY_OS_LINUX
# define _XOPEN_SOURCE 600
# ifndef _GNU_SOURCE
# define _GNU_SOURCE 1
# endif
# ifndef _BSD_SOURCE
# define _BSD_SOURCE 1
# endif
#endif
#ifdef HAVE_CONFIG_H

View File

@ -415,7 +415,6 @@ IF(CMAKE_COMPILER_IS_GNUCC)
SET(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -O2")
SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -O0")
SET(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_WITHDEBINFO} -O2")
ADD_DEFINITIONS(-D_GNU_SOURCE)
ENDIF(CMAKE_COMPILER_IS_GNUCC)
SET_TARGET_PROPERTIES(lighttpd2-worker PROPERTIES CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}")

View File

@ -60,7 +60,7 @@ def configure(conf):
conf.env['CCFLAGS'] = tolist(conf.env['CCFLAGS'])
conf.env['CCFLAGS'] += [
'-std=gnu99', '-Wall', '-Wshadow', '-W', '-pedantic', '-fPIC',
'-D_GNU_SOURCE', '-D_FILE_OFFSET_BITS=64', '-D_LARGEFILE_SOURCE', '-D_LARGE_FILES',
'-D_FILE_OFFSET_BITS=64', '-D_LARGEFILE_SOURCE', '-D_LARGE_FILES',
'-g', '-g2'
# '-fno-strict-aliasing',
]