1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-28 23:42:10 +03:00

Properly handle the case where strlcpy() exists in libc but isn't

declared in the system headers.  Per report from Bruce than some BSDen
are like this.
This commit is contained in:
Tom Lane
2006-10-02 00:06:18 +00:00
parent 7ceec34a73
commit 1e05359f4b
4 changed files with 156 additions and 79 deletions

View File

@ -87,6 +87,10 @@
don't. */
#undef HAVE_DECL_SNPRINTF
/* Define to 1 if you have the declaration of `strlcpy', and to 0 if you
don't. */
#undef HAVE_DECL_STRLCPY
/* Define to 1 if you have the declaration of `vsnprintf', and to 0 if you
don't. */
#undef HAVE_DECL_VSNPRINTF

View File

@ -6,7 +6,7 @@
* Portions Copyright (c) 1996-2006, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* $PostgreSQL: pgsql/src/include/port.h,v 1.101 2006/09/30 12:06:42 momjian Exp $
* $PostgreSQL: pgsql/src/include/port.h,v 1.102 2006/10/02 00:06:18 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@ -332,7 +332,7 @@ extern int inet_aton(const char *cp, struct in_addr * addr);
extern char *strdup(const char *str);
#endif
#if !defined(HAVE_STRLCPY) || defined(bsdi) /* bsdi doesn't have the prototype */
#if !HAVE_DECL_STRLCPY
extern size_t strlcpy(char *dst, const char *src, size_t siz);
#endif