From da070d59647f30e0ef234496ab34a8d33854ece5 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Wed, 7 Aug 2002 01:04:34 +0000 Subject: [PATCH] Move strndup() declaration outside !DMALLOC #ifdef, as it's not defined by the dmalloc library. svn path=/trunk/yasm/; revision=661 --- libyasm/util.h | 3 ++- src/util.h | 3 ++- util.h | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/libyasm/util.h b/libyasm/util.h index 05d8d782..51bc282e 100644 --- a/libyasm/util.h +++ b/libyasm/util.h @@ -126,7 +126,6 @@ int strncasecmp(const char *s1, const char *s2, size_t n); #else /* strdup() implementation with error checking (using xmalloc). */ /*@only@*/ char *xstrdup(const char *str); -/*@only@*/ char *xstrndup(const char *str, size_t len); /* Error-checking memory allocation routines in xmalloc.c. */ /*@only@*/ /*@out@*/ void *xmalloc(size_t size); @@ -136,6 +135,8 @@ int strncasecmp(const char *s1, const char *s2, size_t n); void xfree(/*@only@*/ /*@out@*/ /*@null@*/ void *p) /*@modifies p@*/; #endif +/*@only@*/ char *xstrndup(const char *str, size_t len); + /* Bit-counting: used primarily by HAMT but also in a few other places. */ #define SK5 0x55555555 #define SK3 0x33333333 diff --git a/src/util.h b/src/util.h index 05d8d782..51bc282e 100644 --- a/src/util.h +++ b/src/util.h @@ -126,7 +126,6 @@ int strncasecmp(const char *s1, const char *s2, size_t n); #else /* strdup() implementation with error checking (using xmalloc). */ /*@only@*/ char *xstrdup(const char *str); -/*@only@*/ char *xstrndup(const char *str, size_t len); /* Error-checking memory allocation routines in xmalloc.c. */ /*@only@*/ /*@out@*/ void *xmalloc(size_t size); @@ -136,6 +135,8 @@ int strncasecmp(const char *s1, const char *s2, size_t n); void xfree(/*@only@*/ /*@out@*/ /*@null@*/ void *p) /*@modifies p@*/; #endif +/*@only@*/ char *xstrndup(const char *str, size_t len); + /* Bit-counting: used primarily by HAMT but also in a few other places. */ #define SK5 0x55555555 #define SK3 0x33333333 diff --git a/util.h b/util.h index 05d8d782..51bc282e 100644 --- a/util.h +++ b/util.h @@ -126,7 +126,6 @@ int strncasecmp(const char *s1, const char *s2, size_t n); #else /* strdup() implementation with error checking (using xmalloc). */ /*@only@*/ char *xstrdup(const char *str); -/*@only@*/ char *xstrndup(const char *str, size_t len); /* Error-checking memory allocation routines in xmalloc.c. */ /*@only@*/ /*@out@*/ void *xmalloc(size_t size); @@ -136,6 +135,8 @@ int strncasecmp(const char *s1, const char *s2, size_t n); void xfree(/*@only@*/ /*@out@*/ /*@null@*/ void *p) /*@modifies p@*/; #endif +/*@only@*/ char *xstrndup(const char *str, size_t len); + /* Bit-counting: used primarily by HAMT but also in a few other places. */ #define SK5 0x55555555 #define SK3 0x33333333 -- 2.40.0