From: H.Merijn Brand Date: Sun, 31 Oct 2004 16:33:17 +0000 (+0000) Subject: The next step in strlcat ()/ strcpy () detection and usage X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=dc750f2e2552556d058aca8bac0a882290acbc05;p=p5sagit%2Fp5-mst-13.2.git The next step in strlcat ()/ strcpy () detection and usage preparation. Change to handy.h eeded for config_h.SH p4raw-id: //depot/perl@23450 --- diff --git a/config_h.SH b/config_h.SH index 193e024..472b5d4 100644 --- a/config_h.SH +++ b/config_h.SH @@ -2519,6 +2519,18 @@ sed <$CONFIG_H -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un #$d_strerror_r HAS_STRERROR_R /**/ #define STRERROR_R_PROTO $strerror_r_proto /**/ +/* HAS_STRLCAT: + * This symbol, if defined, indicates that the strlcat () routine is + * available to do string concatenation. + */ +#$d_strlcat HAS_STRLCAT /**/ + +/* HAS_STRLCPY: + * This symbol, if defined, indicates that the strlcpy () routine is + * available to do string copying. + */ +#$d_strlcpy HAS_STRLCPY /**/ + /* HAS_STRTOLD: * This symbol, if defined, indicates that the strtold routine is * available to convert strings to long doubles. @@ -3059,7 +3071,7 @@ sed <$CONFIG_H -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un /* PERL_MALLOC_WRAP: * This symbol, if defined, indicates that we'd like malloc wrap checks. */ -#$usemallocwrap PERL_MALLOC_WRAP /**/ +#$usemallocwrap PERL_MALLOC_WRAP /**/ /* MYMALLOC: * This symbol, if defined, indicates that we're using our own malloc. @@ -3932,18 +3944,6 @@ sed <$CONFIG_H -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un */ #$d_strftime HAS_STRFTIME /**/ -/* HAS_STRLCAT - * This symbol, if defined, indicates that the strlcat routine is - * available to do string concatenation. - */ -#$d_strlcat HAS_STRLCAT /**/ - -/* HAS_STRLCPY: - * This symbol, if defined, indicates that the strlcpy routine is - * available to do string copying. - */ -#$d_strlcpy HAS_STRLCPY /**/ - /* HAS_SYSCALL_PROTO: * This symbol, if defined, indicates that the system provides * a prototype for the syscall() function. Otherwise, it is up diff --git a/handy.h b/handy.h index e5c7c45..904b67c 100644 --- a/handy.h +++ b/handy.h @@ -159,6 +159,19 @@ typedef U64TYPE U64; # endif #endif +/* H.Merijn Brand [ 31 Oct 2004 ] + * Not (yet) used at top level, but mention them for metaconfig */ +#ifdef HAS_STRLCAT +# define STRNCAT strlcat +#else +# define STRNCAT strncat +#endif +#ifdef HAS_STRLCPY +# define STRNCPY strlcpy +#else +# define STRNCPY strncpy +#endif + /* Mention I8SIZE, U8SIZE, I16SIZE, U16SIZE, I32SIZE, U32SIZE, I64SIZE, and U64SIZE here so that metaconfig pulls them in. */