summaryrefslogtreecommitdiff
path: root/m4
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2014-05-17 01:11:31 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2014-05-17 01:11:31 -0700
commit8208d2bf95f924ed810dc06e84fc4c7d5ac004a5 (patch)
treeb66944645e971c516adfef8f8bc74517bda8dfa1 /m4
parentf63fc858c3d4a7d91ccac850025e407cc57b77fc (diff)
downloademacs-8208d2bf95f924ed810dc06e84fc4c7d5ac004a5.tar.gz
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 'm4')
-rw-r--r--m4/gnulib-comp.m413
-rw-r--r--m4/stdarg.m478
-rw-r--r--m4/stdbool.m4100
3 files changed, 0 insertions, 191 deletions
diff --git a/m4/gnulib-comp.m4 b/m4/gnulib-comp.m4
index 0ba2d7950af..98acc069c92 100644
--- a/m4/gnulib-comp.m4
+++ b/m4/gnulib-comp.m4
@@ -119,13 +119,6 @@ AC_DEFUN([gl_EARLY],
# Code from module stat:
# Code from module stat-time:
# Code from module stdalign:
- # Code from module stdarg:
- dnl Some compilers (e.g., AIX 5.3 cc) need to be in c99 mode
- dnl for the builtin va_copy to work. With Autoconf 2.60 or later,
- dnl gl_PROG_CC_C99 arranges for this. With older Autoconf gl_PROG_CC_C99
- dnl shouldn't hurt, though installers are on their own to set c99 mode.
- gl_PROG_CC_C99
- # Code from module stdbool:
# Code from module stddef:
# Code from module stdint:
# Code from module stdio:
@@ -342,8 +335,6 @@ AC_DEFUN([gl_INIT],
gl_STAT_TIME
gl_STAT_BIRTHTIME
gl_STDALIGN_H
- gl_STDARG_H
- AM_STDBOOL_H
gl_STDDEF_H
gl_STDINT_H
gl_STDIO_H
@@ -891,8 +882,6 @@ AC_DEFUN([gl_FILE_LIST], [
lib/stat-time.h
lib/stat.c
lib/stdalign.in.h
- lib/stdarg.in.h
- lib/stdbool.in.h
lib/stddef.in.h
lib/stdint.in.h
lib/stdio.in.h
@@ -998,8 +987,6 @@ AC_DEFUN([gl_FILE_LIST], [
m4/stat-time.m4
m4/stat.m4
m4/stdalign.m4
- m4/stdarg.m4
- m4/stdbool.m4
m4/stddef_h.m4
m4/stdint.m4
m4/stdio_h.m4
diff --git a/m4/stdarg.m4 b/m4/stdarg.m4
deleted file mode 100644
index 732aa313b6a..00000000000
--- a/m4/stdarg.m4
+++ /dev/null
@@ -1,78 +0,0 @@
-# stdarg.m4 serial 6
-dnl Copyright (C) 2006, 2008-2014 Free Software Foundation, Inc.
-dnl This file is free software; the Free Software Foundation
-dnl gives unlimited permission to copy and/or distribute it,
-dnl with or without modifications, as long as this notice is preserved.
-
-dnl From Bruno Haible.
-dnl Provide a working va_copy in combination with <stdarg.h>.
-
-AC_DEFUN([gl_STDARG_H],
-[
- STDARG_H=''
- NEXT_STDARG_H='<stdarg.h>'
- AC_MSG_CHECKING([for va_copy])
- AC_CACHE_VAL([gl_cv_func_va_copy], [
- AC_COMPILE_IFELSE(
- [AC_LANG_PROGRAM(
- [[#include <stdarg.h>]],
- [[
-#ifndef va_copy
-void (*func) (va_list, va_list) = va_copy;
-#endif
- ]])],
- [gl_cv_func_va_copy=yes],
- [gl_cv_func_va_copy=no])])
- AC_MSG_RESULT([$gl_cv_func_va_copy])
- if test $gl_cv_func_va_copy = no; then
- dnl Provide a substitute.
- dnl Usually a simple definition in <config.h> is enough. Not so on AIX 5
- dnl with some versions of the /usr/vac/bin/cc compiler. It has an <stdarg.h>
- dnl which does '#undef va_copy', leading to a missing va_copy symbol. For
- dnl this platform, we use an <stdarg.h> substitute. But we cannot use this
- dnl approach on other platforms, because <stdarg.h> often defines only
- dnl preprocessor macros and gl_ABSOLUTE_HEADER, gl_CHECK_NEXT_HEADERS do
- dnl not work in this situation.
- AC_EGREP_CPP([vaccine],
- [#if defined _AIX && !defined __GNUC__
- AIX vaccine
- #endif
- ], [gl_aixcc=yes], [gl_aixcc=no])
- if test $gl_aixcc = yes; then
- dnl Provide a substitute <stdarg.h> file.
- STDARG_H=stdarg.h
- gl_NEXT_HEADERS([stdarg.h])
- dnl Fallback for the case when <stdarg.h> contains only macro definitions.
- if test "$gl_cv_next_stdarg_h" = '""'; then
- gl_cv_next_stdarg_h='"///usr/include/stdarg.h"'
- NEXT_STDARG_H="$gl_cv_next_stdarg_h"
- fi
- else
- dnl Provide a substitute in <config.h>, either __va_copy or as a simple
- dnl assignment.
- gl_CACHE_VAL_SILENT([gl_cv_func___va_copy], [
- AC_COMPILE_IFELSE(
- [AC_LANG_PROGRAM(
- [[#include <stdarg.h>]],
- [[
-#ifndef __va_copy
-error, bail out
-#endif
- ]])],
- [gl_cv_func___va_copy=yes],
- [gl_cv_func___va_copy=no])])
- if test $gl_cv_func___va_copy = yes; then
- AC_DEFINE([va_copy], [__va_copy],
- [Define as a macro for copying va_list variables.])
- else
- AH_VERBATIM([gl_VA_COPY], [/* A replacement for va_copy, if needed. */
-#define gl_va_copy(a,b) ((a) = (b))])
- AC_DEFINE([va_copy], [gl_va_copy],
- [Define as a macro for copying va_list variables.])
- fi
- fi
- fi
- AC_SUBST([STDARG_H])
- AM_CONDITIONAL([GL_GENERATE_STDARG_H], [test -n "$STDARG_H"])
- AC_SUBST([NEXT_STDARG_H])
-])
diff --git a/m4/stdbool.m4 b/m4/stdbool.m4
deleted file mode 100644
index 006ed52de5d..00000000000
--- a/m4/stdbool.m4
+++ /dev/null
@@ -1,100 +0,0 @@
-# Check for stdbool.h that conforms to C99.
-
-dnl Copyright (C) 2002-2006, 2009-2014 Free Software Foundation, Inc.
-dnl This file is free software; the Free Software Foundation
-dnl gives unlimited permission to copy and/or distribute it,
-dnl with or without modifications, as long as this notice is preserved.
-
-#serial 5
-
-# Prepare for substituting <stdbool.h> if it is not supported.
-
-AC_DEFUN([AM_STDBOOL_H],
-[
- AC_REQUIRE([AC_CHECK_HEADER_STDBOOL])
-
- # Define two additional variables used in the Makefile substitution.
-
- if test "$ac_cv_header_stdbool_h" = yes; then
- STDBOOL_H=''
- else
- STDBOOL_H='stdbool.h'
- fi
- AC_SUBST([STDBOOL_H])
- AM_CONDITIONAL([GL_GENERATE_STDBOOL_H], [test -n "$STDBOOL_H"])
-
- if test "$ac_cv_type__Bool" = yes; then
- HAVE__BOOL=1
- else
- HAVE__BOOL=0
- fi
- AC_SUBST([HAVE__BOOL])
-])
-
-# AM_STDBOOL_H will be renamed to gl_STDBOOL_H in the future.
-AC_DEFUN([gl_STDBOOL_H], [AM_STDBOOL_H])
-
-# This version of the macro is needed in autoconf <= 2.68.
-
-AC_DEFUN([AC_CHECK_HEADER_STDBOOL],
- [AC_CACHE_CHECK([for stdbool.h that conforms to C99],
- [ac_cv_header_stdbool_h],
- [AC_COMPILE_IFELSE(
- [AC_LANG_PROGRAM(
- [[
- #include <stdbool.h>
- #ifndef bool
- "error: bool is not defined"
- #endif
- #ifndef false
- "error: false is not defined"
- #endif
- #if false
- "error: false is not 0"
- #endif
- #ifndef true
- "error: true is not defined"
- #endif
- #if true != 1
- "error: true is not 1"
- #endif
- #ifndef __bool_true_false_are_defined
- "error: __bool_true_false_are_defined is not defined"
- #endif
-
- struct s { _Bool s: 1; _Bool t; } s;
-
- char a[true == 1 ? 1 : -1];
- char b[false == 0 ? 1 : -1];
- char c[__bool_true_false_are_defined == 1 ? 1 : -1];
- char d[(bool) 0.5 == true ? 1 : -1];
- /* See body of main program for 'e'. */
- char f[(_Bool) 0.0 == false ? 1 : -1];
- char g[true];
- char h[sizeof (_Bool)];
- char i[sizeof s.t];
- enum { j = false, k = true, l = false * true, m = true * 256 };
- /* The following fails for
- HP aC++/ANSI C B3910B A.05.55 [Dec 04 2003]. */
- _Bool n[m];
- char o[sizeof n == m * sizeof n[0] ? 1 : -1];
- char p[-1 - (_Bool) 0 < 0 && -1 - (bool) 0 < 0 ? 1 : -1];
- /* Catch a bug in an HP-UX C compiler. See
- http://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html
- http://lists.gnu.org/archive/html/bug-coreutils/2005-11/msg00161.html
- */
- _Bool q = true;
- _Bool *pq = &q;
- ]],
- [[
- bool e = &s;
- *pq |= q;
- *pq |= ! q;
- /* Refer to every declared value, to avoid compiler optimizations. */
- return (!a + !b + !c + !d + !e + !f + !g + !h + !i + !!j + !k + !!l
- + !m + !n + !o + !p + !q + !pq);
- ]])],
- [ac_cv_header_stdbool_h=yes],
- [ac_cv_header_stdbool_h=no])])
- AC_CHECK_TYPES([_Bool])
-])