Im Falle von !NDEBUG (Debug builds) wird strlcpy nicht inline gemacht (gdb

stellt sich wieder mal Kacke an)
This commit is contained in:
Enno Rehling 2005-07-04 21:38:28 +00:00
parent 4b6cbc45c6
commit 6b1d86e5ae
3 changed files with 11 additions and 5 deletions

View File

@ -11,6 +11,7 @@ SEARCH_SOURCE +=
SOURCES = SOURCES =
attrib.c attrib.c
base36.c base36.c
bsdstring.c
command.c command.c
crmessage.c crmessage.c
cvector.c cvector.c
@ -40,8 +41,4 @@ if $(MSPACES) {
SOURCES += <dl>malloc.c ; SOURCES += <dl>malloc.c ;
} }
if $(NO_INLINE) {
SOURCES += bsdstring.c ;
}
Library util : $(SOURCES) ; Library util : $(SOURCES) ;

View File

@ -2,6 +2,11 @@
#include <string.h> #include <string.h>
#include "bsdstring.h" #include "bsdstring.h"
#ifndef HAVE_INLINE
# undef INLINE_FUNCTION
# define INLINE_FUNCTION
#endif
#if !defined(HAVE_STRLCPY) #if !defined(HAVE_STRLCPY)
INLINE_FUNCTION size_t INLINE_FUNCTION size_t
strlcpy(char *dst, const char *src, size_t siz) /* copied from OpenBSD source code */ strlcpy(char *dst, const char *src, size_t siz) /* copied from OpenBSD source code */

View File

@ -1,14 +1,18 @@
#ifndef UTIL_BSDSTRING_H #ifndef UTIL_BSDSTRING_H
#define UTIL_BSDSTRING_H #define UTIL_BSDSTRING_H
#ifndef NDEBUG
# undef HAVE_INLINE
#endif
#if !defined(HAVE_STRLCPY) #if !defined(HAVE_STRLCPY)
# ifdef HAVE_INLINE # ifdef HAVE_INLINE
# include "bsdstring.c" # include "bsdstring.c"
# define HAVE_STRLCPY
# else # else
extern size_t strlcpy(char *dst, const char *src, size_t siz); extern size_t strlcpy(char *dst, const char *src, size_t siz);
extern size_t strlcat(char * dst, const char * src, size_t siz); extern size_t strlcat(char * dst, const char * src, size_t siz);
# endif # endif
# define HAVE_STRLCPY
#endif #endif
#if !defined(HAVE_STRLPRINTF) #if !defined(HAVE_STRLPRINTF)