uintptr_t 915 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. # Copyright (C) Igor Sysoev
  2. # Copyright (C) Nginx, Inc.
  3. echo $ngx_n "checking for uintptr_t ...$ngx_c"
  4. cat << END >> $NGX_AUTOCONF_ERR
  5. ----------------------------------------
  6. checking for uintptr_t
  7. END
  8. found=no
  9. cat << END > $NGX_AUTOTEST.c
  10. #include <sys/types.h>
  11. $NGX_INCLUDE_INTTYPES_H
  12. int main(void) {
  13. uintptr_t i = 0;
  14. return (int) i;
  15. }
  16. END
  17. ngx_test="$CC $CC_TEST_FLAGS $CC_AUX_FLAGS \
  18. -o $NGX_AUTOTEST $NGX_AUTOTEST.c $NGX_LD_OPT"
  19. eval "$ngx_test >> $NGX_AUTOCONF_ERR 2>&1"
  20. if [ -x $NGX_AUTOTEST ]; then
  21. echo " uintptr_t found"
  22. found=yes
  23. else
  24. echo $ngx_n " uintptr_t not found" $ngx_c
  25. fi
  26. rm -rf $NGX_AUTOTEST*
  27. if [ $found = no ]; then
  28. found="uint`expr 8 \* $ngx_ptr_size`_t"
  29. echo ", $found used"
  30. echo "typedef $found uintptr_t;" >> $NGX_AUTO_CONFIG_H
  31. echo "typedef $found intptr_t;" | sed -e 's/u//g' >> $NGX_AUTO_CONFIG_H
  32. fi