File tree 5 files changed +65
-0
lines changed
5 files changed +65
-0
lines changed Original file line number Diff line number Diff line change @@ -273,6 +273,30 @@ fi])# PGAC_C_BUILTIN_UNREACHABLE
273
273
274
274
275
275
276
+ # PGAC_C_COMPUTED_GOTO
277
+ # -----------------------
278
+ # Check if the C compiler knows computed gotos (gcc extension, also
279
+ # available in at least clang). If so, define HAVE_COMPUTED_GOTO.
280
+ #
281
+ # Checking whether computed gotos are supported syntax-wise ought to
282
+ # be enough, as the syntax is otherwise illegal.
283
+ AC_DEFUN ( [ PGAC_C_COMPUTED_GOTO] ,
284
+ [ AC_CACHE_CHECK ( for computed goto support , pgac_cv_computed_goto ,
285
+ [ AC_COMPILE_IFELSE ( [ AC_LANG_PROGRAM ( [ ] ,
286
+ [ [ void *labeladdrs[ ] = {&&my_label};
287
+ goto *labeladdrs[ 0] ;
288
+ my_label:
289
+ return 1;
290
+ ] ] ) ] ,
291
+ [ pgac_cv_computed_goto=yes] ,
292
+ [ pgac_cv_computed_goto=no] ) ] )
293
+ if test x"$pgac_cv_computed_goto" = xyes ; then
294
+ AC_DEFINE ( HAVE_COMPUTED_GOTO , 1 ,
295
+ [ Define to 1 if your compiler handles computed gotos.] )
296
+ fi] ) # PGAC_C_COMPUTED_GOTO
297
+
298
+
299
+
276
300
# PGAC_C_VA_ARGS
277
301
# --------------
278
302
# Check if the C compiler understands C99-style variadic macros,
Original file line number Diff line number Diff line change @@ -11531,6 +11531,40 @@ if test x"$pgac_cv__builtin_unreachable" = xyes ; then
11531
11531
11532
11532
$as_echo " #define HAVE__BUILTIN_UNREACHABLE 1" >> confdefs.h
11533
11533
11534
+ fi
11535
+ { $as_echo " $as_me :${as_lineno-$LINENO } : checking for computed goto support" >&5
11536
+ $as_echo_n " checking for computed goto support... " >&6 ; }
11537
+ if ${pgac_cv_computed_goto+: } false ; then :
11538
+ $as_echo_n " (cached) " >&6
11539
+ else
11540
+ cat confdefs.h - << _ACEOF >conftest.$ac_ext
11541
+ /* end confdefs.h. */
11542
+
11543
+ int
11544
+ main ()
11545
+ {
11546
+ void *labeladdrs[] = {&&my_label};
11547
+ goto *labeladdrs[0];
11548
+ my_label:
11549
+ return 1;
11550
+
11551
+ ;
11552
+ return 0;
11553
+ }
11554
+ _ACEOF
11555
+ if ac_fn_c_try_compile " $LINENO " ; then :
11556
+ pgac_cv_computed_goto=yes
11557
+ else
11558
+ pgac_cv_computed_goto=no
11559
+ fi
11560
+ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
11561
+ fi
11562
+ { $as_echo " $as_me :${as_lineno-$LINENO } : result: $pgac_cv_computed_goto " >&5
11563
+ $as_echo " $pgac_cv_computed_goto " >&6 ; }
11564
+ if test x" $pgac_cv_computed_goto " = xyes ; then
11565
+
11566
+ $as_echo " #define HAVE_COMPUTED_GOTO 1" >> confdefs.h
11567
+
11534
11568
fi
11535
11569
{ $as_echo " $as_me :${as_lineno-$LINENO } : checking for __VA_ARGS__" >&5
11536
11570
$as_echo_n " checking for __VA_ARGS__... " >&6 ; }
Original file line number Diff line number Diff line change @@ -1322,6 +1322,7 @@ PGAC_C_BUILTIN_BSWAP32
1322
1322
PGAC_C_BUILTIN_BSWAP64
1323
1323
PGAC_C_BUILTIN_CONSTANT_P
1324
1324
PGAC_C_BUILTIN_UNREACHABLE
1325
+ PGAC_C_COMPUTED_GOTO
1325
1326
PGAC_C_VA_ARGS
1326
1327
PGAC_STRUCT_TIMEZONE
1327
1328
PGAC_UNION_SEMUN
Original file line number Diff line number Diff line change 108
108
/* Define to 1 if you have the `clock_gettime' function. */
109
109
#undef HAVE_CLOCK_GETTIME
110
110
111
+ /* Define to 1 if your compiler handles computed gotos. */
112
+ #undef HAVE_COMPUTED_GOTO
113
+
111
114
/* Define to 1 if you have the <crtdefs.h> header file. */
112
115
#undef HAVE_CRTDEFS_H
113
116
Original file line number Diff line number Diff line change 78
78
/* Define to 1 if you have the `clock_gettime' function. */
79
79
/* #undef HAVE_CLOCK_GETTIME */
80
80
81
+ /* Define to 1 if your compiler handles computed gotos. */
82
+ /* #undef HAVE_COMPUTED_GOTO */
83
+
81
84
/* Define to 1 if you have the `crypt' function. */
82
85
/* #undef HAVE_CRYPT */
83
86
You can’t perform that action at this time.
0 commit comments