nginx-0.0.1-2003-11-20-20:36:43 import
diff --git a/auto/configure b/auto/configure
index c30b52d..8b182d9 100755
--- a/auto/configure
+++ b/auto/configure
@@ -4,6 +4,20 @@
echo > ngx_auto_config.h
+NGX_TYPE="long"; . auto/types/sizeof; NGX_MAX_LONG=$NGX_MAX_SIZE
+NGX_FORMATS="l"; . auto/fmt/fmt
+
+
+NGX_TYPE="long long"; . auto/types/sizeof; NGX_MAX_LONG_LONG=$NGX_MAX_SIZE
+NGX_FORMATS="ll q"; . auto/fmt/fmt
+
+#NGX_TYPE="__int64_t"; . auto/types/typedef; NGX_TIME_T_FMT=$NGX_FMT
+
+#NGX_TYPE="time_t"; . auto/types/typedef; NGX_TIME_T_FMT=$NGX_FMT
+
+
+#exit
+
. auto/types/time_t
. auto/types/uint64_t
diff --git a/auto/fmt/fmt b/auto/fmt/fmt
new file mode 100644
index 0000000..5d270e8
--- /dev/null
+++ b/auto/fmt/fmt
@@ -0,0 +1,32 @@
+
+echo "Checking for printf() $NGX_TYPE format"
+
+NGX_FMT=NO
+
+for FMT in $NGX_FORMATS
+do
+ echo "int main() {" > autotest.c
+ echo "printf(\"%${FMT}u\", (unsigned $NGX_TYPE) -1);" >> autotest.c
+ echo "return 0; }" >> autotest.c
+
+ eval "${CC} -o autotest autotest.c > /dev/null 2>&1"
+
+ if [ -x ./autotest -a "`./autotest`" = $NGX_MAX_SIZE ]; then
+ echo " + \"%${FMT}\" used"
+ NGX_FMT=$FMT
+ else
+ echo " + \"%${FMT}\" is not appropriate"
+ fi
+
+ rm autotest*
+
+ if [ $NGX_FMT != NO ]; then
+ break
+ fi
+done
+
+
+if [ $NGX_FMT = NO ]; then
+ echo "printf() $NGX_TYPE format not found"
+ exit 1
+fi
diff --git a/auto/fmt/longlong b/auto/fmt/longlong
new file mode 100644
index 0000000..4a5e084
--- /dev/null
+++ b/auto/fmt/longlong
@@ -0,0 +1,45 @@
+
+echo "Checking for printf() long long format"
+
+NGX_LONG_LONG_FMT=NO
+
+ echo "int main() {" > autotest.c
+ echo "printf(\"%llu\", (unsigned long long) -1);" >> autotest.c
+ echo "return 0; }" >> autotest.c
+
+ eval "${CC} -o autotest autotest.c > /dev/null 2>&1"
+
+ if [ -x ./autotest -a "`./autotest`" = $NGX_MAX_LONG_LONG ]; then
+ echo " + \"%ll\" used"
+ NGX_LONG_LONG_FMT="ll"
+ else
+ echo " + \"%ll\" is not appropriate"
+ fi
+
+ rm autotest*
+
+
+if [ $NGX_LONG_LONG_FMT = NO ]; then
+
+ echo "int main() {" > autotest.c
+ echo "printf(\"%qu\", (unsigned long long) -1);" >> autotest.c
+ echo "return 0; }" >> autotest.c
+
+ eval "${CC} -o autotest autotest.c > /dev/null 2>&1"
+
+ if [ -x ./autotest -a "`./autotest`" = $NGX_MAX_LONG_LONG ]; then
+ echo " + \"%q\" used"
+ NGX_LONG_LONG_FMT="q"
+ else
+ echo " + \"%q\" is not appropriate"
+ fi
+
+ rm autotest*
+
+fi
+
+
+if [ $NGX_LONG_LONG_FMT = NO ]; then
+ echo "printf() long long format not found"
+ exit 1
+fi
diff --git a/auto/types/longlong b/auto/types/longlong
new file mode 100644
index 0000000..f843d5a
--- /dev/null
+++ b/auto/types/longlong
@@ -0,0 +1,31 @@
+
+echo "Checking for long long size"
+
+BYTES=
+
+echo "int main() {" > autotest.c
+echo "printf(\"%d\", sizeof(long long));" >> autotest.c
+echo "return 0; }" >> autotest.c
+
+eval "${CC} -o autotest autotest.c > /dev/null 2>&1"
+
+if [ -x ./autotest ]; then
+ BYTES=`./autotest`
+ echo " + long long is $BYTES bytes"
+fi
+
+rm autotest*
+
+case $BYTES in
+ 4)
+ NGX_MAX_LONG_LONG=4294967295
+ ;;
+
+ 8)
+ NGX_MAX_LONG_LONG=18446744073709551615
+ ;;
+
+ *)
+ echo "$0: error: can not detect long long size"
+ exit 1
+esac
diff --git a/auto/types/sizeof b/auto/types/sizeof
new file mode 100644
index 0000000..f24f4b6
--- /dev/null
+++ b/auto/types/sizeof
@@ -0,0 +1,31 @@
+
+echo "Checking for $NGX_TYPE size"
+
+BYTES=
+
+echo "int main() {" > autotest.c
+echo "printf(\"%d\", sizeof($NGX_TYPE));" >> autotest.c
+echo "return 0; }" >> autotest.c
+
+eval "${CC} -o autotest autotest.c > /dev/null 2>&1"
+
+if [ -x ./autotest ]; then
+ BYTES=`./autotest`
+ echo " + $NGX_TYPE is $BYTES bytes"
+fi
+
+rm autotest*
+
+case $BYTES in
+ 4)
+ NGX_MAX_SIZE=4294967295
+ ;;
+
+ 8)
+ NGX_MAX_SIZE=18446744073709551615
+ ;;
+
+ *)
+ echo "$0: error: can not detect $NGX_TYPE size"
+ exit 1
+esac
diff --git a/auto/types/typedef b/auto/types/typedef
new file mode 100644
index 0000000..4c7acbd
--- /dev/null
+++ b/auto/types/typedef
@@ -0,0 +1,32 @@
+
+echo "Checking for $NGX_TYPE definition"
+
+echo "#include <sys/types.h>" > autotest.c
+TYPE=`${CPP} autotest.c | \
+ awk "/^typedef.*$NGX_TYPE/ { for (i = 1; i< NF; i++) print $i}"`
+#rm autotest.c
+
+echo $TYPE
+
+case $TYPE in
+ "long long")
+ echo ' + defined as long long'
+ NGX_FMT=$NGX_LONG_LONG_FMT
+ ;;
+
+ long)
+ echo ' + defined as long'
+ NGX_FMT=$NGX_LONG_FMT
+ ;;
+
+ int)
+ echo ' + defined as int'
+ NGX_FMT=$NGX_INT_FMT
+ ;;
+
+ *)
+ echo "$0: error: unknown $NGX_TYPE definition: \"$TYPE\""
+ exit 1
+ ;;
+
+esac
diff --git a/auto/types/uintptr_t b/auto/types/uintptr_t
index f2cfe62..568c609 100644
--- a/auto/types/uintptr_t
+++ b/auto/types/uintptr_t
@@ -29,6 +29,8 @@
type="typedef $type uintptr_t;"
found=2
fi
+
+ rm autotest*
fi