diff options
author | Ton Voon <tonvoon@users.sourceforge.net> | 2006-05-25 12:33:24 +0000 |
---|---|---|
committer | Ton Voon <tonvoon@users.sourceforge.net> | 2006-05-25 12:33:24 +0000 |
commit | 5fd2550d4c96318b2de4a4a44e15e3c50c268e79 (patch) | |
tree | b712838611281a444a9b603949352bc4003de657 /m4/restrict.m4 | |
parent | 80e155c9cf826d977393ee130a07be599401335e (diff) | |
download | monitoring-plugins-5fd2550d4c96318b2de4a4a44e15e3c50c268e79.tar.gz |
Use coreutils' regexp libraries, so regexp always available now
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1403 f882894a-f735-0410-b71e-b25c423dba1c
Diffstat (limited to 'm4/restrict.m4')
-rw-r--r-- | m4/restrict.m4 | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/m4/restrict.m4 b/m4/restrict.m4 new file mode 100644 index 00000000..1f3bbb92 --- /dev/null +++ b/m4/restrict.m4 | |||
@@ -0,0 +1,38 @@ | |||
1 | #serial 1003 | ||
2 | dnl Copyright (C) 2003 Free Software Foundation, Inc. | ||
3 | dnl This file is free software; the Free Software Foundation | ||
4 | dnl gives unlimited permission to copy and/or distribute it, | ||
5 | dnl with or without modifications, as long as this notice is preserved. | ||
6 | |||
7 | # This macro can be removed once we can rely on Autoconf 2.57a or later, | ||
8 | # since we can then use its AC_C_RESTRICT. | ||
9 | |||
10 | # gl_C_RESTRICT | ||
11 | # -------------- | ||
12 | # Determine whether the C/C++ compiler supports the "restrict" keyword | ||
13 | # introduced in ANSI C99, or an equivalent. Do nothing if the compiler | ||
14 | # accepts it. Otherwise, if the compiler supports an equivalent, | ||
15 | # define "restrict" to be that. Here are some variants: | ||
16 | # - GCC supports both __restrict and __restrict__ | ||
17 | # - older DEC Alpha C compilers support only __restrict | ||
18 | # - _Restrict is the only spelling accepted by Sun WorkShop 6 update 2 C | ||
19 | # Otherwise, define "restrict" to be empty. | ||
20 | AC_DEFUN([gl_C_RESTRICT], | ||
21 | [AC_CACHE_CHECK([for C/C++ restrict keyword], gl_cv_c_restrict, | ||
22 | [gl_cv_c_restrict=no | ||
23 | # Try the official restrict keyword, then gcc's __restrict, and | ||
24 | # the less common variants. | ||
25 | for ac_kw in restrict __restrict __restrict__ _Restrict; do | ||
26 | AC_COMPILE_IFELSE([AC_LANG_SOURCE( | ||
27 | [float * $ac_kw x;])], | ||
28 | [gl_cv_c_restrict=$ac_kw; break]) | ||
29 | done | ||
30 | ]) | ||
31 | case $gl_cv_c_restrict in | ||
32 | restrict) ;; | ||
33 | no) AC_DEFINE(restrict,, | ||
34 | [Define to equivalent of C99 restrict keyword, or to nothing if this | ||
35 | is not supported. Do not define if restrict is supported directly.]) ;; | ||
36 | *) AC_DEFINE_UNQUOTED(restrict, $gl_cv_c_restrict) ;; | ||
37 | esac | ||
38 | ]) | ||