blob: ae5dc0957a1eb3eef726c60a0edefc8dd757bc99 [file] [log] [blame]
# Copyright (C) Igor Sysoev
# Copyright (C) NGINX, Inc.
# C language features.
njs_feature="GCC unsigned __int128"
njs_feature_name=NJS_HAVE_UNSIGNED_INT128
njs_feature_run=no
njs_feature_incs=
njs_feature_libs=
njs_feature_test="int main(void) {
unsigned __int128 p = 0;
return (int) p;
}"
. auto/feature
njs_feature="GCC __builtin_expect()"
njs_feature_name=NJS_HAVE_BUILTIN_EXPECT
njs_feature_run=no
njs_feature_incs=
njs_feature_libs=
njs_feature_test="int main(int argc, char *const *argv) {
if ((__typeof__(argc == 0))
__builtin_expect((argc == 0), 0))
return 0;
return 1;
}"
. auto/feature
njs_feature="GCC __builtin_unreachable()"
njs_feature_name=NJS_HAVE_BUILTIN_UNREACHABLE
njs_feature_run=no
njs_feature_incs=
njs_feature_libs=
njs_feature_test="int main(void) {
__builtin_unreachable();
}"
. auto/feature
njs_feature="GCC __builtin_prefetch()"
njs_feature_name=NJS_HAVE_BUILTIN_PREFETCH
njs_feature_run=no
njs_feature_incs=
njs_feature_libs=
njs_feature_test="int main(void) {
__builtin_prefetch(0);
return 0;
}"
. auto/feature
njs_feature="GCC __builtin_clz()"
njs_feature_name=NJS_HAVE_BUILTIN_CLZ
njs_feature_run=no
njs_feature_incs=
njs_feature_libs=
njs_feature_test="int main(void) {
if (__builtin_clz(1) != 31) {
return 1;
}
return 0;
}"
. auto/feature
njs_feature="GCC __builtin_clzll()"
njs_feature_name=NJS_HAVE_BUILTIN_CLZLL
njs_feature_run=no
njs_feature_incs=
njs_feature_libs=
njs_feature_test="int main(void) {
if (__builtin_clzll(1ULL) != 63) {
return 1;
}
return 0;
}"
. auto/feature
njs_feature="GCC __attribute__ visibility"
njs_feature_name=NJS_HAVE_GCC_ATTRIBUTE_VISIBILITY
njs_feature_run=no
njs_feature_path=
njs_feature_libs=
njs_feature_test="int n __attribute__ ((visibility(\"default\")));
int main(void) {
return 0;
}"
. auto/feature
njs_feature="GCC __attribute__ malloc"
njs_feature_name=NJS_HAVE_GCC_ATTRIBUTE_MALLOC
njs_feature_run=no
njs_feature_path=
njs_feature_libs=
njs_feature_test="#include <stdlib.h>
void *f(void) __attribute__ ((__malloc__));
void *f(void) {
return malloc(1);
}
int main(void) {
if (f() != NULL) {
return 1;
}
return 0;
}"
. auto/feature
njs_feature="GCC __attribute__ aligned"
njs_feature_name=NJS_HAVE_GCC_ATTRIBUTE_ALIGNED
njs_feature_run=no
njs_feature_path=
njs_feature_libs=
njs_feature_test="int n __attribute__ ((aligned(64)));
int main(void) {
return 0;
}"
. auto/feature
njs_feature="Address sanitizer"
njs_feature_name=NJS_HAVE_ADDRESS_SANITIZER
njs_feature_run=no
njs_feature_path=
njs_feature_libs=
njs_feature_test="int main(void) {
return
#ifdef __SANITIZE_ADDRESS__
0;
#else
#if defined(__has_feature)
#if __has_feature(address_sanitizer)
0;
#endif
#endif
#endif
}"
. auto/feature
njs_feature="Memory sanitizer"
njs_feature_name=NJS_HAVE_MEMORY_SANITIZER
njs_feature_run=yes
njs_feature_incs=
njs_feature_libs=
njs_feature_test="#include <sanitizer/msan_interface.h>
int main(int argc, char *argv[]) {
__msan_unpoison(argv, sizeof(char *));
return 0;
}"
. auto/feature
njs_feature="_mm_setcsr()"
njs_feature_name=NJS_HAVE_DENORMALS_CONTROL
njs_feature_run=no
njs_feature_incs=
njs_feature_libs=
njs_feature_test="#include <xmmintrin.h>
int main(void) {
_mm_setcsr(_mm_getcsr());
return 0;
}"
. auto/feature