File tree Expand file tree Collapse file tree 5 files changed +65
-0
lines changed
Expand file tree Collapse file tree 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
273273
274274
275275
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+
276300# PGAC_C_VA_ARGS
277301# --------------
278302# 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
1153111531
1153211532$as_echo " #define HAVE__BUILTIN_UNREACHABLE 1" >> confdefs.h
1153311533
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+
1153411568fi
1153511569{ $as_echo " $as_me :${as_lineno-$LINENO } : checking for __VA_ARGS__" >&5
1153611570$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
13221322PGAC_C_BUILTIN_BSWAP64
13231323PGAC_C_BUILTIN_CONSTANT_P
13241324PGAC_C_BUILTIN_UNREACHABLE
1325+ PGAC_C_COMPUTED_GOTO
13251326PGAC_C_VA_ARGS
13261327PGAC_STRUCT_TIMEZONE
13271328PGAC_UNION_SEMUN
Original file line number Diff line number Diff line change 108108/* Define to 1 if you have the `clock_gettime' function. */
109109#undef HAVE_CLOCK_GETTIME
110110
111+ /* Define to 1 if your compiler handles computed gotos. */
112+ #undef HAVE_COMPUTED_GOTO
113+
111114/* Define to 1 if you have the <crtdefs.h> header file. */
112115#undef HAVE_CRTDEFS_H
113116
Original file line number Diff line number Diff line change 7878/* Define to 1 if you have the `clock_gettime' function. */
7979/* #undef HAVE_CLOCK_GETTIME */
8080
81+ /* Define to 1 if your compiler handles computed gotos. */
82+ /* #undef HAVE_COMPUTED_GOTO */
83+
8184/* Define to 1 if you have the `crypt' function. */
8285/* #undef HAVE_CRYPT */
8386
You can’t perform that action at this time.
0 commit comments