summaryrefslogtreecommitdiffhomepage
path: root/auto/fmt/longlong
diff options
context:
space:
mode:
Diffstat (limited to 'auto/fmt/longlong')
-rw-r--r--auto/fmt/longlong45
1 files changed, 45 insertions, 0 deletions
diff --git a/auto/fmt/longlong b/auto/fmt/longlong
new file mode 100644
index 000000000..4a5e0844a
--- /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