summaryrefslogtreecommitdiffstats
path: root/libcxx/include/string.h
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2016-02-11 23:51:02 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2016-02-11 23:51:02 +0000
commitb1220c04cc6c8c35ba0938fe50ea1663a6a4d699 (patch)
tree5a9d936167ec6d9bba4daaa54e3c0bbac2028bf7 /libcxx/include/string.h
parent94bdbd09d75decc83d08c57dce7fbcb2d2784e80 (diff)
downloadbcm5719-llvm-b1220c04cc6c8c35ba0938fe50ea1663a6a4d699.tar.gz
bcm5719-llvm-b1220c04cc6c8c35ba0938fe50ea1663a6a4d699.zip
Instead of asking glibc to provide correct C++ signatures for <string.h>
functions, ask it whether it did provide them after the fact. Some versions of glibc fail to compile if you make this request and don't also claim to be at least GCC 4.3. llvm-svn: 260622
Diffstat (limited to 'libcxx/include/string.h')
-rw-r--r--libcxx/include/string.h14
1 files changed, 5 insertions, 9 deletions
diff --git a/libcxx/include/string.h b/libcxx/include/string.h
index 5f14c37e4ab..a1ce56cbcd6 100644
--- a/libcxx/include/string.h
+++ b/libcxx/include/string.h
@@ -58,17 +58,13 @@ size_t strlen(const char* s);
#pragma GCC system_header
#endif
-#ifdef __cplusplus
-#define __CORRECT_ISO_CPP_STRING_H_PROTO
-#endif
-
#include_next <string.h>
-// MSVCRT, GNU libc and its derivates already have the correct prototype in
-// <string.h> if __cplusplus is defined. This macro can be defined by users if
-// their C library provides the right signature.
-#if defined(__GLIBC__) || defined(_LIBCPP_MSVCRT) || defined(__sun__) || \
- defined(_STRING_H_CPLUSPLUS_98_CONFORMANCE_)
+// MSVCRT, GNU libc and its derivates may already have the correct prototype in
+// <string.h>. This macro can be defined by users if their C library provides
+// the right signature.
+#if defined(__CORRECT_ISO_CPP_STRING_H_PROTO) || defined(_LIBCPP_MSVCRT) || \
+ defined(__sun__) || defined(_STRING_H_CPLUSPLUS_98_CONFORMANCE_)
#define _LIBCPP_STRING_H_HAS_CONST_OVERLOADS
#endif
OpenPOWER on IntegriCloud