From ebe55fc655e3ac05e5e8f4881809cf5fc2edc5bf Mon Sep 17 00:00:00 2001 From: Richard Smith Date: Thu, 11 Feb 2016 23:51:02 +0000 Subject: [PATCH] Instead of asking glibc to provide correct C++ signatures for 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. git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@260622 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/string.h | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/include/string.h b/include/string.h index 5f14c37e4..a1ce56cbc 100644 --- a/include/string.h +++ b/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 -// MSVCRT, GNU libc and its derivates already have the correct prototype in -// 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 +// . 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