diff options
author | Darren Tucker <dtucker@zip.com.au> | 2005-12-17 22:32:03 +1100 |
---|---|---|
committer | Darren Tucker <dtucker@zip.com.au> | 2005-12-17 22:32:03 +1100 |
commit | d40c66cf3f5d7713ea9489778dc450a48984a81d (patch) | |
tree | 2467c34954fa48e473fa0c944b5c29f455b32d99 /configure.ac | |
parent | 98cfc4ce9d2a6f34b63f1354f3149b501398a160 (diff) |
- (dtucker) [configure.ac openbsd-compat/bsd-snprintf.c] Bug #1133: Our
snprintf replacement can have a conflicting declaration in HP-UX's system
headers (const vs. no const) so we now check for and work around it. Patch
from the dynamic duo of David Leonard and Ted Percival.
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/configure.ac b/configure.ac index 80daa0c2..df85e319 100644 --- a/configure.ac +++ b/configure.ac @@ -1,4 +1,4 @@ -# $Id: configure.ac,v 1.314 2005/12/13 09:44:13 djm Exp $ +# $Id: configure.ac,v 1.315 2005/12/17 11:32:03 dtucker Exp $ # # Copyright (c) 1999-2004 Damien Miller # @@ -1343,6 +1343,20 @@ int main(void) ) fi +# On systems where [v]snprintf is broken, but is declared in stdio, +# check that the fmt argument is const char * or just char *. +# This is only useful for when BROKEN_SNPRINTF +AC_MSG_CHECKING([whether snprintf can declare const char *fmt]) +AC_COMPILE_IFELSE([AC_LANG_SOURCE([[#include <stdio.h> + int snprintf(char *a, size_t b, const char *c, ...) { return 0; } + int main(void) { snprintf(0, 0, 0); } + ]])], + [AC_MSG_RESULT(yes) + AC_DEFINE(SNPRINTF_CONST, [const], + [Define as const if snprintf() can declare const char *fmt])], + [AC_MSG_RESULT(no) + AC_DEFINE(SNPRINTF_CONST, [/* not const */])]) + # Check for missing getpeereid (or equiv) support NO_PEERCHECK="" if test "x$ac_cv_func_getpeereid" != "xyes" ; then |