diff options
author | dim <dim@FreeBSD.org> | 2014-11-06 22:49:13 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2014-11-06 22:49:13 +0000 |
commit | c3f67e1dc21025f1026cbf72628b19fb37f7b53d (patch) | |
tree | 3467f3372c1195b1546172d89af2205a50b1866d /SDKs/darwin/usr/include/string.h | |
parent | 2f7fa77a0a85c00fd0cce298851e9577b98ccfe8 (diff) | |
download | FreeBSD-src-c3f67e1dc21025f1026cbf72628b19fb37f7b53d.zip FreeBSD-src-c3f67e1dc21025f1026cbf72628b19fb37f7b53d.tar.gz |
Import compiler-rt release_34 branch r197381.
https://llvm.org/svn/llvm-project/compiler-rt/branches/release_34@197381
Diffstat (limited to 'SDKs/darwin/usr/include/string.h')
-rw-r--r-- | SDKs/darwin/usr/include/string.h | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/SDKs/darwin/usr/include/string.h b/SDKs/darwin/usr/include/string.h index c7da1f5..c6ab5d8 100644 --- a/SDKs/darwin/usr/include/string.h +++ b/SDKs/darwin/usr/include/string.h @@ -28,4 +28,25 @@ char *strdup(const char *); size_t strlen(const char *); char *strncpy(char *, const char *, size_t); +/* Determine the appropriate strerror() function. */ +#if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) +# if defined(__i386) +# define __STRERROR_NAME "_strerror$UNIX2003" +# elif defined(__x86_64__) || defined(__arm) +# define __STRERROR_NAME "_strerror" +# else +# error "unrecognized architecture for targetting OS X" +# endif +#elif defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) +# if defined(__i386) || defined (__x86_64) || defined(__arm) +# define __STRERROR_NAME "_strerror" +# else +# error "unrecognized architecture for targetting iOS" +# endif +#else +# error "unrecognized architecture for targetting Darwin" +#endif + +char *strerror(int) __asm(__STRERROR_NAME); + #endif /* __STRING_H__ */ |