Skip to content
Snippets Groups Projects
Commit 1436c9dd authored by Jan Včelák's avatar Jan Včelák :rocket: Committed by Gerrit Code Review
Browse files

compile with -std=gnu99 and _GNU_SOURCE defined

Should enable _BSD_SOURCE, _SVID_SOURCE, _ATFILE_SOURCE,
_LARGEFILE64_SOURCE, _ISOC99_SOURCE, _XOPEN_SOURCE_EXTENDED,
_POSIX_SOURCE, _POSIX_C_SOURCE, and _XOPEN_SOURCE.

We already require features exposed by some of these defines. Lets
enable them globally to avoid problems caused by the ordering of
includes.

Change-Id: I562c936780c6b1341995281737d4378d8c9b2be7
parent a6f33d14
Branches
Tags
No related merge requests found
......@@ -5,7 +5,7 @@ noinst_PROGRAMS = unittests unittests-xfr zscanner-tool
noinst_LTLIBRARIES = libknot.la libknotd.la libknots.la libzscanner.la
# $(YACC) will generate header file
AM_CFLAGS = -Wall -Ilibknot -DSYSCONFDIR='"$(sysconfdir)"' -DSBINDIR='"$(sbindir)"'
AM_CFLAGS = -std=gnu99 -D_GNU_SOURCE -Wall -Ilibknot -DSYSCONFDIR='"$(sysconfdir)"' -DSBINDIR='"$(sbindir)"'
AM_YFLAGS = -d
libknotd_la_YFLAGS = -pcf_ -d
libknotd_la_LFLAGS = # TODO: reentrant parser, prefix
......
......@@ -14,10 +14,6 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef _GNU_SOURCE
#define _GNU_SOURCE /* Required for RTLD_DEFAULT. */
#endif
#include <dlfcn.h>
#include <string.h>
#include <stdio.h>
......
......@@ -14,10 +14,6 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef _GNU_SOURCE
#define _GNU_SOURCE /* Required for RTLD_DEFAULT. */
#endif
#include <dlfcn.h>
#include <config.h>
#include <time.h>
......
......@@ -14,11 +14,6 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
// strptime under Linux
#define _XOPEN_SOURCE
// OpenBSD requires following to disable warning
#define _XOPEN_SOURCE_EXTENDED 1
#include "zscanner/test/tests.h"
#include <inttypes.h> // PRIu64
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment