summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xConfigure42
-rw-r--r--Cross/config.sh-arm-linux1
-rw-r--r--NetWare/config.wc1
-rw-r--r--Porting/Glossary5
-rw-r--r--config_h.SH6
-rw-r--r--configure.com1
-rw-r--r--epoc/config.sh1
-rw-r--r--plan9/config_sh.sample1
-rw-r--r--symbian/config.sh1
-rwxr-xr-xuconfig.sh1
-rw-r--r--win32/config.bc1
-rw-r--r--win32/config.gc1
-rw-r--r--win32/config.vc1
-rw-r--r--win32/config.vc641
14 files changed, 64 insertions, 0 deletions
diff --git a/Configure b/Configure
index 6ddb054323..a4b4887fc7 100755
--- a/Configure
+++ b/Configure
@@ -383,6 +383,7 @@ d_ctermid_r=''
ctime_r_proto=''
d_ctime_r=''
d_cuserid=''
+d_c99_variadic_macros=''
d_dbl_dig=''
d_dbminitproto=''
d_difftime=''
@@ -19164,6 +19165,46 @@ EOCP
;;
esac
+: see if the Compiler supports C99 variadic macros
+case "$i_stdarg$i_stdlib" in
+ "$define$define")
+ echo "You have <stdarg.h> and <stdlib.h>, so checking for C99 variadic macros." >&4
+ $cat >try.c <<EOCP
+#include <stdio.h>
+#include <stdarg.h>
+
+#define foo(buffer, format, ...) sprintf(buffer, format, __VA_ARGS__)
+
+int main() {
+ char buf[20];
+ foo(buf, "%d %g %.*s", 123, 456.0, (int)3, "789fail");
+ puts(buf);
+ return 0;
+}
+EOCP
+ set try
+ if eval $compile && $run ./try 2>&1 >/dev/null; then
+ case "`$run ./try`" in
+ "123 456 789")
+ echo "You have C99 variadic macros." >&4
+ d_c99_variadic_macros="$define"
+ ;;
+ *)
+ echo "You don't have functional C99 variadic macros." >&4
+ d_c99_variadic_macros="$undef"
+ ;;
+ esac
+ else
+ echo "I couldn't compile and run the test program, so I assume that you don't have functional C99 variadic macros." >&4
+ d_c99_variadic_macros="$undef"
+ fi
+ ;;
+ *)
+ echo "You don't have <stdarg.h> and <stdlib.h>, so not checking for C99 variadic macros." >&4
+ d_c99_variadic_macros="$undef"
+ ;;
+esac
+
: see what type is used for size_t
rp="What is the type used for the length parameter for string functions?"
set size_t sizetype 'unsigned int' stdio.h sys/types.h
@@ -21276,6 +21317,7 @@ d_csh='$d_csh'
d_ctermid_r='$d_ctermid_r'
d_ctime_r='$d_ctime_r'
d_cuserid='$d_cuserid'
+d_c99_variadic_macros='$d_c99_variadic_macros'
d_dbl_dig='$d_dbl_dig'
d_dbminitproto='$d_dbminitproto'
d_difftime='$d_difftime'
diff --git a/Cross/config.sh-arm-linux b/Cross/config.sh-arm-linux
index de83224539..863c44ac55 100644
--- a/Cross/config.sh-arm-linux
+++ b/Cross/config.sh-arm-linux
@@ -141,6 +141,7 @@ d_crypt_r='undef'
d_csh='define'
d_ctermid_r='undef'
d_ctime_r='undef'
+d_c99_variadic_macros='undef'
d_cuserid='define'
d_dbl_dig='define'
d_dbminitproto='undef'
diff --git a/NetWare/config.wc b/NetWare/config.wc
index 005a1d22ed..511ebf3f57 100644
--- a/NetWare/config.wc
+++ b/NetWare/config.wc
@@ -129,6 +129,7 @@ d_crypt_r='undef'
d_csh='undef'
d_ctermid_r='undef'
d_ctime_r='undef'
+d_c99_variadic_macros='undef'
d_cuserid='undef'
d_dbl_dig='define'
d_dbminitproto='undef'
diff --git a/Porting/Glossary b/Porting/Glossary
index 35e0e8b36e..767db1cd80 100644
--- a/Porting/Glossary
+++ b/Porting/Glossary
@@ -558,6 +558,11 @@ d_ctime_r (d_ctime_r.U):
which indicates to the C program that the ctime_r()
routine is available.
+d_c99_variadic_macros (d_c99_variadic_macros.U):
+ This variable conditionally defines the HAS_C99_VARIADIC_MACROS
+ symbol, which indicates to the C program that C99 variadic macros
+ are available.
+
d_cuserid (d_cuserid.U):
This variable conditionally defines the HAS_CUSERID symbol, which
indicates to the C program that the cuserid() routine is available
diff --git a/config_h.SH b/config_h.SH
index 463910269e..ee4c292f0e 100644
--- a/config_h.SH
+++ b/config_h.SH
@@ -4421,4 +4421,10 @@ sed <<!GROK!THIS! >$CONFIG_H -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un
#endif
#endif
+
+/* HAS_C99_VARIADIC_MACROS:
+ * If defined, the compiler supports C99 variadic macros.
+ */
+#$d_c99_variadic_macros HAS_C99_VARIADIC_MACROS /**/
+
!GROK!THIS!
diff --git a/configure.com b/configure.com
index 62e4192efb..b8d6da7318 100644
--- a/configure.com
+++ b/configure.com
@@ -5703,6 +5703,7 @@ $ WC "d_copysignl='define'"
$ WC "d_crypt='define'"
$ WC "d_csh='undef'"
$ WC "d_cuserid='define'"
+$ WC "d_c99_variadic_macros='undef'"
$ WC "d_dbl_dig='define'"
$ WC "d_dbminitproto='undef'"
$ WC "d_difftime='define'"
diff --git a/epoc/config.sh b/epoc/config.sh
index d7e9469f8e..217b6c8ba8 100644
--- a/epoc/config.sh
+++ b/epoc/config.sh
@@ -134,6 +134,7 @@ d_crypt_r='undef'
d_csh='undef'
d_ctermid_r='undef'
d_ctime_r='undef'
+d_c99_variadic_macros='undef'
d_cuserid='undef'
d_dbl_dig='undef'
d_dbminitproto='undef'
diff --git a/plan9/config_sh.sample b/plan9/config_sh.sample
index ddf15cca18..8697741083 100644
--- a/plan9/config_sh.sample
+++ b/plan9/config_sh.sample
@@ -141,6 +141,7 @@ d_crypt_r='undef'
d_csh='undef'
d_ctermid_r='undef'
d_ctime_r='undef'
+d_c99_variadic_macros='undef'
d_cuserid='define'
d_dbl_dig='define'
d_dbminitproto='undef'
diff --git a/symbian/config.sh b/symbian/config.sh
index b1bb7724c2..2e7327fdb2 100644
--- a/symbian/config.sh
+++ b/symbian/config.sh
@@ -83,6 +83,7 @@ d_crypt_r='undef'
d_csh='undef'
d_ctermid_r='undef'
d_ctime_r='undef'
+d_c99_variadic_macros='undef'
d_cuserid='undef'
d_dbl_dig='undef'
d_dbminitproto='undef'
diff --git a/uconfig.sh b/uconfig.sh
index fe046a7b9e..dc4940263b 100755
--- a/uconfig.sh
+++ b/uconfig.sh
@@ -72,6 +72,7 @@ d_crypt_r='undef'
d_csh='undef'
d_ctermid_r='undef'
d_ctime_r='undef'
+d_c99_variadic_macros='undef'
d_cuserid='undef'
d_dbl_dig='undef'
d_dbminitproto='undef'
diff --git a/win32/config.bc b/win32/config.bc
index 60d615bff9..d460097e7e 100644
--- a/win32/config.bc
+++ b/win32/config.bc
@@ -131,6 +131,7 @@ d_crypt_r='undef'
d_csh='undef'
d_ctermid_r='undef'
d_ctime_r='undef'
+d_c99_variadic_macros='undef'
d_cuserid='undef'
d_dbl_dig='define'
d_dbminitproto='undef'
diff --git a/win32/config.gc b/win32/config.gc
index 2f5bc67df3..da97c1abae 100644
--- a/win32/config.gc
+++ b/win32/config.gc
@@ -131,6 +131,7 @@ d_crypt_r='undef'
d_csh='undef'
d_ctermid_r='undef'
d_ctime_r='undef'
+d_c99_variadic_macros='undef'
d_cuserid='undef'
d_dbl_dig='define'
d_dbminitproto='undef'
diff --git a/win32/config.vc b/win32/config.vc
index 89e3242f74..ec90484884 100644
--- a/win32/config.vc
+++ b/win32/config.vc
@@ -131,6 +131,7 @@ d_crypt_r='undef'
d_csh='undef'
d_ctermid_r='undef'
d_ctime_r='undef'
+d_c99_variadic_macros='undef'
d_cuserid='undef'
d_dbl_dig='define'
d_dbminitproto='undef'
diff --git a/win32/config.vc64 b/win32/config.vc64
index 6e5c748b75..bcda881865 100644
--- a/win32/config.vc64
+++ b/win32/config.vc64
@@ -131,6 +131,7 @@ d_crypt_r='undef'
d_csh='undef'
d_ctermid_r='undef'
d_ctime_r='undef'
+d_c99_variadic_macros='undef'
d_cuserid='undef'
d_dbl_dig='define'
d_dbminitproto='undef'