/*
- * Copyright (c) 2000, 2007 Apple Inc. All rights reserved.
+ * Copyright (c) 2000, 2007, 2010 Apple Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
* @(#)strings.h 8.1 (Berkeley) 6/2/93
*/
-#include <sys/cdefs.h>
-
-#if (!defined(_POSIX_C_SOURCE) && !defined(_XOPEN_SOURCE)) || defined(_DARWIN_C_SOURCE)
-
-#include <string.h>
-
-#else
+#ifndef _STRINGS_H_
+#define _STRINGS_H_
#include <_types.h>
-#ifndef _SIZE_T
-#define _SIZE_T
-typedef __darwin_size_t size_t;
+#include <sys/cdefs.h>
+#include <Availability.h>
+#include <sys/_types/_size_t.h>
+
+__BEGIN_DECLS
+/* Removed in Issue 7 */
+#if !defined(_POSIX_C_SOURCE) || _POSIX_C_SOURCE < 200809L
+int bcmp(const void *, const void *, size_t) __POSIX_C_DEPRECATED(200112L);
+void bcopy(const void *, void *, size_t) __POSIX_C_DEPRECATED(200112L);
+void bzero(void *, size_t) __POSIX_C_DEPRECATED(200112L);
+char *index(const char *, int) __POSIX_C_DEPRECATED(200112L);
+char *rindex(const char *, int) __POSIX_C_DEPRECATED(200112L);
#endif
+int ffs(int);
+int strcasecmp(const char *, const char *);
+int strncasecmp(const char *, const char *, size_t);
+__END_DECLS
+
+/* Darwin extensions */
+#if __DARWIN_C_LEVEL >= __DARWIN_C_FULL
__BEGIN_DECLS
-int bcmp(const void *, const void *, size_t);
-void bcopy(const void *, void *, size_t);
-void bzero(void *, size_t);
-int ffs(int);
-char *index(const char *, int);
-char *rindex(const char *, int);
-int strcasecmp(const char *, const char *);
-int strncasecmp(const char *, const char *, size_t);
+int ffsl(long) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0);
+int ffsll(long long) __OSX_AVAILABLE_STARTING(__MAC_10_9, __IPHONE_7_0);
+int fls(int) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0);
+int flsl(long) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0);
+int flsll(long long) __OSX_AVAILABLE_STARTING(__MAC_10_9, __IPHONE_7_0);
__END_DECLS
-#endif /* (_POSIX_C_SOURCE && !_DARWIN_C_SOURCE) */
+#include <string.h>
+#endif
+
+#endif /* _STRINGS_H_ */