Defining snprintf() [patch]
| From: | Colin Putney | Date: | Wed, 15 Mar 2000 04:48:11 +0000 |
| Subject: | Defining snprintf() [patch] | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-16816@lists.php.net to get a copy of this message | ||
Hi all,
I had some problems compiling b4pl1 as a CGI on Solaris 2.5.1. There
were several warnings that snprintf() and vsnprintf() were defined in
both php.h and snprintf.h. Then the the final link would fail because
ap_snprintf() was undefined in one library or another.
I'm not sure this is the proper way to do it, but I got it to compile
and link by removing the definitions in php.h and including snprintf.h
from there. This seems to work for both CGI and Apache configurations,
though Apache worked fine out of the box. See the diff below.
Colin
*** php.h~ Sat Feb 19 15:21:25 2000
--- php.h Tue Mar 14 20:06:34 2000
***************
*** 191,198 ****
#if (!HAVE_SNPRINTF)
! #define snprintf ap_snprintf
! #define vsnprintf ap_vsnprintf
! extern int ap_snprintf(char *, size_t, const char *, ...);
! extern int ap_vsnprintf(char *, size_t, const char *, va_list);
#endif
--- 191,195 ----
#if (!HAVE_SNPRINTF)
! #include "snprintf.h"
#endif
---------------------------------------------
Colin Putney cputney@whistler.net
Whistler Networks http://www.whistler.net/