-#ifndef _POSIX_C_SOURCE
-#define EBADEXEC 85 /* Bad executable */
-#define EBADARCH 86 /* Bad CPU type in executable */
-#define ESHLIBVERS 87 /* Shared library version mismatch */
-#define EBADMACHO 88 /* Malformed Macho file */
-#endif /* _POSIX_C_SOURCE */
-
-#define ECANCELED 89 /* Operation canceled */
-
-#define EIDRM 90 /* Identifier removed */
-#define ENOMSG 91 /* No message of desired type */
-#define EILSEQ 92 /* Illegal byte sequence */
-#ifndef _POSIX_C_SOURCE
-#define ENOATTR 93 /* Attribute not found */
-#endif /* _POSIX_C_SOURCE */
-
-#define EBADMSG 94 /* Bad message */
-#define EMULTIHOP 95 /* Reserved */
-#define ENODATA 96 /* No message available on STREAM */
-#define ENOLINK 97 /* Reserved */
-#define ENOSR 98 /* No STREAM resources */
-#define ENOSTR 99 /* Not a STREAM */
-#define EPROTO 100 /* Protocol error */
-#define ETIME 101 /* STREAM ioctl timeout */
+#if __DARWIN_C_LEVEL >= __DARWIN_C_FULL
+#define EBADEXEC 85 /* Bad executable */
+#define EBADARCH 86 /* Bad CPU type in executable */
+#define ESHLIBVERS 87 /* Shared library version mismatch */
+#define EBADMACHO 88 /* Malformed Macho file */
+#endif
+
+#define ECANCELED 89 /* Operation canceled */
+
+#define EIDRM 90 /* Identifier removed */
+#define ENOMSG 91 /* No message of desired type */
+#define EILSEQ 92 /* Illegal byte sequence */
+#if __DARWIN_C_LEVEL >= __DARWIN_C_FULL
+#define ENOATTR 93 /* Attribute not found */
+#endif
+
+#define EBADMSG 94 /* Bad message */
+#define EMULTIHOP 95 /* Reserved */
+#define ENODATA 96 /* No message available on STREAM */
+#define ENOLINK 97 /* Reserved */
+#define ENOSR 98 /* No STREAM resources */
+#define ENOSTR 99 /* Not a STREAM */
+#define EPROTO 100 /* Protocol error */
+#define ETIME 101 /* STREAM ioctl timeout */