Merge remote-tracking branch 'origin/stable-2.0'
[bpt/guile.git] / m4 / labels-as-values.m4
... / ...
CommitLineData
1dnl check for gcc's "labels as values" feature
2AC_DEFUN([AC_C_LABELS_AS_VALUES],
3[AC_CACHE_CHECK([labels as values], ac_cv_labels_as_values,
4[AC_TRY_COMPILE([
5int foo(int);
6int foo(i)
7int i; {
8static void *label[] = { &&l1, &&l2 };
9goto *label[i];
10l1: return 1;
11l2: return 2;
12}
13],
14[int i;],
15ac_cv_labels_as_values=yes,
16ac_cv_labels_as_values=no)])
17if test "$ac_cv_labels_as_values" = yes; then
18AC_DEFINE([HAVE_LABELS_AS_VALUES], [],
19 [Define if compiler supports gcc's "labels as values" (aka computed goto)
20 feature, used to speed up instruction dispatch in the interpreter.])
21fi
22])