diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2012-04-07 14:02:04 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2012-04-07 14:02:04 -0700 |
commit | b3c27e56063a3357869266bf4a836b67859a927e (patch) | |
tree | ac850f782332815186ce7479b627898be2144a90 | |
parent | e5d0cc1c9f409827de95c9aeede8b4ae0c014d2c (diff) | |
download | txr-b3c27e56063a3357869266bf4a836b67859a927e.tar.gz txr-b3c27e56063a3357869266bf4a836b67859a927e.tar.bz2 txr-b3c27e56063a3357869266bf4a836b67859a927e.zip |
* configure: Added new check for some clashing external names,
which we can redefine out of the way in config.h.
* lib.c: config.h was being included before <windows.h>.
-rw-r--r-- | ChangeLog | 7 | ||||
-rwxr-xr-x | configure | 40 | ||||
-rw-r--r-- | lib.c | 2 |
3 files changed, 48 insertions, 1 deletions
@@ -1,5 +1,12 @@ 2012-04-07 Kaz Kylheku <kaz@kylheku.com> + * configure: Added new check for some clashing external names, + which we can redefine out of the way in config.h. + + * lib.c: config.h was being included before <windows.h>. + +2012-04-07 Kaz Kylheku <kaz@kylheku.com> + * txr.1: Documented int-flo, flo-int, search-regex, match-regex and regsub. @@ -1046,6 +1046,46 @@ else fi # +# Check for annoying clashes from non-conforming BSD-derived systems that don't +# honor Unix/POSIX feature selection macros! +# + +printf "Checking for name clashes caused by nonconforming toolchains ... " + +for ident in trunc floorf random ; do + cat > conftest.c <<! +#include <assert.h> +#include <ctype.h> +#include <dirent.h> +#include <errno.h> +#include <float.h> +#include <limits.h> +#include <math.h> +#include <setjmp.h> +#include <stdarg.h> +#include <stddef.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <sys/wait.h> +#include <time.h> +#include <unistd.h> +#include <wchar.h> +#include <wctype.h> + +struct txr_foo { int txr; } $ident; + +int $ident(void); + +int main(void) { return 0; } +! + rm -f conftest + if ! make conftest > conftest.err 2>&1 || ! [ -x conftest ] ; then + printf "#define %s txr_%s\n" $ident $ident >> config.h + fi +done + +# # Extra debugging. # @@ -36,11 +36,11 @@ #include <errno.h> #include <wchar.h> #include <math.h> -#include "config.h" #ifdef HAVE_GETENVIRONMENTSTRINGS #define NOMINMAX #include <windows.h> #endif +#include "config.h" #include "lib.h" #include "gc.h" #include "arith.h" |