/*
- * Copyright (c) 2000-2006 Apple Computer, Inc. All rights reserved.
+ * Copyright (c) 2000-2012 Apple Inc. All rights reserved.
*
* @APPLE_OSREFERENCE_LICENSE_HEADER_START@
*
#include <sys/types.h>
#include <mach/vm_param.h>
+
#ifdef __APPLE_API_OBSOLETE
/* BCD conversions. */
extern u_char const bcd2bin_data[];
/* Prototypes for non-quad routines. */
extern int ffs(int);
-extern int locc(int, char *, u_int);
extern u_int32_t random(void);
-extern char *rindex(const char *, int);
extern int scanc(u_int, u_char *, const u_char *, int);
extern int skpc(int, int, char *);
extern long strtol(const char*, char **, int);
extern u_long strtoul(const char *, char **, int);
extern quad_t strtoq(const char *, char **, int);
extern u_quad_t strtouq(const char *, char **, int);
-extern char *strsep(char **stringp, const char *delim);
+extern char *strsep(char **, const char *);
+extern void *memchr(const void *, int, size_t);
int snprintf(char *, size_t, const char *, ...) __printflike(3,4);
static __inline__ unsigned int
clz(unsigned int num)
{
-#if __ppc__
- unsigned int result;
- __asm__ volatile(
- "cntlzw %0, %1"
- : "=r" (result)
- : "r" (num)
- );
- return result;
-
-#elif __i386__
- unsigned int result;
- __asm__ volatile(
- "bsrl %1, %0\n\t"
- "cmovel %2, %0"
- : "=r" (result)
- : "rm" (num), "r" (63)
- );
- return 31 ^ result;
-
-#elif __arm__ && !__thumb__ && defined(_ARM_ARCH_5)
- unsigned int result;
- __asm__ volatile(
- "clz %0, %1"
- : "=r" (result)
- : "r" (num)
- );
-
- return result;
-#else
return num?__builtin_clz(num):__builtin_clz(0);
-#endif
}