From 407377d0d945ccab189546ce0ce9d5f7d4a7f076 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Tue, 10 Apr 2012 15:42:48 -0700 Subject: * configure: Switch from _POSIX_C_SOURCE=2 to _XOPEN_SOURCE. We will be relying on the gettimeofday function which only came into POSIX in 2001, but was in Unix long before then. * HACKING: Replace notes about -D_POSIX_C_SOURCE which are not true any more. --- ChangeLog | 9 +++++++++ HACKING | 8 ++++---- configure | 2 +- 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 75bc2656..69a0ca4f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2012-04-10 Kaz Kylheku + + * configure: Switch from _POSIX_C_SOURCE=2 to _XOPEN_SOURCE. + We will be relying on the gettimeofday function which only came + into POSIX in 2001, but was in Unix long before then. + + * HACKING: Replace notes about -D_POSIX_C_SOURCE which are not true + any more. + 2012-04-10 Kaz Kylheku * Makefile (conftest.ccver): New phony target. diff --git a/HACKING b/HACKING index 20e4dc4f..13d9e656 100644 --- a/HACKING +++ b/HACKING @@ -43,10 +43,10 @@ provide rationale and make coding recommendations. Txr is written in a language that consists of the common dialect between C90 and C++98. The code can be built with either the GNU C compiler or the GNU C++ -compiler. Use is made of some POSIX.2 functions, which are requested by means -of -D_POSIX_2_SOURCE. Also, the header is used, which was introduced -by a 1995 addendum to the C language, so it may be said that the actual C -dialect is C95. +compiler. Use is made of some Unix functions from before Unix95, which are +requested by means of -D_XOPEN_SOURCE (POSIX.1, POSIX.2, X/Open Portabiity +Guide 4). Also, the header is used, which was introduced by a 1995 +addendum to the C language, so it may be said that the actual C dialect is C95. In coding new features or fixing bugs, care must be taken to preserve this. Code must continue to compile as C and C++, and not increase the portability diff --git a/configure b/configure index af340423..6ef68942 100755 --- a/configure +++ b/configure @@ -128,7 +128,7 @@ yacc_given=${yacc+y} yacc=${yacc-'$(cross)$(tool_prefix)$(yaccname)'} nm=${nm-'$(cross)$(tool_prefix)nm'} opt_flags=${opt_flags--O2} -lang_flags=${lang_flags--ansi -D_POSIX_C_SOURCE=2} +lang_flags=${lang_flags--ansi -D_XOPEN_SOURCE} diag_flags=${diag_flags--Wall -Wmissing-prototypes -Wstrict-prototypes} debug_flags=${debug_flags--g} inline=${inline-} -- cgit v1.2.3