Fixed main() prototypes in auto tests.
Future releases of GCC are planning to remove[0] default support for
some old features that were removed from C99 but GCC still accepts.
We can test for these changes by using the following -Werror=
directives
-Werror=implicit-int
-Werror=implicit-function-declaration
-Werror=int-conversion
-Werror=strict-prototypes
-Werror=old-style-definition
Doing so revealed an issue with the auto/ tests in that the test
programs always define main as
int main()
rather than
int main(void)
which results in a bunch of errors like
build/autotest.c:3:23: error: function declaration isn't a prototype [-Werror=strict-prototypes]
3 | int main() {
| ^~~~
build/autotest.c: In function 'main':
build/autotest.c:3:23: error: old-style function definition [-Werror=old-style-definition]
The fix was easy, it only required fixing the main prototype with
find -type f -exec sed -i 's/int main() {/int main(void) {/g' {} \;
Regardless of these upcoming GCC changes, this is probably a good thing
to do anyway for correctness.
[0]: https://fedoraproject.org/wiki/Changes/PortingToModernC
Link: <https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/message/CJXKTLXJUPZ4F2C2VQOTNMEA5JAUPMBD/>
Link: <https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/message/6SGHPHPAXKCVJ6PUZ57WVDQ5TDBVIRMF/>
Reviewed-by: Alejandro Colomar <alx@nginx.com>
Signed-off-by: Andrew Clayton <a.clayton@nginx.com>
This commit is contained in:
@@ -10,7 +10,7 @@ nxt_feature_name=NXT_HAVE_GCC_ATOMIC
|
|||||||
nxt_feature_run=yes
|
nxt_feature_run=yes
|
||||||
nxt_feature_incs=
|
nxt_feature_incs=
|
||||||
nxt_feature_libs=
|
nxt_feature_libs=
|
||||||
nxt_feature_test="int main() {
|
nxt_feature_test="int main(void) {
|
||||||
long n = 0;
|
long n = 0;
|
||||||
|
|
||||||
if (!__sync_bool_compare_and_swap(&n, 0, 3))
|
if (!__sync_bool_compare_and_swap(&n, 0, 3))
|
||||||
@@ -44,7 +44,7 @@ if [ $nxt_found = no ]; then
|
|||||||
nxt_feature_libs=
|
nxt_feature_libs=
|
||||||
nxt_feature_test="#include <atomic.h>
|
nxt_feature_test="#include <atomic.h>
|
||||||
|
|
||||||
int main() {
|
int main(void) {
|
||||||
ulong_t n = 0;
|
ulong_t n = 0;
|
||||||
|
|
||||||
if (atomic_cas_ulong(&n, 0, 3) != 0)
|
if (atomic_cas_ulong(&n, 0, 3) != 0)
|
||||||
@@ -70,7 +70,7 @@ fi
|
|||||||
if [ $nxt_found = no ]; then
|
if [ $nxt_found = no ]; then
|
||||||
|
|
||||||
if [ $NXT_64BIT = 1 ]; then
|
if [ $NXT_64BIT = 1 ]; then
|
||||||
nxt_feature_test="int main() {
|
nxt_feature_test="int main(void) {
|
||||||
long n = 0;
|
long n = 0;
|
||||||
long o = 0;
|
long o = 0;
|
||||||
|
|
||||||
@@ -87,7 +87,7 @@ if [ $nxt_found = no ]; then
|
|||||||
return 0;
|
return 0;
|
||||||
}"
|
}"
|
||||||
else
|
else
|
||||||
nxt_feature_test="int main() {
|
nxt_feature_test="int main(void) {
|
||||||
int n = 0;
|
int n = 0;
|
||||||
int o = 0;
|
int o = 0;
|
||||||
|
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ nxt_feature_test="#include <linux/capability.h>
|
|||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <sys/syscall.h>
|
#include <sys/syscall.h>
|
||||||
|
|
||||||
int main() {
|
int main(void) {
|
||||||
struct __user_cap_header_struct hdr;
|
struct __user_cap_header_struct hdr;
|
||||||
hdr.version = _LINUX_CAPABILITY_VERSION;
|
hdr.version = _LINUX_CAPABILITY_VERSION;
|
||||||
syscall(SYS_capget, &hdr, 0);
|
syscall(SYS_capget, &hdr, 0);
|
||||||
|
|||||||
20
auto/clang
20
auto/clang
@@ -14,7 +14,7 @@ nxt_feature_libs=
|
|||||||
nxt_feature_test="#include <stdio.h>
|
nxt_feature_test="#include <stdio.h>
|
||||||
#define set(dummy, ...) sprintf(__VA_ARGS__)
|
#define set(dummy, ...) sprintf(__VA_ARGS__)
|
||||||
|
|
||||||
int main() {
|
int main(void) {
|
||||||
char buf[4];
|
char buf[4];
|
||||||
|
|
||||||
buf[0] = '0';
|
buf[0] = '0';
|
||||||
@@ -37,7 +37,7 @@ if [ $nxt_found = no ]; then
|
|||||||
nxt_feature_test="#include <stdio.h>
|
nxt_feature_test="#include <stdio.h>
|
||||||
#define set(dummy, args...) sprintf(args)
|
#define set(dummy, args...) sprintf(args)
|
||||||
|
|
||||||
int main() {
|
int main(void) {
|
||||||
char buf[4];
|
char buf[4];
|
||||||
|
|
||||||
buf[0] = '0';
|
buf[0] = '0';
|
||||||
@@ -70,7 +70,7 @@ nxt_feature_name=NXT_HAVE_BUILTIN_UNREACHABLE
|
|||||||
nxt_feature_run=no
|
nxt_feature_run=no
|
||||||
nxt_feature_incs=
|
nxt_feature_incs=
|
||||||
nxt_feature_libs=
|
nxt_feature_libs=
|
||||||
nxt_feature_test="int main() {
|
nxt_feature_test="int main(void) {
|
||||||
__builtin_unreachable();
|
__builtin_unreachable();
|
||||||
}"
|
}"
|
||||||
. auto/feature
|
. auto/feature
|
||||||
@@ -81,7 +81,7 @@ nxt_feature_name=NXT_HAVE_BUILTIN_PREFETCH
|
|||||||
nxt_feature_run=no
|
nxt_feature_run=no
|
||||||
nxt_feature_incs=
|
nxt_feature_incs=
|
||||||
nxt_feature_libs=
|
nxt_feature_libs=
|
||||||
nxt_feature_test="int main() {
|
nxt_feature_test="int main(void) {
|
||||||
__builtin_prefetch(0);
|
__builtin_prefetch(0);
|
||||||
return 0;
|
return 0;
|
||||||
}"
|
}"
|
||||||
@@ -93,7 +93,7 @@ nxt_feature_name=NXT_HAVE_BUILTIN_CLZ
|
|||||||
nxt_feature_run=
|
nxt_feature_run=
|
||||||
nxt_feature_incs=
|
nxt_feature_incs=
|
||||||
nxt_feature_libs=
|
nxt_feature_libs=
|
||||||
nxt_feature_test="int main() {
|
nxt_feature_test="int main(void) {
|
||||||
if (__builtin_clz(1) == 31)
|
if (__builtin_clz(1) == 31)
|
||||||
return 0;
|
return 0;
|
||||||
return 1;
|
return 1;
|
||||||
@@ -106,7 +106,7 @@ nxt_feature_name=NXT_HAVE_BUILTIN_POPCOUNT
|
|||||||
nxt_feature_run=
|
nxt_feature_run=
|
||||||
nxt_feature_incs=
|
nxt_feature_incs=
|
||||||
nxt_feature_libs=
|
nxt_feature_libs=
|
||||||
nxt_feature_test="int main() {
|
nxt_feature_test="int main(void) {
|
||||||
if (__builtin_popcount(5) == 2)
|
if (__builtin_popcount(5) == 2)
|
||||||
return 0;
|
return 0;
|
||||||
return 1;
|
return 1;
|
||||||
@@ -121,7 +121,7 @@ nxt_feature_incs=
|
|||||||
nxt_feature_libs=
|
nxt_feature_libs=
|
||||||
nxt_feature_test="int n __attribute__ ((visibility(\"default\")));
|
nxt_feature_test="int n __attribute__ ((visibility(\"default\")));
|
||||||
|
|
||||||
int main() {
|
int main(void) {
|
||||||
return 1;
|
return 1;
|
||||||
}"
|
}"
|
||||||
. auto/feature
|
. auto/feature
|
||||||
@@ -134,7 +134,7 @@ nxt_feature_incs=
|
|||||||
nxt_feature_libs=
|
nxt_feature_libs=
|
||||||
nxt_feature_test="int n __attribute__ ((aligned(64)));
|
nxt_feature_test="int n __attribute__ ((aligned(64)));
|
||||||
|
|
||||||
int main() {
|
int main(void) {
|
||||||
return 1;
|
return 1;
|
||||||
}"
|
}"
|
||||||
. auto/feature
|
. auto/feature
|
||||||
@@ -153,7 +153,7 @@ nxt_feature_test="#include <stdlib.h>
|
|||||||
return malloc(1);
|
return malloc(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
int main() {
|
int main(void) {
|
||||||
if (f() != NULL) {
|
if (f() != NULL) {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
@@ -172,7 +172,7 @@ nxt_feature_test="struct s {
|
|||||||
int i;
|
int i;
|
||||||
} __attribute__ ((__packed__));
|
} __attribute__ ((__packed__));
|
||||||
|
|
||||||
int main() {
|
int main(void) {
|
||||||
return 1;
|
return 1;
|
||||||
}"
|
}"
|
||||||
. auto/feature
|
. auto/feature
|
||||||
|
|||||||
16
auto/events
16
auto/events
@@ -13,7 +13,7 @@ nxt_feature_libs=
|
|||||||
nxt_feature_test="#include <sys/epoll.h>
|
nxt_feature_test="#include <sys/epoll.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
int main() {
|
int main(void) {
|
||||||
int n;
|
int n;
|
||||||
|
|
||||||
n = epoll_create(1);
|
n = epoll_create(1);
|
||||||
@@ -34,7 +34,7 @@ if [ $nxt_found = yes ]; then
|
|||||||
#include <sys/signalfd.h>
|
#include <sys/signalfd.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
int main() {
|
int main(void) {
|
||||||
int n;
|
int n;
|
||||||
sigset_t mask;
|
sigset_t mask;
|
||||||
|
|
||||||
@@ -54,7 +54,7 @@ if [ $nxt_found = yes ]; then
|
|||||||
nxt_feature_test="#include <sys/eventfd.h>
|
nxt_feature_test="#include <sys/eventfd.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
int main() {
|
int main(void) {
|
||||||
int n;
|
int n;
|
||||||
|
|
||||||
n = eventfd(0, 0);
|
n = eventfd(0, 0);
|
||||||
@@ -79,7 +79,7 @@ nxt_feature_test="#include <sys/types.h>
|
|||||||
#include <sys/event.h>
|
#include <sys/event.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
int main() {
|
int main(void) {
|
||||||
int n;
|
int n;
|
||||||
|
|
||||||
n = kqueue();
|
n = kqueue();
|
||||||
@@ -100,7 +100,7 @@ if [ $nxt_found = yes ]; then
|
|||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/event.h>
|
#include <sys/event.h>
|
||||||
|
|
||||||
int main() {
|
int main(void) {
|
||||||
struct kevent kev;
|
struct kevent kev;
|
||||||
|
|
||||||
kev.filter = EVFILT_USER;
|
kev.filter = EVFILT_USER;
|
||||||
@@ -124,7 +124,7 @@ nxt_feature_libs=
|
|||||||
nxt_feature_test="#include <port.h>
|
nxt_feature_test="#include <port.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
int main() {
|
int main(void) {
|
||||||
int n;
|
int n;
|
||||||
|
|
||||||
n = port_create();
|
n = port_create();
|
||||||
@@ -152,7 +152,7 @@ nxt_feature_test="#include <fcntl.h>
|
|||||||
#include <sys/devpoll.h>
|
#include <sys/devpoll.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
int main() {
|
int main(void) {
|
||||||
int n;
|
int n;
|
||||||
|
|
||||||
n = open(\"/dev/poll\", O_RDWR);
|
n = open(\"/dev/poll\", O_RDWR);
|
||||||
@@ -180,7 +180,7 @@ nxt_feature_test="#include <fcntl.h>
|
|||||||
#include <sys/pollset.h>
|
#include <sys/pollset.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
int main() {
|
int main(void) {
|
||||||
pollset_t n;
|
pollset_t n;
|
||||||
|
|
||||||
n = pollset_create(-1);
|
n = pollset_create(-1);
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ nxt_feature_incs=
|
|||||||
nxt_feature_libs=
|
nxt_feature_libs=
|
||||||
nxt_feature_test="#include <fcntl.h>
|
nxt_feature_test="#include <fcntl.h>
|
||||||
|
|
||||||
int main() {
|
int main(void) {
|
||||||
(void) posix_fadvise(0, 0, 0, POSIX_FADV_WILLNEED);
|
(void) posix_fadvise(0, 0, 0, POSIX_FADV_WILLNEED);
|
||||||
return 0;
|
return 0;
|
||||||
}"
|
}"
|
||||||
@@ -28,7 +28,7 @@ nxt_feature_incs=
|
|||||||
nxt_feature_libs=
|
nxt_feature_libs=
|
||||||
nxt_feature_test="#include <fcntl.h>
|
nxt_feature_test="#include <fcntl.h>
|
||||||
|
|
||||||
int main() {
|
int main(void) {
|
||||||
(void) fcntl(0, F_READAHEAD, 1024);
|
(void) fcntl(0, F_READAHEAD, 1024);
|
||||||
return 0;
|
return 0;
|
||||||
}"
|
}"
|
||||||
@@ -44,7 +44,7 @@ nxt_feature_incs=
|
|||||||
nxt_feature_libs=
|
nxt_feature_libs=
|
||||||
nxt_feature_test="#include <fcntl.h>
|
nxt_feature_test="#include <fcntl.h>
|
||||||
|
|
||||||
int main() {
|
int main(void) {
|
||||||
(void) fcntl(0, F_RDAHEAD, 1);
|
(void) fcntl(0, F_RDAHEAD, 1);
|
||||||
return 0;
|
return 0;
|
||||||
}"
|
}"
|
||||||
@@ -62,7 +62,7 @@ nxt_feature_test="#include <fcntl.h>
|
|||||||
#include <linux/openat2.h>
|
#include <linux/openat2.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
int main() {
|
int main(void) {
|
||||||
struct open_how how;
|
struct open_how how;
|
||||||
|
|
||||||
memset(&how, 0, sizeof(how));
|
memset(&how, 0, sizeof(how));
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ nxt_feature_libs=
|
|||||||
nxt_feature_test="#include <sys/wait.h>
|
nxt_feature_test="#include <sys/wait.h>
|
||||||
#include <sys/syscall.h>
|
#include <sys/syscall.h>
|
||||||
|
|
||||||
int main() {
|
int main(void) {
|
||||||
return SYS_clone | SIGCHLD;
|
return SYS_clone | SIGCHLD;
|
||||||
}"
|
}"
|
||||||
. auto/feature
|
. auto/feature
|
||||||
@@ -40,7 +40,7 @@ if [ $nxt_found = yes ]; then
|
|||||||
#include <sys/syscall.h>
|
#include <sys/syscall.h>
|
||||||
#include <sched.h>
|
#include <sched.h>
|
||||||
|
|
||||||
int main() {
|
int main(void) {
|
||||||
return CLONE_NEW$flag;
|
return CLONE_NEW$flag;
|
||||||
}"
|
}"
|
||||||
. auto/feature
|
. auto/feature
|
||||||
@@ -70,7 +70,7 @@ nxt_feature_test="#include <sys/syscall.h>
|
|||||||
# error
|
# error
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
int main() {
|
int main(void) {
|
||||||
return SYS_pivot_root;
|
return SYS_pivot_root;
|
||||||
}"
|
}"
|
||||||
. auto/feature
|
. auto/feature
|
||||||
@@ -96,7 +96,7 @@ nxt_feature_incs=
|
|||||||
nxt_feature_libs=
|
nxt_feature_libs=
|
||||||
nxt_feature_test="#include <sys/prctl.h>
|
nxt_feature_test="#include <sys/prctl.h>
|
||||||
|
|
||||||
int main() {
|
int main(void) {
|
||||||
return PR_SET_NO_NEW_PRIVS;
|
return PR_SET_NO_NEW_PRIVS;
|
||||||
}"
|
}"
|
||||||
. auto/feature
|
. auto/feature
|
||||||
@@ -109,7 +109,7 @@ nxt_feature_incs=
|
|||||||
nxt_feature_libs=
|
nxt_feature_libs=
|
||||||
nxt_feature_test="#include <sys/mount.h>
|
nxt_feature_test="#include <sys/mount.h>
|
||||||
|
|
||||||
int main() {
|
int main(void) {
|
||||||
return mount(\"/\", \"/\", \"bind\",
|
return mount(\"/\", \"/\", \"bind\",
|
||||||
MS_BIND | MS_REC, \"\");
|
MS_BIND | MS_REC, \"\");
|
||||||
}"
|
}"
|
||||||
@@ -128,7 +128,7 @@ if [ $nxt_found = no ]; then
|
|||||||
nxt_feature_libs=
|
nxt_feature_libs=
|
||||||
nxt_feature_test="#include <sys/mount.h>
|
nxt_feature_test="#include <sys/mount.h>
|
||||||
|
|
||||||
int main() {
|
int main(void) {
|
||||||
return nmount((void *)0, 0, 0);
|
return nmount((void *)0, 0, 0);
|
||||||
}"
|
}"
|
||||||
. auto/feature
|
. auto/feature
|
||||||
@@ -146,7 +146,7 @@ nxt_feature_incs=
|
|||||||
nxt_feature_libs=
|
nxt_feature_libs=
|
||||||
nxt_feature_test="#include <sys/mount.h>
|
nxt_feature_test="#include <sys/mount.h>
|
||||||
|
|
||||||
int main() {
|
int main(void) {
|
||||||
return umount2((void *)0, 0);
|
return umount2((void *)0, 0);
|
||||||
}"
|
}"
|
||||||
. auto/feature
|
. auto/feature
|
||||||
@@ -163,7 +163,7 @@ if [ $nxt_found = no ]; then
|
|||||||
nxt_feature_libs=
|
nxt_feature_libs=
|
||||||
nxt_feature_test="#include <sys/mount.h>
|
nxt_feature_test="#include <sys/mount.h>
|
||||||
|
|
||||||
int main() {
|
int main(void) {
|
||||||
return unmount((void *)0, 0);
|
return unmount((void *)0, 0);
|
||||||
}"
|
}"
|
||||||
. auto/feature
|
. auto/feature
|
||||||
|
|||||||
16
auto/malloc
16
auto/malloc
@@ -13,7 +13,7 @@ nxt_feature_incs=
|
|||||||
nxt_feature_libs=
|
nxt_feature_libs=
|
||||||
nxt_feature_test="#include <stdlib.h>
|
nxt_feature_test="#include <stdlib.h>
|
||||||
|
|
||||||
int main() {
|
int main(void) {
|
||||||
void *p;
|
void *p;
|
||||||
|
|
||||||
if (posix_memalign(&p, 4096, 4096) != 0)
|
if (posix_memalign(&p, 4096, 4096) != 0)
|
||||||
@@ -36,7 +36,7 @@ if [ $nxt_found = no ]; then
|
|||||||
nxt_feature_libs=
|
nxt_feature_libs=
|
||||||
nxt_feature_test="#include <stdlib.h>
|
nxt_feature_test="#include <stdlib.h>
|
||||||
|
|
||||||
int main() {
|
int main(void) {
|
||||||
void *p;
|
void *p;
|
||||||
|
|
||||||
p = memalign(4096, 4096);
|
p = memalign(4096, 4096);
|
||||||
@@ -59,7 +59,7 @@ nxt_feature_incs=
|
|||||||
nxt_feature_libs=
|
nxt_feature_libs=
|
||||||
nxt_feature_test="#include <malloc.h>
|
nxt_feature_test="#include <malloc.h>
|
||||||
|
|
||||||
int main() {
|
int main(void) {
|
||||||
void *p;
|
void *p;
|
||||||
|
|
||||||
p = malloc(4096);
|
p = malloc(4096);
|
||||||
@@ -82,7 +82,7 @@ if [ $nxt_found = no ]; then
|
|||||||
nxt_feature_test="#include <stdlib.h>
|
nxt_feature_test="#include <stdlib.h>
|
||||||
#include <malloc_np.h>
|
#include <malloc_np.h>
|
||||||
|
|
||||||
int main() {
|
int main(void) {
|
||||||
void *p;
|
void *p;
|
||||||
|
|
||||||
p = malloc(4096);
|
p = malloc(4096);
|
||||||
@@ -105,7 +105,7 @@ if [ $nxt_found = no ]; then
|
|||||||
nxt_feature_libs=
|
nxt_feature_libs=
|
||||||
nxt_feature_test="#include <malloc/malloc.h>
|
nxt_feature_test="#include <malloc/malloc.h>
|
||||||
|
|
||||||
int main() {
|
int main(void) {
|
||||||
if (malloc_good_size(4096) < 4096)
|
if (malloc_good_size(4096) < 4096)
|
||||||
return 1;
|
return 1;
|
||||||
return 0;
|
return 0;
|
||||||
@@ -125,7 +125,7 @@ nxt_feature_incs=
|
|||||||
nxt_feature_libs=
|
nxt_feature_libs=
|
||||||
nxt_feature_test="#include <stdlib.h>
|
nxt_feature_test="#include <stdlib.h>
|
||||||
|
|
||||||
int main() {
|
int main(void) {
|
||||||
void *p;
|
void *p;
|
||||||
|
|
||||||
p = alloca(256);
|
p = alloca(256);
|
||||||
@@ -147,7 +147,7 @@ if [ $nxt_found = no ]; then
|
|||||||
nxt_feature_libs=
|
nxt_feature_libs=
|
||||||
nxt_feature_test="#include <alloca.h>
|
nxt_feature_test="#include <alloca.h>
|
||||||
|
|
||||||
int main() {
|
int main(void) {
|
||||||
void *p;
|
void *p;
|
||||||
|
|
||||||
p = alloca(256);
|
p = alloca(256);
|
||||||
@@ -168,7 +168,7 @@ nxt_feature_incs=
|
|||||||
nxt_feature_libs=
|
nxt_feature_libs=
|
||||||
nxt_feature_test="#include <malloc.h>
|
nxt_feature_test="#include <malloc.h>
|
||||||
|
|
||||||
int main() {
|
int main(void) {
|
||||||
mallopt(M_PERTURB, 0x55);
|
mallopt(M_PERTURB, 0x55);
|
||||||
return 0;
|
return 0;
|
||||||
}"
|
}"
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ nxt_feature_libs=
|
|||||||
nxt_feature_test="#include <stdlib.h>
|
nxt_feature_test="#include <stdlib.h>
|
||||||
#include <sys/mman.h>
|
#include <sys/mman.h>
|
||||||
|
|
||||||
int main() {
|
int main(void) {
|
||||||
if (mmap(NULL, 4096, PROT_READ | PROT_WRITE,
|
if (mmap(NULL, 4096, PROT_READ | PROT_WRITE,
|
||||||
MAP_PRIVATE | MAP_ANON, -1, 0)
|
MAP_PRIVATE | MAP_ANON, -1, 0)
|
||||||
== MAP_FAILED)
|
== MAP_FAILED)
|
||||||
@@ -35,7 +35,7 @@ if [ $nxt_found = no ]; then
|
|||||||
nxt_feature_test="#include <stdlib.h>
|
nxt_feature_test="#include <stdlib.h>
|
||||||
#include <sys/mman.h>
|
#include <sys/mman.h>
|
||||||
|
|
||||||
int main() {
|
int main(void) {
|
||||||
if (mmap(NULL, 4096, PROT_READ | PROT_WRITE,
|
if (mmap(NULL, 4096, PROT_READ | PROT_WRITE,
|
||||||
MAP_PRIVATE | MAP_ANONYMOUS, -1, 0)
|
MAP_PRIVATE | MAP_ANONYMOUS, -1, 0)
|
||||||
== MAP_FAILED)
|
== MAP_FAILED)
|
||||||
@@ -56,7 +56,7 @@ nxt_feature_libs=
|
|||||||
nxt_feature_test="#include <stdlib.h>
|
nxt_feature_test="#include <stdlib.h>
|
||||||
#include <sys/mman.h>
|
#include <sys/mman.h>
|
||||||
|
|
||||||
int main() {
|
int main(void) {
|
||||||
if (mmap(NULL, 4096, PROT_READ | PROT_WRITE,
|
if (mmap(NULL, 4096, PROT_READ | PROT_WRITE,
|
||||||
MAP_SHARED | MAP_POPULATE, -1, 0)
|
MAP_SHARED | MAP_POPULATE, -1, 0)
|
||||||
== MAP_FAILED)
|
== MAP_FAILED)
|
||||||
@@ -76,7 +76,7 @@ nxt_feature_libs=
|
|||||||
nxt_feature_test="#include <stdlib.h>
|
nxt_feature_test="#include <stdlib.h>
|
||||||
#include <sys/mman.h>
|
#include <sys/mman.h>
|
||||||
|
|
||||||
int main() {
|
int main(void) {
|
||||||
if (mmap(NULL, 4096, PROT_READ | PROT_WRITE,
|
if (mmap(NULL, 4096, PROT_READ | PROT_WRITE,
|
||||||
MAP_PRIVATE | MAP_ANON | MAP_PREFAULT_READ,
|
MAP_PRIVATE | MAP_ANON | MAP_PREFAULT_READ,
|
||||||
-1, 0)
|
-1, 0)
|
||||||
|
|||||||
@@ -191,7 +191,7 @@ nxt_feature_libs="${NXT_JAVA_LDFLAGS}"
|
|||||||
nxt_feature_test="
|
nxt_feature_test="
|
||||||
#include <jni.h>
|
#include <jni.h>
|
||||||
|
|
||||||
int main() {
|
int main(void) {
|
||||||
JNI_CreateJavaVM(NULL, NULL, NULL);
|
JNI_CreateJavaVM(NULL, NULL, NULL);
|
||||||
return 0;
|
return 0;
|
||||||
}"
|
}"
|
||||||
|
|||||||
@@ -79,7 +79,7 @@ if /bin/sh -c "$NXT_PERL -MConfig -e 'print \"Perl version: \",
|
|||||||
|
|
||||||
static PerlInterpreter *my_perl;
|
static PerlInterpreter *my_perl;
|
||||||
|
|
||||||
int main() {
|
int main(void) {
|
||||||
char argv[] = \"\\0-e\\00\";
|
char argv[] = \"\\0-e\\00\";
|
||||||
char *embedding[] = { &argv[0], &argv[1], &argv[4] };
|
char *embedding[] = { &argv[0], &argv[1], &argv[4] };
|
||||||
|
|
||||||
@@ -124,7 +124,7 @@ nxt_feature_test="
|
|||||||
#include <EXTERN.h>
|
#include <EXTERN.h>
|
||||||
#include <perl.h>
|
#include <perl.h>
|
||||||
|
|
||||||
int main() {
|
int main(void) {
|
||||||
printf(\"%s\", PERL_VERSION_STRING);
|
printf(\"%s\", PERL_VERSION_STRING);
|
||||||
return 0;
|
return 0;
|
||||||
}"
|
}"
|
||||||
|
|||||||
@@ -131,7 +131,7 @@ nxt_feature_libs="${NXT_PHP_LIB} ${NXT_PHP_LDFLAGS}"
|
|||||||
nxt_feature_test="
|
nxt_feature_test="
|
||||||
#include <php.h>
|
#include <php.h>
|
||||||
|
|
||||||
int main() {
|
int main(void) {
|
||||||
printf(\"%s\", PHP_VERSION);
|
printf(\"%s\", PHP_VERSION);
|
||||||
return 0;
|
return 0;
|
||||||
}"
|
}"
|
||||||
@@ -148,7 +148,7 @@ nxt_feature_test="
|
|||||||
#include <php.h>
|
#include <php.h>
|
||||||
#include <php_main.h>
|
#include <php_main.h>
|
||||||
|
|
||||||
int main() {
|
int main(void) {
|
||||||
#if (PHP_VERSION_ID < 80200)
|
#if (PHP_VERSION_ID < 80200)
|
||||||
php_module_startup(NULL, NULL, 0);
|
php_module_startup(NULL, NULL, 0);
|
||||||
#else
|
#else
|
||||||
@@ -176,7 +176,7 @@ nxt_feature_test="
|
|||||||
#include <php.h>
|
#include <php.h>
|
||||||
#include <php_main.h>
|
#include <php_main.h>
|
||||||
|
|
||||||
int main() {
|
int main(void) {
|
||||||
#ifndef ZTS
|
#ifndef ZTS
|
||||||
#error ZTS is not defined.
|
#error ZTS is not defined.
|
||||||
#endif
|
#endif
|
||||||
@@ -197,7 +197,7 @@ nxt_feature_test="
|
|||||||
#include <php.h>
|
#include <php.h>
|
||||||
#include <php_main.h>
|
#include <php_main.h>
|
||||||
|
|
||||||
int main() {
|
int main(void) {
|
||||||
zend_signal_startup();
|
zend_signal_startup();
|
||||||
return 0;
|
return 0;
|
||||||
}"
|
}"
|
||||||
|
|||||||
@@ -86,7 +86,7 @@ if /bin/sh -c "$NXT_PYTHON_CONFIG --prefix" >> $NXT_AUTOCONF_ERR 2>&1; then
|
|||||||
nxt_feature_test="
|
nxt_feature_test="
|
||||||
#include <Python.h>
|
#include <Python.h>
|
||||||
|
|
||||||
int main() {
|
int main(void) {
|
||||||
Py_Initialize();
|
Py_Initialize();
|
||||||
return 0;
|
return 0;
|
||||||
}"
|
}"
|
||||||
@@ -114,7 +114,7 @@ nxt_feature_test="
|
|||||||
#include <Python.h>
|
#include <Python.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
int main() {
|
int main(void) {
|
||||||
printf(\"%s\", PY_VERSION);
|
printf(\"%s\", PY_VERSION);
|
||||||
return 0;
|
return 0;
|
||||||
}"
|
}"
|
||||||
|
|||||||
@@ -106,7 +106,7 @@ if /bin/sh -c "$NXT_RUBY -v" >> $NXT_AUTOCONF_ERR 2>&1; then
|
|||||||
nxt_feature_test="
|
nxt_feature_test="
|
||||||
#include <ruby.h>
|
#include <ruby.h>
|
||||||
|
|
||||||
int main() {
|
int main(void) {
|
||||||
static const char *argv[3] = {
|
static const char *argv[3] = {
|
||||||
\"NGINX_Unit\", \"-rrbconfig\",
|
\"NGINX_Unit\", \"-rrbconfig\",
|
||||||
\"-eprint RbConfig::CONFIG['libdir']\"
|
\"-eprint RbConfig::CONFIG['libdir']\"
|
||||||
@@ -130,7 +130,7 @@ if /bin/sh -c "$NXT_RUBY -v" >> $NXT_AUTOCONF_ERR 2>&1; then
|
|||||||
nxt_feature_test="
|
nxt_feature_test="
|
||||||
#include <ruby.h>
|
#include <ruby.h>
|
||||||
|
|
||||||
int main() {
|
int main(void) {
|
||||||
ruby_init();
|
ruby_init();
|
||||||
return ruby_cleanup(0);
|
return ruby_cleanup(0);
|
||||||
}"
|
}"
|
||||||
@@ -159,7 +159,7 @@ nxt_feature_test="
|
|||||||
#include <ruby.h>
|
#include <ruby.h>
|
||||||
#include <ruby/version.h>
|
#include <ruby/version.h>
|
||||||
|
|
||||||
int main() {
|
int main(void) {
|
||||||
printf(\"%s\", ruby_version);
|
printf(\"%s\", ruby_version);
|
||||||
return 0;
|
return 0;
|
||||||
}"
|
}"
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ if [ $nxt_found = no ]; then
|
|||||||
nxt_feature_libs=$NXT_PCRE_LIB
|
nxt_feature_libs=$NXT_PCRE_LIB
|
||||||
nxt_feature_test="#include <pcre.h>
|
nxt_feature_test="#include <pcre.h>
|
||||||
|
|
||||||
int main() {
|
int main(void) {
|
||||||
pcre *re;
|
pcre *re;
|
||||||
|
|
||||||
re = pcre_compile(NULL, 0, NULL, 0, NULL);
|
re = pcre_compile(NULL, 0, NULL, 0, NULL);
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ nxt_feature="Linux sendfile()"
|
|||||||
nxt_feature_name=NXT_HAVE_LINUX_SENDFILE
|
nxt_feature_name=NXT_HAVE_LINUX_SENDFILE
|
||||||
nxt_feature_test="#include <sys/sendfile.h>
|
nxt_feature_test="#include <sys/sendfile.h>
|
||||||
|
|
||||||
int main() {
|
int main(void) {
|
||||||
off_t offset;
|
off_t offset;
|
||||||
|
|
||||||
sendfile(-1, -1, &offset, 0);
|
sendfile(-1, -1, &offset, 0);
|
||||||
@@ -43,7 +43,7 @@ if [ $nxt_found = no ]; then
|
|||||||
#include <sys/uio.h>
|
#include <sys/uio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
int main() {
|
int main(void) {
|
||||||
off_t sent;
|
off_t sent;
|
||||||
|
|
||||||
sendfile(-1, -1, 0, 0, NULL, &sent, 0);
|
sendfile(-1, -1, 0, 0, NULL, &sent, 0);
|
||||||
@@ -69,7 +69,7 @@ if [ $nxt_found = no ]; then
|
|||||||
#include <sys/uio.h>
|
#include <sys/uio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
int main() {
|
int main(void) {
|
||||||
off_t sent;
|
off_t sent;
|
||||||
|
|
||||||
sendfile(-1, -1, 0, &sent, NULL, 0);
|
sendfile(-1, -1, 0, &sent, NULL, 0);
|
||||||
@@ -100,7 +100,7 @@ if [ $nxt_found = no ]; then
|
|||||||
nxt_feature_libs="-lsendfile"
|
nxt_feature_libs="-lsendfile"
|
||||||
nxt_feature_test="#include <sys/sendfile.h>
|
nxt_feature_test="#include <sys/sendfile.h>
|
||||||
|
|
||||||
int main() {
|
int main(void) {
|
||||||
size_t sent;
|
size_t sent;
|
||||||
struct sendfilevec vec;
|
struct sendfilevec vec;
|
||||||
|
|
||||||
@@ -124,7 +124,7 @@ if [ $nxt_found = no ]; then
|
|||||||
nxt_feature_name=NXT_HAVE_AIX_SEND_FILE
|
nxt_feature_name=NXT_HAVE_AIX_SEND_FILE
|
||||||
nxt_feature_test="#include <sys/socket.h>
|
nxt_feature_test="#include <sys/socket.h>
|
||||||
|
|
||||||
int main() {
|
int main(void) {
|
||||||
int s;
|
int s;
|
||||||
struct sf_parms sf_iobuf;
|
struct sf_parms sf_iobuf;
|
||||||
|
|
||||||
@@ -152,7 +152,7 @@ if [ $nxt_found = no ]; then
|
|||||||
sbsize_t sendfile(int s, int fd, off_t offset,
|
sbsize_t sendfile(int s, int fd, off_t offset,
|
||||||
bsize_t nbytes, const struct iovec *hdtrl, int flags);
|
bsize_t nbytes, const struct iovec *hdtrl, int flags);
|
||||||
|
|
||||||
int main() {
|
int main(void) {
|
||||||
sendfile(-1, -1, 0, 0, NULL, 0);
|
sendfile(-1, -1, 0, 0, NULL, 0);
|
||||||
return 0;
|
return 0;
|
||||||
}"
|
}"
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ nxt_feature_test="#include <sys/mman.h>
|
|||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
|
||||||
int main() {
|
int main(void) {
|
||||||
int ret;
|
int ret;
|
||||||
static char name[] = \"/unit.configure\";
|
static char name[] = \"/unit.configure\";
|
||||||
|
|
||||||
@@ -62,7 +62,7 @@ if [ $nxt_found = no ]; then
|
|||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
|
||||||
int main() {
|
int main(void) {
|
||||||
static char name[] = \"/tmp/unit.configure\";
|
static char name[] = \"/tmp/unit.configure\";
|
||||||
|
|
||||||
shm_unlink(name);
|
shm_unlink(name);
|
||||||
@@ -94,7 +94,7 @@ nxt_feature_test="#include <sys/mman.h>
|
|||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
|
|
||||||
int main() {
|
int main(void) {
|
||||||
int fd = shm_open(SHM_ANON, O_RDWR, S_IRUSR | S_IWUSR);
|
int fd = shm_open(SHM_ANON, O_RDWR, S_IRUSR | S_IWUSR);
|
||||||
if (fd == -1)
|
if (fd == -1)
|
||||||
return 1;
|
return 1;
|
||||||
@@ -119,7 +119,7 @@ nxt_feature_test="#include <linux/memfd.h>
|
|||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <sys/syscall.h>
|
#include <sys/syscall.h>
|
||||||
|
|
||||||
int main() {
|
int main(void) {
|
||||||
static char name[] = \"/unit.configure\";
|
static char name[] = \"/unit.configure\";
|
||||||
|
|
||||||
int fd = syscall(SYS_memfd_create, name, MFD_CLOEXEC);
|
int fd = syscall(SYS_memfd_create, name, MFD_CLOEXEC);
|
||||||
|
|||||||
32
auto/sockets
32
auto/sockets
@@ -15,7 +15,7 @@ if [ $NXT_INET6 = YES ]; then
|
|||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <netinet/in.h>
|
#include <netinet/in.h>
|
||||||
|
|
||||||
int main() {
|
int main(void) {
|
||||||
struct sockaddr_in6 sin6;
|
struct sockaddr_in6 sin6;
|
||||||
|
|
||||||
sin6.sin6_family = AF_INET6;
|
sin6.sin6_family = AF_INET6;
|
||||||
@@ -36,7 +36,7 @@ nxt_feature_libs=
|
|||||||
nxt_feature_test="#include <stdio.h>
|
nxt_feature_test="#include <stdio.h>
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
|
|
||||||
int main() {
|
int main(void) {
|
||||||
struct sockaddr sa;
|
struct sockaddr sa;
|
||||||
|
|
||||||
sa.sa_len = 0;
|
sa.sa_len = 0;
|
||||||
@@ -54,7 +54,7 @@ nxt_feature_libs=
|
|||||||
nxt_feature_test="#include <stdio.h>
|
nxt_feature_test="#include <stdio.h>
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
|
|
||||||
int main() {
|
int main(void) {
|
||||||
printf(\"%d\", (int) sizeof(struct sockaddr));
|
printf(\"%d\", (int) sizeof(struct sockaddr));
|
||||||
return 0;
|
return 0;
|
||||||
}"
|
}"
|
||||||
@@ -70,7 +70,7 @@ nxt_feature_test="#include <stdio.h>
|
|||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <netinet/in.h>
|
#include <netinet/in.h>
|
||||||
|
|
||||||
int main() {
|
int main(void) {
|
||||||
printf(\"%d\", (int) sizeof(struct sockaddr_in));
|
printf(\"%d\", (int) sizeof(struct sockaddr_in));
|
||||||
return 0;
|
return 0;
|
||||||
}"
|
}"
|
||||||
@@ -86,7 +86,7 @@ nxt_feature_test="#include <stdio.h>
|
|||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <netinet/in.h>
|
#include <netinet/in.h>
|
||||||
|
|
||||||
int main() {
|
int main(void) {
|
||||||
printf(\"%d\", (int) sizeof(struct sockaddr_in6));
|
printf(\"%d\", (int) sizeof(struct sockaddr_in6));
|
||||||
return 0;
|
return 0;
|
||||||
}"
|
}"
|
||||||
@@ -102,7 +102,7 @@ nxt_feature_test="#include <stdio.h>
|
|||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/un.h>
|
#include <sys/un.h>
|
||||||
|
|
||||||
int main() {
|
int main(void) {
|
||||||
printf(\"%d\", (int) sizeof(struct sockaddr_un));
|
printf(\"%d\", (int) sizeof(struct sockaddr_un));
|
||||||
return 0;
|
return 0;
|
||||||
}"
|
}"
|
||||||
@@ -117,7 +117,7 @@ nxt_feature_libs=
|
|||||||
nxt_feature_test="#include <stdio.h>
|
nxt_feature_test="#include <stdio.h>
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
|
|
||||||
int main() {
|
int main(void) {
|
||||||
printf(\"%d\", (int) sizeof(struct sockaddr_storage));
|
printf(\"%d\", (int) sizeof(struct sockaddr_storage));
|
||||||
return 0;
|
return 0;
|
||||||
}"
|
}"
|
||||||
@@ -132,7 +132,7 @@ nxt_feature_libs=
|
|||||||
nxt_feature_test="#include <stdio.h>
|
nxt_feature_test="#include <stdio.h>
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
|
|
||||||
int main() {
|
int main(void) {
|
||||||
int pair[2];
|
int pair[2];
|
||||||
|
|
||||||
if (socketpair(AF_UNIX, SOCK_SEQPACKET, 0, pair) != 0)
|
if (socketpair(AF_UNIX, SOCK_SEQPACKET, 0, pair) != 0)
|
||||||
@@ -150,7 +150,7 @@ nxt_feature_libs=
|
|||||||
nxt_feature_test="#include <stdio.h>
|
nxt_feature_test="#include <stdio.h>
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
|
|
||||||
int main() {
|
int main(void) {
|
||||||
struct msghdr msg;
|
struct msghdr msg;
|
||||||
|
|
||||||
printf(\"%d\", (int) sizeof(msg.msg_control));
|
printf(\"%d\", (int) sizeof(msg.msg_control));
|
||||||
@@ -175,7 +175,7 @@ if [ $NXT_SYSTEM != DragonFly ]; then
|
|||||||
nxt_feature_test="#define _GNU_SOURCE
|
nxt_feature_test="#define _GNU_SOURCE
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
|
|
||||||
int main() {
|
int main(void) {
|
||||||
return SO_PASSCRED == 0;
|
return SO_PASSCRED == 0;
|
||||||
}"
|
}"
|
||||||
. auto/feature
|
. auto/feature
|
||||||
@@ -191,7 +191,7 @@ if [ $NXT_SYSTEM != DragonFly ]; then
|
|||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
#include <sys/un.h>
|
#include <sys/un.h>
|
||||||
|
|
||||||
int main() {
|
int main(void) {
|
||||||
return sizeof(struct ucred);
|
return sizeof(struct ucred);
|
||||||
}"
|
}"
|
||||||
. auto/feature
|
. auto/feature
|
||||||
@@ -206,7 +206,7 @@ if [ $NXT_SYSTEM != DragonFly ]; then
|
|||||||
nxt_feature_test="#define _GNU_SOURCE
|
nxt_feature_test="#define _GNU_SOURCE
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
|
|
||||||
int main() {
|
int main(void) {
|
||||||
return sizeof(struct cmsgcred);
|
return sizeof(struct cmsgcred);
|
||||||
}"
|
}"
|
||||||
. auto/feature
|
. auto/feature
|
||||||
@@ -220,7 +220,7 @@ nxt_feature_incs=
|
|||||||
nxt_feature_libs=
|
nxt_feature_libs=
|
||||||
nxt_feature_test="#include <sys/filio.h>
|
nxt_feature_test="#include <sys/filio.h>
|
||||||
|
|
||||||
int main() {
|
int main(void) {
|
||||||
return 0;
|
return 0;
|
||||||
}"
|
}"
|
||||||
. auto/feature
|
. auto/feature
|
||||||
@@ -235,7 +235,7 @@ nxt_feature_test="#include <unistd.h>
|
|||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
#include <sys/ioctl.h>
|
#include <sys/ioctl.h>
|
||||||
|
|
||||||
int main() {
|
int main(void) {
|
||||||
int nb;
|
int nb;
|
||||||
|
|
||||||
nb = 0;
|
nb = 0;
|
||||||
@@ -255,7 +255,7 @@ nxt_feature_libs=
|
|||||||
nxt_feature_test="#define _GNU_SOURCE
|
nxt_feature_test="#define _GNU_SOURCE
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
|
|
||||||
int main() {
|
int main(void) {
|
||||||
socket(AF_INET, SOCK_STREAM | SOCK_NONBLOCK, 0);
|
socket(AF_INET, SOCK_STREAM | SOCK_NONBLOCK, 0);
|
||||||
return 0;
|
return 0;
|
||||||
}"
|
}"
|
||||||
@@ -273,7 +273,7 @@ nxt_feature_test="#define _GNU_SOURCE
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
|
|
||||||
int main() {
|
int main(void) {
|
||||||
accept4(0, NULL, NULL, SOCK_NONBLOCK);
|
accept4(0, NULL, NULL, SOCK_NONBLOCK);
|
||||||
return 0;
|
return 0;
|
||||||
}"
|
}"
|
||||||
|
|||||||
18
auto/ssltls
18
auto/ssltls
@@ -23,7 +23,7 @@ if [ $NXT_OPENSSL = YES ]; then
|
|||||||
nxt_feature_libs="-lssl -lcrypto"
|
nxt_feature_libs="-lssl -lcrypto"
|
||||||
nxt_feature_test="#include <openssl/ssl.h>
|
nxt_feature_test="#include <openssl/ssl.h>
|
||||||
|
|
||||||
int main() {
|
int main(void) {
|
||||||
SSL_library_init();
|
SSL_library_init();
|
||||||
return 0;
|
return 0;
|
||||||
}"
|
}"
|
||||||
@@ -39,7 +39,7 @@ if [ $NXT_OPENSSL = YES ]; then
|
|||||||
nxt_feature_run=value
|
nxt_feature_run=value
|
||||||
nxt_feature_test="#include <openssl/ssl.h>
|
nxt_feature_test="#include <openssl/ssl.h>
|
||||||
|
|
||||||
int main() {
|
int main(void) {
|
||||||
printf(\"\\\"%s\\\"\",
|
printf(\"\\\"%s\\\"\",
|
||||||
SSLeay_version(SSLEAY_VERSION));
|
SSLeay_version(SSLEAY_VERSION));
|
||||||
return 0;
|
return 0;
|
||||||
@@ -61,7 +61,7 @@ if [ $NXT_OPENSSL = YES ]; then
|
|||||||
nxt_feature_libs="$NXT_OPENSSL_LIBS"
|
nxt_feature_libs="$NXT_OPENSSL_LIBS"
|
||||||
nxt_feature_test="#include <openssl/ssl.h>
|
nxt_feature_test="#include <openssl/ssl.h>
|
||||||
|
|
||||||
int main() {
|
int main(void) {
|
||||||
SSL_CONF_cmd(NULL, NULL, NULL);
|
SSL_CONF_cmd(NULL, NULL, NULL);
|
||||||
return 0;
|
return 0;
|
||||||
}"
|
}"
|
||||||
@@ -75,7 +75,7 @@ if [ $NXT_OPENSSL = YES ]; then
|
|||||||
nxt_feature_libs="$NXT_OPENSSL_LIBS"
|
nxt_feature_libs="$NXT_OPENSSL_LIBS"
|
||||||
nxt_feature_test="#include <openssl/ssl.h>
|
nxt_feature_test="#include <openssl/ssl.h>
|
||||||
|
|
||||||
int main() {
|
int main(void) {
|
||||||
#if (OPENSSL_NO_TLSEXT)
|
#if (OPENSSL_NO_TLSEXT)
|
||||||
#error OpenSSL: no tlsext support.
|
#error OpenSSL: no tlsext support.
|
||||||
#else
|
#else
|
||||||
@@ -100,7 +100,7 @@ if [ $NXT_GNUTLS = YES ]; then
|
|||||||
nxt_feature_libs=$NXT_GNUTLS_LIBS
|
nxt_feature_libs=$NXT_GNUTLS_LIBS
|
||||||
nxt_feature_test="#include <gnutls/gnutls.h>
|
nxt_feature_test="#include <gnutls/gnutls.h>
|
||||||
|
|
||||||
int main() {
|
int main(void) {
|
||||||
gnutls_global_init();
|
gnutls_global_init();
|
||||||
gnutls_global_deinit();
|
gnutls_global_deinit();
|
||||||
return 0;
|
return 0;
|
||||||
@@ -121,7 +121,7 @@ if [ $NXT_GNUTLS = YES ]; then
|
|||||||
nxt_feature_libs=$NXT_GNUTLS_LIBS
|
nxt_feature_libs=$NXT_GNUTLS_LIBS
|
||||||
nxt_feature_test="#include <gnutls/gnutls.h>
|
nxt_feature_test="#include <gnutls/gnutls.h>
|
||||||
|
|
||||||
int main() {
|
int main(void) {
|
||||||
gnutls_transport_set_vec_push_function(NULL, NULL);
|
gnutls_transport_set_vec_push_function(NULL, NULL);
|
||||||
return 0;
|
return 0;
|
||||||
}"
|
}"
|
||||||
@@ -135,7 +135,7 @@ if [ $NXT_GNUTLS = YES ]; then
|
|||||||
nxt_feature_libs=$NXT_GNUTLS_LIBS
|
nxt_feature_libs=$NXT_GNUTLS_LIBS
|
||||||
nxt_feature_test="#include <gnutls/gnutls.h>
|
nxt_feature_test="#include <gnutls/gnutls.h>
|
||||||
|
|
||||||
int main() {
|
int main(void) {
|
||||||
gnutls_global_set_time_function(NULL);
|
gnutls_global_set_time_function(NULL);
|
||||||
return 0;
|
return 0;
|
||||||
}"
|
}"
|
||||||
@@ -160,7 +160,7 @@ if [ $NXT_CYASSL = YES ]; then
|
|||||||
nxt_feature_libs="-lcyassl"
|
nxt_feature_libs="-lcyassl"
|
||||||
nxt_feature_test="#include <cyassl/ssl.h>
|
nxt_feature_test="#include <cyassl/ssl.h>
|
||||||
|
|
||||||
int main() {
|
int main(void) {
|
||||||
CyaSSL_Init();
|
CyaSSL_Init();
|
||||||
CyaSSL_Cleanup();
|
CyaSSL_Cleanup();
|
||||||
return 0;
|
return 0;
|
||||||
@@ -191,7 +191,7 @@ if [ $NXT_POLARSSL = YES ]; then
|
|||||||
nxt_feature_libs="-lpolarssl"
|
nxt_feature_libs="-lpolarssl"
|
||||||
nxt_feature_test="#include <polarssl/ssl.h>
|
nxt_feature_test="#include <polarssl/ssl.h>
|
||||||
|
|
||||||
int main() {
|
int main(void) {
|
||||||
ssl_context ssl;
|
ssl_context ssl;
|
||||||
memset(&ssl, '\0', sizeof(ssl));
|
memset(&ssl, '\0', sizeof(ssl));
|
||||||
ssl_init(&ssl);
|
ssl_init(&ssl);
|
||||||
|
|||||||
16
auto/threads
16
auto/threads
@@ -47,7 +47,7 @@ nxt_feature_libs=$NXT_PTHREAD
|
|||||||
nxt_feature_test="#define _GNU_SOURCE
|
nxt_feature_test="#define _GNU_SOURCE
|
||||||
#include <pthread.h>
|
#include <pthread.h>
|
||||||
|
|
||||||
int main() {
|
int main(void) {
|
||||||
pthread_yield();
|
pthread_yield();
|
||||||
return 0;
|
return 0;
|
||||||
}"
|
}"
|
||||||
@@ -65,7 +65,7 @@ if [ $nxt_found = no ]; then
|
|||||||
nxt_feature_libs=$NXT_PTHREAD
|
nxt_feature_libs=$NXT_PTHREAD
|
||||||
nxt_feature_test="#include <pthread.h>
|
nxt_feature_test="#include <pthread.h>
|
||||||
|
|
||||||
int main() {
|
int main(void) {
|
||||||
pthread_yield_np();
|
pthread_yield_np();
|
||||||
return 0;
|
return 0;
|
||||||
}"
|
}"
|
||||||
@@ -82,7 +82,7 @@ nxt_feature_incs=
|
|||||||
nxt_feature_libs=$NXT_PTHREAD
|
nxt_feature_libs=$NXT_PTHREAD
|
||||||
nxt_feature_test="#include <pthread.h>
|
nxt_feature_test="#include <pthread.h>
|
||||||
|
|
||||||
int main() {
|
int main(void) {
|
||||||
pthread_spinlock_t lock;
|
pthread_spinlock_t lock;
|
||||||
|
|
||||||
if (pthread_spin_init(&lock, PTHREAD_PROCESS_PRIVATE) != 0)
|
if (pthread_spin_init(&lock, PTHREAD_PROCESS_PRIVATE) != 0)
|
||||||
@@ -112,7 +112,7 @@ if [ $nxt_found = yes ]; then
|
|||||||
|
|
||||||
pthread_spinlock_t lock = 0;
|
pthread_spinlock_t lock = 0;
|
||||||
|
|
||||||
int main() {
|
int main(void) {
|
||||||
if (pthread_spin_trylock(&lock) != 0)
|
if (pthread_spin_trylock(&lock) != 0)
|
||||||
return 1;
|
return 1;
|
||||||
if (pthread_spin_unlock(&lock) != 0)
|
if (pthread_spin_unlock(&lock) != 0)
|
||||||
@@ -130,7 +130,7 @@ nxt_feature_incs=
|
|||||||
nxt_feature_libs=
|
nxt_feature_libs=
|
||||||
nxt_feature_test="#include <semaphore.h>
|
nxt_feature_test="#include <semaphore.h>
|
||||||
|
|
||||||
int main() {
|
int main(void) {
|
||||||
sem_t sem;
|
sem_t sem;
|
||||||
struct timespec ts;
|
struct timespec ts;
|
||||||
|
|
||||||
@@ -199,7 +199,7 @@ nxt_feature_test="#include <pthread.h>
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
int main() {
|
int main(void) {
|
||||||
void *n;
|
void *n;
|
||||||
pthread_t pt;
|
pthread_t pt;
|
||||||
|
|
||||||
@@ -227,7 +227,7 @@ if [ $nxt_found = no ]; then
|
|||||||
nxt_feature_libs=$NXT_PTHREAD
|
nxt_feature_libs=$NXT_PTHREAD
|
||||||
nxt_feature_test="#include <pthread.h>
|
nxt_feature_test="#include <pthread.h>
|
||||||
|
|
||||||
int main() {
|
int main(void) {
|
||||||
pthread_key_t key = -1;
|
pthread_key_t key = -1;
|
||||||
|
|
||||||
if (pthread_key_create(&key, NULL))
|
if (pthread_key_create(&key, NULL))
|
||||||
@@ -250,7 +250,7 @@ if [ $nxt_found = no ]; then
|
|||||||
#include <pthread.h>
|
#include <pthread.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
int main() {
|
int main(void) {
|
||||||
printf(\"%d\", PTHREAD_KEYS_MAX);
|
printf(\"%d\", PTHREAD_KEYS_MAX);
|
||||||
return 0;
|
return 0;
|
||||||
}"
|
}"
|
||||||
|
|||||||
20
auto/time
20
auto/time
@@ -13,7 +13,7 @@ nxt_feature_incs=
|
|||||||
nxt_feature_libs="-lrt"
|
nxt_feature_libs="-lrt"
|
||||||
nxt_feature_test="#include <time.h>
|
nxt_feature_test="#include <time.h>
|
||||||
|
|
||||||
int main() {
|
int main(void) {
|
||||||
struct timespec ts;
|
struct timespec ts;
|
||||||
|
|
||||||
if (clock_gettime(CLOCK_REALTIME_COARSE, &ts) == -1)
|
if (clock_gettime(CLOCK_REALTIME_COARSE, &ts) == -1)
|
||||||
@@ -36,7 +36,7 @@ nxt_feature_incs=
|
|||||||
nxt_feature_libs=
|
nxt_feature_libs=
|
||||||
nxt_feature_test="#include <time.h>
|
nxt_feature_test="#include <time.h>
|
||||||
|
|
||||||
int main() {
|
int main(void) {
|
||||||
struct timespec ts;
|
struct timespec ts;
|
||||||
|
|
||||||
if (clock_gettime(CLOCK_REALTIME_FAST, &ts) == -1)
|
if (clock_gettime(CLOCK_REALTIME_FAST, &ts) == -1)
|
||||||
@@ -53,7 +53,7 @@ nxt_feature_incs=
|
|||||||
nxt_feature_libs=
|
nxt_feature_libs=
|
||||||
nxt_feature_test="#include <time.h>
|
nxt_feature_test="#include <time.h>
|
||||||
|
|
||||||
int main() {
|
int main(void) {
|
||||||
struct timespec ts;
|
struct timespec ts;
|
||||||
|
|
||||||
if (clock_gettime(CLOCK_REALTIME, &ts) == -1)
|
if (clock_gettime(CLOCK_REALTIME, &ts) == -1)
|
||||||
@@ -87,7 +87,7 @@ nxt_feature_incs=
|
|||||||
nxt_feature_libs="-lrt"
|
nxt_feature_libs="-lrt"
|
||||||
nxt_feature_test="#include <time.h>
|
nxt_feature_test="#include <time.h>
|
||||||
|
|
||||||
int main() {
|
int main(void) {
|
||||||
struct timespec ts;
|
struct timespec ts;
|
||||||
|
|
||||||
if (clock_gettime(CLOCK_MONOTONIC_COARSE, &ts) == -1)
|
if (clock_gettime(CLOCK_MONOTONIC_COARSE, &ts) == -1)
|
||||||
@@ -110,7 +110,7 @@ nxt_feature_incs=
|
|||||||
nxt_feature_libs=
|
nxt_feature_libs=
|
||||||
nxt_feature_test="#include <time.h>
|
nxt_feature_test="#include <time.h>
|
||||||
|
|
||||||
int main() {
|
int main(void) {
|
||||||
struct timespec ts;
|
struct timespec ts;
|
||||||
|
|
||||||
if (clock_gettime(CLOCK_MONOTONIC_FAST, &ts) == -1)
|
if (clock_gettime(CLOCK_MONOTONIC_FAST, &ts) == -1)
|
||||||
@@ -127,7 +127,7 @@ nxt_feature_incs=
|
|||||||
nxt_feature_libs=
|
nxt_feature_libs=
|
||||||
nxt_feature_test="#include <time.h>
|
nxt_feature_test="#include <time.h>
|
||||||
|
|
||||||
int main() {
|
int main(void) {
|
||||||
struct timespec ts;
|
struct timespec ts;
|
||||||
|
|
||||||
if (clock_gettime(CLOCK_MONOTONIC, &ts) == -1)
|
if (clock_gettime(CLOCK_MONOTONIC, &ts) == -1)
|
||||||
@@ -163,7 +163,7 @@ nxt_feature_libs="-lhg"
|
|||||||
nxt_feature_test="#include <stdlib.h>
|
nxt_feature_test="#include <stdlib.h>
|
||||||
#include <sys/mercury.h>
|
#include <sys/mercury.h>
|
||||||
|
|
||||||
int main() {
|
int main(void) {
|
||||||
hg_gethrtime();
|
hg_gethrtime();
|
||||||
return 0;
|
return 0;
|
||||||
}"
|
}"
|
||||||
@@ -181,7 +181,7 @@ nxt_feature_incs=
|
|||||||
nxt_feature_libs=
|
nxt_feature_libs=
|
||||||
nxt_feature_test="#include <time.h>
|
nxt_feature_test="#include <time.h>
|
||||||
|
|
||||||
int main() {
|
int main(void) {
|
||||||
time_t t;
|
time_t t;
|
||||||
struct tm tm;
|
struct tm tm;
|
||||||
|
|
||||||
@@ -199,7 +199,7 @@ nxt_feature_incs=
|
|||||||
nxt_feature_libs=
|
nxt_feature_libs=
|
||||||
nxt_feature_test="#include <time.h>
|
nxt_feature_test="#include <time.h>
|
||||||
|
|
||||||
int main() {
|
int main(void) {
|
||||||
altzone = 0;
|
altzone = 0;
|
||||||
return 0;
|
return 0;
|
||||||
}"
|
}"
|
||||||
@@ -213,7 +213,7 @@ nxt_feature_incs=
|
|||||||
nxt_feature_libs=
|
nxt_feature_libs=
|
||||||
nxt_feature_test="#include <time.h>
|
nxt_feature_test="#include <time.h>
|
||||||
|
|
||||||
int main() {
|
int main(void) {
|
||||||
time_t t;
|
time_t t;
|
||||||
struct tm tm;
|
struct tm tm;
|
||||||
|
|
||||||
|
|||||||
14
auto/types
14
auto/types
@@ -18,7 +18,7 @@ nxt_feature_incs=
|
|||||||
nxt_feature_libs=
|
nxt_feature_libs=
|
||||||
nxt_feature_test="#include <stdio.h>
|
nxt_feature_test="#include <stdio.h>
|
||||||
|
|
||||||
int main() {
|
int main(void) {
|
||||||
printf(\"%d\", (int) sizeof(int));
|
printf(\"%d\", (int) sizeof(int));
|
||||||
return 0;
|
return 0;
|
||||||
}"
|
}"
|
||||||
@@ -32,7 +32,7 @@ nxt_feature_incs=
|
|||||||
nxt_feature_libs=
|
nxt_feature_libs=
|
||||||
nxt_feature_test="#include <stdio.h>
|
nxt_feature_test="#include <stdio.h>
|
||||||
|
|
||||||
int main() {
|
int main(void) {
|
||||||
printf(\"%d\", (int) sizeof(long));
|
printf(\"%d\", (int) sizeof(long));
|
||||||
return 0;
|
return 0;
|
||||||
}"
|
}"
|
||||||
@@ -46,7 +46,7 @@ nxt_feature_incs=
|
|||||||
nxt_feature_libs=
|
nxt_feature_libs=
|
||||||
nxt_feature_test="#include <stdio.h>
|
nxt_feature_test="#include <stdio.h>
|
||||||
|
|
||||||
int main() {
|
int main(void) {
|
||||||
printf(\"%d\", (int) sizeof(long long));
|
printf(\"%d\", (int) sizeof(long long));
|
||||||
return 0;
|
return 0;
|
||||||
}"
|
}"
|
||||||
@@ -60,7 +60,7 @@ nxt_feature_incs=
|
|||||||
nxt_feature_libs=
|
nxt_feature_libs=
|
||||||
nxt_feature_test="#include <stdio.h>
|
nxt_feature_test="#include <stdio.h>
|
||||||
|
|
||||||
int main() {
|
int main(void) {
|
||||||
printf(\"%d\", (int) sizeof(void *));
|
printf(\"%d\", (int) sizeof(void *));
|
||||||
return 0;
|
return 0;
|
||||||
}"
|
}"
|
||||||
@@ -80,7 +80,7 @@ nxt_feature_incs=
|
|||||||
nxt_feature_libs=
|
nxt_feature_libs=
|
||||||
nxt_feature_test="#include <stdio.h>
|
nxt_feature_test="#include <stdio.h>
|
||||||
|
|
||||||
int main() {
|
int main(void) {
|
||||||
printf(\"%d\", (int) sizeof(size_t));
|
printf(\"%d\", (int) sizeof(size_t));
|
||||||
return 0;
|
return 0;
|
||||||
}"
|
}"
|
||||||
@@ -96,7 +96,7 @@ nxt_feature_test="#define _FILE_OFFSET_BITS 64
|
|||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
int main() {
|
int main(void) {
|
||||||
printf(\"%d\", (int) sizeof(off_t));
|
printf(\"%d\", (int) sizeof(off_t));
|
||||||
return 0;
|
return 0;
|
||||||
}"
|
}"
|
||||||
@@ -111,7 +111,7 @@ nxt_feature_libs=
|
|||||||
nxt_feature_test="#include <time.h>
|
nxt_feature_test="#include <time.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
int main() {
|
int main(void) {
|
||||||
printf(\"%d\", (int) sizeof(time_t));
|
printf(\"%d\", (int) sizeof(time_t));
|
||||||
return 0;
|
return 0;
|
||||||
}"
|
}"
|
||||||
|
|||||||
18
auto/unix
18
auto/unix
@@ -13,7 +13,7 @@ nxt_feature_libs=
|
|||||||
nxt_feature_test="#include <unistd.h>
|
nxt_feature_test="#include <unistd.h>
|
||||||
#include <sys/random.h>
|
#include <sys/random.h>
|
||||||
|
|
||||||
int main() {
|
int main(void) {
|
||||||
char buf[4];
|
char buf[4];
|
||||||
|
|
||||||
if (getrandom(buf, 4, 0) < 0) {
|
if (getrandom(buf, 4, 0) < 0) {
|
||||||
@@ -35,7 +35,7 @@ if [ $nxt_found = no ]; then
|
|||||||
#include <sys/syscall.h>
|
#include <sys/syscall.h>
|
||||||
#include <linux/random.h>
|
#include <linux/random.h>
|
||||||
|
|
||||||
int main() {
|
int main(void) {
|
||||||
char buf[4];
|
char buf[4];
|
||||||
|
|
||||||
if (syscall(SYS_getrandom, buf, 4, 0) < 0) {
|
if (syscall(SYS_getrandom, buf, 4, 0) < 0) {
|
||||||
@@ -56,7 +56,7 @@ if [ $nxt_found = no ]; then
|
|||||||
nxt_feature_name=NXT_HAVE_GETENTROPY
|
nxt_feature_name=NXT_HAVE_GETENTROPY
|
||||||
nxt_feature_test="#include <unistd.h>
|
nxt_feature_test="#include <unistd.h>
|
||||||
|
|
||||||
int main() {
|
int main(void) {
|
||||||
char buf[4];
|
char buf[4];
|
||||||
|
|
||||||
if (getentropy(buf, 4) == -1) {
|
if (getentropy(buf, 4) == -1) {
|
||||||
@@ -78,7 +78,7 @@ if [ $nxt_found = no ]; then
|
|||||||
nxt_feature_test="#include <unistd.h>
|
nxt_feature_test="#include <unistd.h>
|
||||||
#include <sys/random.h>
|
#include <sys/random.h>
|
||||||
|
|
||||||
int main() {
|
int main(void) {
|
||||||
char buf[4];
|
char buf[4];
|
||||||
|
|
||||||
if (getentropy(buf, 4) == -1) {
|
if (getentropy(buf, 4) == -1) {
|
||||||
@@ -99,7 +99,7 @@ nxt_feature_libs=
|
|||||||
nxt_feature_test="#include <stdlib.h>
|
nxt_feature_test="#include <stdlib.h>
|
||||||
#include <ucontext.h>
|
#include <ucontext.h>
|
||||||
|
|
||||||
int main() {
|
int main(void) {
|
||||||
ucontext_t uc;
|
ucontext_t uc;
|
||||||
|
|
||||||
if (getcontext(&uc) == 0) {
|
if (getcontext(&uc) == 0) {
|
||||||
@@ -126,7 +126,7 @@ if [ $nxt_found = no ]; then
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <ucontext.h>
|
#include <ucontext.h>
|
||||||
|
|
||||||
int main() {
|
int main(void) {
|
||||||
ucontext_t uc;
|
ucontext_t uc;
|
||||||
|
|
||||||
if (getcontext(&uc) == 0) {
|
if (getcontext(&uc) == 0) {
|
||||||
@@ -155,7 +155,7 @@ nxt_feature_libs=
|
|||||||
nxt_feature_test="#include <stdlib.h>
|
nxt_feature_test="#include <stdlib.h>
|
||||||
#include <dlfcn.h>
|
#include <dlfcn.h>
|
||||||
|
|
||||||
int main() {
|
int main(void) {
|
||||||
void *h = dlopen(NULL, RTLD_NOW | RTLD_GLOBAL);
|
void *h = dlopen(NULL, RTLD_NOW | RTLD_GLOBAL);
|
||||||
dlsym(h, \"\");
|
dlsym(h, \"\");
|
||||||
dlclose(h);
|
dlclose(h);
|
||||||
@@ -188,7 +188,7 @@ nxt_feature_libs=
|
|||||||
nxt_feature_test="#include <stdlib.h>
|
nxt_feature_test="#include <stdlib.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
int main() {
|
int main(void) {
|
||||||
setproctitle(\"%s\", \"title\");
|
setproctitle(\"%s\", \"title\");
|
||||||
return 0;
|
return 0;
|
||||||
}"
|
}"
|
||||||
@@ -204,7 +204,7 @@ nxt_feature_libs=
|
|||||||
nxt_feature_test="#include <unistd.h>
|
nxt_feature_test="#include <unistd.h>
|
||||||
#include <grp.h>
|
#include <grp.h>
|
||||||
|
|
||||||
int main() {
|
int main(void) {
|
||||||
getgrouplist(\"root\", 0, NULL, NULL);
|
getgrouplist(\"root\", 0, NULL, NULL);
|
||||||
return 0;
|
return 0;
|
||||||
}"
|
}"
|
||||||
|
|||||||
Reference in New Issue
Block a user