diff options
author | Bill Wendling <isanbard@gmail.com> | 2013-06-27 21:17:24 +0000 |
---|---|---|
committer | Bill Wendling <isanbard@gmail.com> | 2013-06-27 21:17:24 +0000 |
commit | da8596b60b1c90a870c9610c2cef7f06a03b6cdc (patch) | |
tree | dceeed32c99c48f71514565c711c576ad9687917 /SDKs | |
parent | 22b838bbfd9aed996f101a557621c6815615653d (diff) | |
download | compiler-rt-da8596b60b1c90a870c9610c2cef7f06a03b6cdc.tar.gz compiler-rt-da8596b60b1c90a870c9610c2cef7f06a03b6cdc.tar.bz2 compiler-rt-da8596b60b1c90a870c9610c2cef7f06a03b6cdc.tar.xz |
Declare 'strerror' so that we can use it with errno.
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@185105 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'SDKs')
-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 c7da1f57..c6ab5d8e 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__ */ |