mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-04-29 19:30:36 +02:00
Modernizes labels-as-values.m4
labels-as-values.m4 uses deprecated AC_TRY_COMPILE and has a K&R-type C function declaration * m4/labels-as-values.m4: updated
This commit is contained in:
parent
e75b13d18a
commit
52ea50e9c6
1 changed files with 6 additions and 7 deletions
|
@ -1,19 +1,18 @@
|
|||
dnl check for gcc's "labels as values" feature
|
||||
AC_DEFUN([AC_C_LABELS_AS_VALUES],
|
||||
[AC_CACHE_CHECK([labels as values], ac_cv_labels_as_values,
|
||||
[AC_TRY_COMPILE([
|
||||
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
|
||||
int foo(int);
|
||||
int foo(i)
|
||||
int i; {
|
||||
int foo(int i) {
|
||||
static void *label[] = { &&l1, &&l2 };
|
||||
goto *label[i];
|
||||
l1: return 1;
|
||||
l2: return 2;
|
||||
}
|
||||
],
|
||||
[int i;],
|
||||
ac_cv_labels_as_values=yes,
|
||||
ac_cv_labels_as_values=no)])
|
||||
]],
|
||||
[[foo(1);]])],
|
||||
[ac_cv_labels_as_values=yes],
|
||||
[ac_cv_labels_as_values=no])])
|
||||
if test "$ac_cv_labels_as_values" = yes; then
|
||||
AC_DEFINE([HAVE_LABELS_AS_VALUES], [],
|
||||
[Define if compiler supports gcc's "labels as values" (aka computed goto)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue