forked from github/server
Im Falle von !NDEBUG (Debug builds) wird strlcpy nicht inline gemacht (gdb
stellt sich wieder mal Kacke an)
This commit is contained in:
parent
4b6cbc45c6
commit
6b1d86e5ae
|
@ -11,6 +11,7 @@ SEARCH_SOURCE +=
|
|||
SOURCES =
|
||||
attrib.c
|
||||
base36.c
|
||||
bsdstring.c
|
||||
command.c
|
||||
crmessage.c
|
||||
cvector.c
|
||||
|
@ -40,8 +41,4 @@ if $(MSPACES) {
|
|||
SOURCES += <dl>malloc.c ;
|
||||
}
|
||||
|
||||
if $(NO_INLINE) {
|
||||
SOURCES += bsdstring.c ;
|
||||
}
|
||||
|
||||
Library util : $(SOURCES) ;
|
||||
|
|
|
@ -2,6 +2,11 @@
|
|||
#include <string.h>
|
||||
#include "bsdstring.h"
|
||||
|
||||
#ifndef HAVE_INLINE
|
||||
# undef INLINE_FUNCTION
|
||||
# define INLINE_FUNCTION
|
||||
#endif
|
||||
|
||||
#if !defined(HAVE_STRLCPY)
|
||||
INLINE_FUNCTION size_t
|
||||
strlcpy(char *dst, const char *src, size_t siz) /* copied from OpenBSD source code */
|
||||
|
|
|
@ -1,14 +1,18 @@
|
|||
#ifndef UTIL_BSDSTRING_H
|
||||
#define UTIL_BSDSTRING_H
|
||||
|
||||
#ifndef NDEBUG
|
||||
# undef HAVE_INLINE
|
||||
#endif
|
||||
|
||||
#if !defined(HAVE_STRLCPY)
|
||||
# ifdef HAVE_INLINE
|
||||
# include "bsdstring.c"
|
||||
# define HAVE_STRLCPY
|
||||
# else
|
||||
extern size_t strlcpy(char *dst, const char *src, size_t siz);
|
||||
extern size_t strlcat(char * dst, const char * src, size_t siz);
|
||||
# endif
|
||||
# define HAVE_STRLCPY
|
||||
#endif
|
||||
|
||||
#if !defined(HAVE_STRLPRINTF)
|
||||
|
|
Loading…
Reference in New Issue