The internal header include/string.h does not work in C++: it causes link errors

in several C++ debug tests when any of the functions it declares are called.
The best option would be to not use internal headers for tests (unless
explicitly needed).  Add guards so that it is safe to use include/string.h from
C++.

	* include/string.h: Add __cplusplus check.
This commit is contained in:
Wilco Dijkstra 2017-02-15 15:13:58 +00:00
parent 4918e5f4cd
commit 3172b27b2b
2 changed files with 6 additions and 2 deletions

View File

@ -1,3 +1,7 @@
2017-02-15 Wilco Dijkstra <wdijkstr@arm.com>
* include/string.h: Add __cplusplus check.
2017-02-15 Gabriel F. T. Gomes <gftg@linux.vnet.ibm.com>
[BZ #21134]

View File

@ -1,6 +1,6 @@
#ifndef _STRING_H
#ifndef _ISOMAC
#if !defined _ISOMAC && !defined __cplusplus
#include <sys/types.h>
extern void *__memccpy (void *__dest, const void *__src,
@ -53,7 +53,7 @@ extern char *__strerror_r (int __errnum, char *__buf, size_t __buflen);
above are defined as macros in the headers. */
#include <string/string.h>
#ifndef _ISOMAC
#if !defined _ISOMAC && !defined __cplusplus
extern __typeof (strcoll_l) __strcoll_l;
extern __typeof (strxfrm_l) __strxfrm_l;
extern __typeof (strcasecmp_l) __strcasecmp_l;