diff options
| author | Paul Eggert | 2014-05-17 01:11:31 -0700 |
|---|---|---|
| committer | Paul Eggert | 2014-05-17 01:11:31 -0700 |
| commit | 8208d2bf95f924ed810dc06e84fc4c7d5ac004a5 (patch) | |
| tree | b66944645e971c516adfef8f8bc74517bda8dfa1 /lib | |
| parent | f63fc858c3d4a7d91ccac850025e407cc57b77fc (diff) | |
| download | emacs-8208d2bf95f924ed810dc06e84fc4c7d5ac004a5.tar.gz emacs-8208d2bf95f924ed810dc06e84fc4c7d5ac004a5.zip | |
Assume C99 or later.
* lib/stdarg.in.h, lib/stdbool.in.h, m4/stdarg.m4, m4/stdbool.m4:
Remove.
* configure.ac (_AC_PROG_CC_C89): Define a dummy, to keep 'configure'
smaller.
(gl_PROG_CC_C99): Use this to get C99 or later.
* lib/gnulib.mk, m4/gnulib-comp.m4: Regenerate.
* admin/merge-gnulib (GNULIB_MODULES): Remove stdarg, stdbool.
(GNULIB_TOOL_FLAGS): Avoid stdarg, stdbool.
* doc/lispref/internals.texi (C Dialect): Document this.
* etc/NEWS: Document this.
* nt/gnulib.mk: Remove stdarg and stdbool modules.
* src/bytecode.c (B__dummy__): Remove.
* src/conf_post.h (bool_bf) [!NS_IMPL_GNUSTEP]: Use bool.
(FLEXIBLE_ARRAY_MEMBER): Now always empty.
* src/dbusbind.c (XD_DEBUG_MESSAGE) [!DBUS_DEBUG]:
* src/regex.c (DEBUG_PRINT): Assume varargs macros.
* src/lisp.h (DEFUN_FUNCTION_INIT): Remove. All uses now assume C99.
Fixes: debbugs:17487
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/gnulib.mk | 53 | ||||
| -rw-r--r-- | lib/stdarg.in.h | 35 | ||||
| -rw-r--r-- | lib/stdbool.in.h | 132 |
3 files changed, 1 insertions, 219 deletions
diff --git a/lib/gnulib.mk b/lib/gnulib.mk index e219292aa34..231b38dbf03 100644 --- a/lib/gnulib.mk +++ b/lib/gnulib.mk | |||
| @@ -21,7 +21,7 @@ | |||
| 21 | # the same distribution terms as the rest of that program. | 21 | # the same distribution terms as the rest of that program. |
| 22 | # | 22 | # |
| 23 | # Generated by gnulib-tool. | 23 | # Generated by gnulib-tool. |
| 24 | # Reproduce by: gnulib-tool --import --dir=. --lib=libgnu --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --avoid=close --avoid=dup --avoid=fchdir --avoid=fstat --avoid=malloc-posix --avoid=msvc-inval --avoid=msvc-nothrow --avoid=open --avoid=openat-die --avoid=opendir --avoid=raise --avoid=save-cwd --avoid=select --avoid=sigprocmask --avoid=threadlib --makefile-name=gnulib.mk --conditional-dependencies --no-libtool --macro-prefix=gl --no-vc-files alloca-opt byteswap c-ctype c-strcase careadlinkat close-stream count-one-bits count-trailing-zeros crypto/md5 crypto/sha1 crypto/sha256 crypto/sha512 dtoastr dtotimespec dup2 environ execinfo faccessat fcntl fcntl-h fdatasync fdopendir filemode fstatat fsync getloadavg getopt-gnu gettime gettimeofday intprops largefile lstat manywarnings memrchr mkostemp mktime pipe2 pselect pthread_sigmask putenv qacl readlink readlinkat sig2str socklen stat-time stdalign stdarg stdbool stdio strftime strtoimax strtoumax symlink sys_stat sys_time time timer-time timespec-add timespec-sub unsetenv update-copyright utimens warnings | 24 | # Reproduce by: gnulib-tool --import --dir=. --lib=libgnu --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --avoid=close --avoid=dup --avoid=fchdir --avoid=fstat --avoid=malloc-posix --avoid=msvc-inval --avoid=msvc-nothrow --avoid=open --avoid=openat-die --avoid=opendir --avoid=raise --avoid=save-cwd --avoid=select --avoid=sigprocmask --avoid=stdarg --avoid=stdbool --avoid=threadlib --makefile-name=gnulib.mk --conditional-dependencies --no-libtool --macro-prefix=gl --no-vc-files alloca-opt byteswap c-ctype c-strcase careadlinkat close-stream count-one-bits count-trailing-zeros crypto/md5 crypto/sha1 crypto/sha256 crypto/sha512 dtoastr dtotimespec dup2 environ execinfo faccessat fcntl fcntl-h fdatasync fdopendir filemode fstatat fsync getloadavg getopt-gnu gettime gettimeofday intprops largefile lstat manywarnings memrchr mkostemp mktime pipe2 pselect pthread_sigmask putenv qacl readlink readlinkat sig2str socklen stat-time stdalign stdio strftime strtoimax strtoumax symlink sys_stat sys_time time timer-time timespec-add timespec-sub unsetenv update-copyright utimens warnings |
| 25 | 25 | ||
| 26 | 26 | ||
| 27 | MOSTLYCLEANFILES += core *.stackdump | 27 | MOSTLYCLEANFILES += core *.stackdump |
| @@ -900,57 +900,6 @@ EXTRA_DIST += stdalign.in.h | |||
| 900 | 900 | ||
| 901 | ## end gnulib module stdalign | 901 | ## end gnulib module stdalign |
| 902 | 902 | ||
| 903 | ## begin gnulib module stdarg | ||
| 904 | |||
| 905 | BUILT_SOURCES += $(STDARG_H) | ||
| 906 | |||
| 907 | # We need the following in order to create <stdarg.h> when the system | ||
| 908 | # doesn't have one that works with the given compiler. | ||
| 909 | if GL_GENERATE_STDARG_H | ||
| 910 | stdarg.h: stdarg.in.h $(top_builddir)/config.status | ||
| 911 | $(AM_V_GEN)rm -f $@-t $@ && \ | ||
| 912 | { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \ | ||
| 913 | sed -e 's|@''GUARD_PREFIX''@|GL|g' \ | ||
| 914 | -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ | ||
| 915 | -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ | ||
| 916 | -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ | ||
| 917 | -e 's|@''NEXT_STDARG_H''@|$(NEXT_STDARG_H)|g' \ | ||
| 918 | < $(srcdir)/stdarg.in.h; \ | ||
| 919 | } > $@-t && \ | ||
| 920 | mv $@-t $@ | ||
| 921 | else | ||
| 922 | stdarg.h: $(top_builddir)/config.status | ||
| 923 | rm -f $@ | ||
| 924 | endif | ||
| 925 | MOSTLYCLEANFILES += stdarg.h stdarg.h-t | ||
| 926 | |||
| 927 | EXTRA_DIST += stdarg.in.h | ||
| 928 | |||
| 929 | ## end gnulib module stdarg | ||
| 930 | |||
| 931 | ## begin gnulib module stdbool | ||
| 932 | |||
| 933 | BUILT_SOURCES += $(STDBOOL_H) | ||
| 934 | |||
| 935 | # We need the following in order to create <stdbool.h> when the system | ||
| 936 | # doesn't have one that works. | ||
| 937 | if GL_GENERATE_STDBOOL_H | ||
| 938 | stdbool.h: stdbool.in.h $(top_builddir)/config.status | ||
| 939 | $(AM_V_GEN)rm -f $@-t $@ && \ | ||
| 940 | { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ | ||
| 941 | sed -e 's/@''HAVE__BOOL''@/$(HAVE__BOOL)/g' < $(srcdir)/stdbool.in.h; \ | ||
| 942 | } > $@-t && \ | ||
| 943 | mv $@-t $@ | ||
| 944 | else | ||
| 945 | stdbool.h: $(top_builddir)/config.status | ||
| 946 | rm -f $@ | ||
| 947 | endif | ||
| 948 | MOSTLYCLEANFILES += stdbool.h stdbool.h-t | ||
| 949 | |||
| 950 | EXTRA_DIST += stdbool.in.h | ||
| 951 | |||
| 952 | ## end gnulib module stdbool | ||
| 953 | |||
| 954 | ## begin gnulib module stddef | 903 | ## begin gnulib module stddef |
| 955 | 904 | ||
| 956 | BUILT_SOURCES += $(STDDEF_H) | 905 | BUILT_SOURCES += $(STDDEF_H) |
diff --git a/lib/stdarg.in.h b/lib/stdarg.in.h deleted file mode 100644 index 5b37dd3601a..00000000000 --- a/lib/stdarg.in.h +++ /dev/null | |||
| @@ -1,35 +0,0 @@ | |||
| 1 | /* Substitute for and wrapper around <stdarg.h>. | ||
| 2 | Copyright (C) 2008-2014 Free Software Foundation, Inc. | ||
| 3 | |||
| 4 | This program is free software; you can redistribute it and/or modify | ||
| 5 | it under the terms of the GNU General Public License as published by | ||
| 6 | the Free Software Foundation; either version 3, or (at your option) | ||
| 7 | any later version. | ||
| 8 | |||
| 9 | This program is distributed in the hope that it will be useful, | ||
| 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 12 | GNU General Public License for more details. | ||
| 13 | |||
| 14 | You should have received a copy of the GNU General Public License | ||
| 15 | along with this program; if not, see <http://www.gnu.org/licenses/>. */ | ||
| 16 | |||
| 17 | #ifndef _@GUARD_PREFIX@_STDARG_H | ||
| 18 | |||
| 19 | #if __GNUC__ >= 3 | ||
| 20 | @PRAGMA_SYSTEM_HEADER@ | ||
| 21 | #endif | ||
| 22 | @PRAGMA_COLUMNS@ | ||
| 23 | |||
| 24 | /* The include_next requires a split double-inclusion guard. */ | ||
| 25 | #@INCLUDE_NEXT@ @NEXT_STDARG_H@ | ||
| 26 | |||
| 27 | #ifndef _@GUARD_PREFIX@_STDARG_H | ||
| 28 | #define _@GUARD_PREFIX@_STDARG_H | ||
| 29 | |||
| 30 | #ifndef va_copy | ||
| 31 | # define va_copy(a,b) ((a) = (b)) | ||
| 32 | #endif | ||
| 33 | |||
| 34 | #endif /* _@GUARD_PREFIX@_STDARG_H */ | ||
| 35 | #endif /* _@GUARD_PREFIX@_STDARG_H */ | ||
diff --git a/lib/stdbool.in.h b/lib/stdbool.in.h deleted file mode 100644 index 651e8dffdb3..00000000000 --- a/lib/stdbool.in.h +++ /dev/null | |||
| @@ -1,132 +0,0 @@ | |||
| 1 | /* Copyright (C) 2001-2003, 2006-2014 Free Software Foundation, Inc. | ||
| 2 | Written by Bruno Haible <haible@clisp.cons.org>, 2001. | ||
| 3 | |||
| 4 | This program is free software; you can redistribute it and/or modify | ||
| 5 | it under the terms of the GNU General Public License as published by | ||
| 6 | the Free Software Foundation; either version 3, or (at your option) | ||
| 7 | any later version. | ||
| 8 | |||
| 9 | This program is distributed in the hope that it will be useful, | ||
| 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 12 | GNU General Public License for more details. | ||
| 13 | |||
| 14 | You should have received a copy of the GNU General Public License | ||
| 15 | along with this program; if not, see <http://www.gnu.org/licenses/>. */ | ||
| 16 | |||
| 17 | #ifndef _GL_STDBOOL_H | ||
| 18 | #define _GL_STDBOOL_H | ||
| 19 | |||
| 20 | /* ISO C 99 <stdbool.h> for platforms that lack it. */ | ||
| 21 | |||
| 22 | /* Usage suggestions: | ||
| 23 | |||
| 24 | Programs that use <stdbool.h> should be aware of some limitations | ||
| 25 | and standards compliance issues. | ||
| 26 | |||
| 27 | Standards compliance: | ||
| 28 | |||
| 29 | - <stdbool.h> must be #included before 'bool', 'false', 'true' | ||
| 30 | can be used. | ||
| 31 | |||
| 32 | - You cannot assume that sizeof (bool) == 1. | ||
| 33 | |||
| 34 | - Programs should not undefine the macros bool, true, and false, | ||
| 35 | as C99 lists that as an "obsolescent feature". | ||
| 36 | |||
| 37 | Limitations of this substitute, when used in a C89 environment: | ||
| 38 | |||
| 39 | - <stdbool.h> must be #included before the '_Bool' type can be used. | ||
| 40 | |||
| 41 | - You cannot assume that _Bool is a typedef; it might be a macro. | ||
| 42 | |||
| 43 | - Bit-fields of type 'bool' are not supported. Portable code | ||
| 44 | should use 'unsigned int foo : 1;' rather than 'bool foo : 1;'. | ||
| 45 | |||
| 46 | - In C99, casts and automatic conversions to '_Bool' or 'bool' are | ||
| 47 | performed in such a way that every nonzero value gets converted | ||
| 48 | to 'true', and zero gets converted to 'false'. This doesn't work | ||
| 49 | with this substitute. With this substitute, only the values 0 and 1 | ||
| 50 | give the expected result when converted to _Bool' or 'bool'. | ||
| 51 | |||
| 52 | - C99 allows the use of (_Bool)0.0 in constant expressions, but | ||
| 53 | this substitute cannot always provide this property. | ||
| 54 | |||
| 55 | Also, it is suggested that programs use 'bool' rather than '_Bool'; | ||
| 56 | this isn't required, but 'bool' is more common. */ | ||
| 57 | |||
| 58 | |||
| 59 | /* 7.16. Boolean type and values */ | ||
| 60 | |||
| 61 | /* BeOS <sys/socket.h> already #defines false 0, true 1. We use the same | ||
| 62 | definitions below, but temporarily we have to #undef them. */ | ||
| 63 | #if defined __BEOS__ && !defined __HAIKU__ | ||
| 64 | # include <OS.h> /* defines bool but not _Bool */ | ||
| 65 | # undef false | ||
| 66 | # undef true | ||
| 67 | #endif | ||
| 68 | |||
| 69 | #ifdef __cplusplus | ||
| 70 | # define _Bool bool | ||
| 71 | # define bool bool | ||
| 72 | #else | ||
| 73 | # if defined __BEOS__ && !defined __HAIKU__ | ||
| 74 | /* A compiler known to have 'bool'. */ | ||
| 75 | /* If the compiler already has both 'bool' and '_Bool', we can assume they | ||
| 76 | are the same types. */ | ||
| 77 | # if !@HAVE__BOOL@ | ||
| 78 | typedef bool _Bool; | ||
| 79 | # endif | ||
| 80 | # else | ||
| 81 | # if !defined __GNUC__ | ||
| 82 | /* If @HAVE__BOOL@: | ||
| 83 | Some HP-UX cc and AIX IBM C compiler versions have compiler bugs when | ||
| 84 | the built-in _Bool type is used. See | ||
| 85 | http://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html | ||
| 86 | http://lists.gnu.org/archive/html/bug-coreutils/2005-11/msg00161.html | ||
| 87 | http://lists.gnu.org/archive/html/bug-coreutils/2005-10/msg00086.html | ||
| 88 | Similar bugs are likely with other compilers as well; this file | ||
| 89 | wouldn't be used if <stdbool.h> was working. | ||
| 90 | So we override the _Bool type. | ||
| 91 | If !@HAVE__BOOL@: | ||
| 92 | Need to define _Bool ourselves. As 'signed char' or as an enum type? | ||
| 93 | Use of a typedef, with SunPRO C, leads to a stupid | ||
| 94 | "warning: _Bool is a keyword in ISO C99". | ||
| 95 | Use of an enum type, with IRIX cc, leads to a stupid | ||
| 96 | "warning(1185): enumerated type mixed with another type". | ||
| 97 | Even the existence of an enum type, without a typedef, | ||
| 98 | "Invalid enumerator. (badenum)" with HP-UX cc on Tru64. | ||
| 99 | The only benefit of the enum, debuggability, is not important | ||
| 100 | with these compilers. So use 'signed char' and no enum. */ | ||
| 101 | # define _Bool signed char | ||
| 102 | # else | ||
| 103 | /* With this compiler, trust the _Bool type if the compiler has it. */ | ||
| 104 | # if !@HAVE__BOOL@ | ||
| 105 | /* For the sake of symbolic names in gdb, define true and false as | ||
| 106 | enum constants, not only as macros. | ||
| 107 | It is tempting to write | ||
| 108 | typedef enum { false = 0, true = 1 } _Bool; | ||
| 109 | so that gdb prints values of type 'bool' symbolically. But then | ||
| 110 | values of type '_Bool' might promote to 'int' or 'unsigned int' | ||
| 111 | (see ISO C 99 6.7.2.2.(4)); however, '_Bool' must promote to 'int' | ||
| 112 | (see ISO C 99 6.3.1.1.(2)). So add a negative value to the | ||
| 113 | enum; this ensures that '_Bool' promotes to 'int'. */ | ||
| 114 | typedef enum { _Bool_must_promote_to_int = -1, false = 0, true = 1 } _Bool; | ||
| 115 | # endif | ||
| 116 | # endif | ||
| 117 | # endif | ||
| 118 | # define bool _Bool | ||
| 119 | #endif | ||
| 120 | |||
| 121 | /* The other macros must be usable in preprocessor directives. */ | ||
| 122 | #ifdef __cplusplus | ||
| 123 | # define false false | ||
| 124 | # define true true | ||
| 125 | #else | ||
| 126 | # define false 0 | ||
| 127 | # define true 1 | ||
| 128 | #endif | ||
| 129 | |||
| 130 | #define __bool_true_false_are_defined 1 | ||
| 131 | |||
| 132 | #endif /* _GL_STDBOOL_H */ | ||