Fixes #40: add _DEFAULT_SOURCE back for Linux build
authorletoh <letoh.tw@gmail.com>
Mon, 12 Mar 2018 14:25:58 +0000 (22:25 +0800)
committerletoh <letoh.tw@gmail.com>
Mon, 12 Mar 2018 14:25:58 +0000 (22:25 +0800)
This commit fixes the improper patch in the pull request #7.

When building pforth on the Linux system with glibc version before
2.19, defining _GNU_SOURCE is needed for using ECHOCTL in the
source. However, the later version of glibc uses _DEFAULT_SOURCE
instead of _GNU_SOURCE for the same purpose, we will need both symbols
for both older glibc and newer glibc.

build/unix/Makefile

index 3e9f3e7..e80b56d 100644 (file)
@@ -58,7 +58,7 @@ PFSOURCE = $(PFBASESOURCE) $(IO_SOURCE)
 VPATH = .:$(CSRCDIR):$(CSRCDIR)/posix:$(CSRCDIR)/stdio:$(CSRCDIR)/win32_console:$(CSRCDIR)/win32
 
 XCFLAGS = $(CCOPTS)
 VPATH = .:$(CSRCDIR):$(CSRCDIR)/posix:$(CSRCDIR)/stdio:$(CSRCDIR)/win32_console:$(CSRCDIR)/win32
 
 XCFLAGS = $(CCOPTS)
-XCPPFLAGS = -DPF_SUPPORT_FP -D_GNU_SOURCE
+XCPPFLAGS = -DPF_SUPPORT_FP -D_DEFAULT_SOURCE -D_GNU_SOURCE
 XLDFLAGS = $(WIDTHOPT)
 
 CPPFLAGS = -I. $(XCPPFLAGS)
 XLDFLAGS = $(WIDTHOPT)
 
 CPPFLAGS = -I. $(XCPPFLAGS)