signal_t=''
d_volatile=''
d_charvspr=''
+d_sprintf_returns_strlen=''
d_vprintf=''
d_wait4=''
d_waitpid=''
esac
+: see if sprintf returns the length of the string in the buffer as per ANSI
+$echo "Checking whether sprintf returns the length of the string..." >&4
+$cat <<EOP >try.c
+#include <stdio.h>
+#$i_stdlib I_STDLIB
+#ifdef I_STDLIB
+#include <stdlib.h>
+#endif
+#$i_string I_STRING
+#ifdef I_STRING
+# include <string.h>
+#else
+# include <strings.h>
+#endif
+#$i_math I_MATH
+#ifdef I_MATH
+#include <math.h>
+#endif
+
+char buffer[256];
+
+int check (size_t expect, int test) {
+ size_t got = strlen(buffer);
+ if (expect == got)
+ return 0;
+
+ printf("expected %ld, got %ld in test %d '%s'\n", (long) expect, (long) got,
+ test, buffer);
+ exit (test);
+}
+
+int main(int argc, char **argv) {
+ int test = 0;
+
+ check(sprintf(buffer, ""), ++test);
+ check(sprintf(buffer, "%s %s", "perl", "rules"), ++test);
+ check(sprintf(buffer, "I like %g", atan2(0,-1)), ++test);
+
+ return 0;
+}
+EOP
+set try
+
+d_sprintf_returns_strlen="$undef"
+if eval $compile; then
+ xxx="`$run ./try`"
+ case "$?" in
+ 0) cat >&4 <<EOM
+sprintf returns the length of the string (as ANSI says it should)
+EOM
+ d_sprintf_returns_strlen="$define"
+ ;;
+ *) cat >&4 <<EOM
+sprintf does not return the length of the string (how old is this system?)
+EOM
+ d_sprintf_returns_strlen="$undef"
+ ;;
+ esac
+fi
+
+$rm -f try.* try
+
: see if link exists
set link d_link
eval $inlibc
d_voidsig='$d_voidsig'
d_voidtty='$d_voidtty'
d_volatile='$d_volatile'
+d_sprintf_returns_strlen='$d_sprintf_returns_strlen'
d_vprintf='$d_vprintf'
d_wait4='$d_wait4'
d_waitpid='$d_waitpid'
This variable conditionally defines the HAS_SOCKS5_INIT symbol, which
indicates to the C program that the socks5_init() routine is available.
+d_sprintf_returns_strlen (d_sprintf_returns_strlen.U):
+ This variable defines whether sprintf returns the length of the string
+ (as per the ANSI spec). Some C libraries retain compatibility with
+ pre-ANSI C and return a pointer to the passed in buffer; for these
+ this variable will be undef.
+
d_sqrtl (d_sqrtl.U):
This variable conditionally defines the HAS_SQRTL symbol, which
indicates to the C program that the sqrtl() routine is available.
$ WC "d_socklen_t='" + d_socklen_t + "'"
$ WC "d_sockpair='" + d_sockpair + "'"
$ WC "d_socks5_init='undef'"
+$ WC "d_sprintf_returns_strlen='undef'"
$ WC "d_sqrtl='define'"
$ WC "d_sresgproto='undef'"
$ WC "d_sresgproto='undef'"