xref: /f-stack/app/nginx-1.16.1/auto/types/uintptr_t (revision 3da8d17d)
1
2# Copyright (C) Igor Sysoev
3# Copyright (C) Nginx, Inc.
4
5
6echo $ngx_n "checking for uintptr_t ...$ngx_c"
7
8cat << END >> $NGX_AUTOCONF_ERR
9
10----------------------------------------
11checking for uintptr_t
12
13END
14
15found=no
16
17cat << END > $NGX_AUTOTEST.c
18
19#include <sys/types.h>
20$NGX_INCLUDE_INTTYPES_H
21
22int main(void) {
23    uintptr_t i = 0;
24    return (int) i;
25}
26
27END
28
29ngx_test="$CC $CC_TEST_FLAGS $CC_AUX_FLAGS \
30          -o $NGX_AUTOTEST $NGX_AUTOTEST.c $NGX_LD_OPT"
31
32eval "$ngx_test >> $NGX_AUTOCONF_ERR 2>&1"
33
34if [ -x $NGX_AUTOTEST ]; then
35    echo " uintptr_t found"
36    found=yes
37else
38    echo $ngx_n " uintptr_t not found" $ngx_c
39fi
40
41rm -rf $NGX_AUTOTEST*
42
43
44if [ $found = no ]; then
45    found="uint`expr 8 \* $ngx_ptr_size`_t"
46    echo ", $found used"
47
48    echo "typedef $found  uintptr_t;"                   >> $NGX_AUTO_CONFIG_H
49    echo "typedef $found  intptr_t;" | sed -e 's/u//g'  >> $NGX_AUTO_CONFIG_H
50fi
51