Change CTASSERT to __CTASSERT (the spelling used in <sys/cdefs.h>),
include <sys/cdefs.h> so that it will be defined, and move it to a better place. The previous CTASSERT would never have been used because of the ifdef. If it had been used, it would have had unwanted effects from being just after the "static inline" that appears when BZERO is defined. Also move the __RCSID to a more conventional location.
This commit is contained in:
parent
83aeaf7ea6
commit
2953114330
|
@ -27,6 +27,11 @@
|
|||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
#if defined(LIBC_SCCS) && !defined(lint)
|
||||
__RCSID("$NetBSD: memset2.c,v 1.4 2012/03/02 16:19:15 apb Exp $");
|
||||
#endif /* LIBC_SCCS and not lint */
|
||||
|
||||
#include <sys/types.h>
|
||||
|
||||
#if !defined(_KERNEL) && !defined(_STANDALONE)
|
||||
|
@ -52,15 +57,13 @@
|
|||
#endif
|
||||
#undef memset
|
||||
|
||||
#if defined(LIBC_SCCS) && !defined(lint)
|
||||
__RCSID("$NetBSD: memset2.c,v 1.3 2011/11/08 16:52:11 joerg Exp $");
|
||||
#endif /* LIBC_SCCS and not lint */
|
||||
|
||||
/*
|
||||
* Assume uregister_t is the widest non-synthetic unsigned type.
|
||||
*/
|
||||
typedef uregister_t memword_t;
|
||||
|
||||
__CTASSERT((~(memword_t)0U >> 1) != ~(memword_t)0U);
|
||||
|
||||
#ifdef BZERO
|
||||
static inline
|
||||
#define memset memset0
|
||||
|
@ -71,10 +74,6 @@ static
|
|||
#define memset test_memset
|
||||
#endif
|
||||
|
||||
#ifdef CTASSERT
|
||||
CTASSERT((~(memword_t)0U >> 1) != ~(memword_t)0U);
|
||||
#endif
|
||||
|
||||
void *
|
||||
memset(void *addr, int c, size_t len)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue