mirror of
https://sourceware.org/git/glibc.git
synced 2025-07-29 11:41:21 +03:00
<string.h>: Define __CORRECT_ISO_CPP_STRING_H_PROTO for Clang [BZ #25232]
Without the asm redirects, strchr et al. are not const-correct. libc++ has a wrapper header that works with and without __CORRECT_ISO_CPP_STRING_H_PROTO (using a Clang extension). But when Clang is used with libstdc++ or just C headers, the overloaded functions with the correct types are not declared. This change does not impact current GCC (with libstdc++ or libc++).
This commit is contained in:
committed by
Florian Weimer
parent
066d80a7cd
commit
953ceff17a
@ -33,7 +33,8 @@ __BEGIN_DECLS
|
|||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
|
|
||||||
/* Tell the caller that we provide correct C++ prototypes. */
|
/* Tell the caller that we provide correct C++ prototypes. */
|
||||||
#if defined __cplusplus && __GNUC_PREREQ (4, 4)
|
#if defined __cplusplus && (__GNUC_PREREQ (4, 4) \
|
||||||
|
|| __glibc_clang_prereq (3, 5))
|
||||||
# define __CORRECT_ISO_CPP_STRING_H_PROTO
|
# define __CORRECT_ISO_CPP_STRING_H_PROTO
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user