summaryrefslogtreecommitdiffstats
path: root/gettext-tools
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2007-05-14 22:14:51 +0000
committerBruno Haible <bruno@clisp.org>2009-06-23 12:14:48 +0200
commit8cab443cf22ac7ca0c2158436ec55f275753a128 (patch)
treeb30cb4a7e722482576f6d17463ef6b7df4eb7475 /gettext-tools
parentad7ca9cb230a54950d9cc5c0bdd8d6d91d6aa742 (diff)
downloadexternal_gettext-8cab443cf22ac7ca0c2158436ec55f275753a128.zip
external_gettext-8cab443cf22ac7ca0c2158436ec55f275753a128.tar.gz
external_gettext-8cab443cf22ac7ca0c2158436ec55f275753a128.tar.bz2
Override of AC_C_RESTRICT.
Diffstat (limited to 'gettext-tools')
-rw-r--r--gettext-tools/m4/ChangeLog5
-rw-r--r--gettext-tools/m4/Makefile.am1
-rw-r--r--gettext-tools/m4/restrict.m437
3 files changed, 43 insertions, 0 deletions
diff --git a/gettext-tools/m4/ChangeLog b/gettext-tools/m4/ChangeLog
index ec1e969..4ad9bef 100644
--- a/gettext-tools/m4/ChangeLog
+++ b/gettext-tools/m4/ChangeLog
@@ -1,3 +1,8 @@
+2007-05-14 Bruno Haible <bruno@clisp.org>
+
+ * restrict.m4: New file, taken from autoconf CVS.
+ * Makefile.am (EXTRA_DIST): Add it.
+
2007-04-06 Bruno Haible <bruno@clisp.org>
* Makefile.am (aclocal_DATA): Remove longdouble.m4.
diff --git a/gettext-tools/m4/Makefile.am b/gettext-tools/m4/Makefile.am
index 3fe247a..18c7ba5 100644
--- a/gettext-tools/m4/Makefile.am
+++ b/gettext-tools/m4/Makefile.am
@@ -49,5 +49,6 @@ libgrep.m4 \
locale-ja.m4 \
openmp.m4 \
regex.m4 \
+restrict.m4 \
setlocale.m4 \
siginfo.m4
diff --git a/gettext-tools/m4/restrict.m4 b/gettext-tools/m4/restrict.m4
new file mode 100644
index 0000000..6e4f040
--- /dev/null
+++ b/gettext-tools/m4/restrict.m4
@@ -0,0 +1,37 @@
+# restrict.m4 serial 1 (gettext-0.16.2)
+dnl Copyright (C) 2007 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 This file overrides the AC_C_RESTRICT macro from autoconf 2.60..2.61,
+dnl so that mixed use of GNU C and GNU C++ works.
+dnl This file can be removed once autoconf >= 2.62 can be assumed.
+
+AC_DEFUN([AC_C_RESTRICT],
+[AC_CACHE_CHECK([for C/C++ restrict keyword], ac_cv_c_restrict,
+ [ac_cv_c_restrict=no
+ # Try the official restrict keyword, then gcc's __restrict, and
+ # the less common variants.
+ for ac_kw in __restrict __restrict__ _Restrict restrict; do
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
+ [[typedef int * int_ptr;
+ int foo (int_ptr $ac_kw ip) {
+ return ip[0];
+ }]],
+ [[int s[1];
+ int * $ac_kw t = s;
+ t[0] = 0;
+ return foo(t)]])],
+ [ac_cv_c_restrict=$ac_kw])
+ test "$ac_cv_c_restrict" != no && break
+ done
+ ])
+ case $ac_cv_c_restrict in
+ restrict) ;;
+ no) AC_DEFINE(restrict,,
+ [Define to equivalent of C99 restrict keyword, or to nothing if this
+ is not supported. Do not define if restrict is supported directly.]) ;;
+ *) AC_DEFINE_UNQUOTED(restrict, $ac_cv_c_restrict) ;;
+ esac
+])# AC_C_RESTRICT