File tree Expand file tree Collapse file tree 2 files changed +22
-0
lines changed Expand file tree Collapse file tree 2 files changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -405,3 +405,23 @@ AC_LINK_IFELSE([AC_LANG_PROGRAM([[
405
405
if test "$ac_cv_cpuid_count_available" = "yes"; then
406
406
AC_DEFINE ( [ HAVE_CPUID_COUNT] , 1 , [ whether __cpuid_count is available] )
407
407
fi
408
+
409
+ AC_MSG_CHECKING ( whether statement attribute assume is available )
410
+
411
+ AC_COMPILE_IFELSE ( [ AC_LANG_PROGRAM ( [ [
412
+ struct Foo {
413
+ int bar;
414
+ };
415
+ void foo(struct Foo *foo) {
416
+ __attribute__((assume(foo->bar != 0)));
417
+ }
418
+ ] ] , [ [
419
+ ] ] ) ] , [
420
+ HAVE_STATEMENT_ATTRIBUTE_ASSUME=yes
421
+ ] , [
422
+ HAVE_STATEMENT_ATTRIBUTE_ASSUME=no
423
+ ] )
424
+ if test "$HAVE_STATEMENT_ATTRIBUTE_ASSUME" = "yes"; then
425
+ AC_DEFINE ( [ HAVE_STATEMENT_ATTRIBUTE_ASSUME] , 1 , [ whether statement attribute assume is available] )
426
+ fi
427
+ AC_MSG_RESULT ( $HAVE_STATEMENT_ATTRIBUTE_ASSUME )
Original file line number Diff line number Diff line change 89
89
90
90
#if defined(ZEND_WIN32) && !defined(__clang__)
91
91
# define ZEND_ASSUME (c ) __assume(c)
92
+ #elif HAVE_STATEMENT_ATTRIBUTE_ASSUME
93
+ # define ZEND_ASSUME (c ) __attribute__((assume(c)))
92
94
#elif defined(__clang__) && __has_builtin(__builtin_assume)
93
95
# pragma clang diagnostic ignored "-Wassume"
94
96
# define ZEND_ASSUME (c ) __builtin_assume(c)
You can’t perform that action at this time.
0 commit comments