From 22a8c2178dff4c4f876c072c548b0a181d1bfa01 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Wed, 22 Feb 2017 06:59:39 -0600 Subject: [PATCH] cstring: undefine macros defined in new strings.h. --- include/cxx/cstring | 13 +++++++++++++ include/strings.h | 6 +++++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/include/cxx/cstring b/include/cxx/cstring index 7fca19c45a..e2b7367ab7 100644 --- a/include/cxx/cstring +++ b/include/cxx/cstring @@ -44,6 +44,19 @@ #include #include +//*************************************************************************** +// Pre-processor Definitions +//*************************************************************************** + +// Remove macros defined in strings.h. The index() definition, in +// particular, can cause naming collision problems. + +#undef bcmp +#undef bcopy +#undef bzero +#undef index +#undef rindex + //*************************************************************************** // Namespace //*************************************************************************** diff --git a/include/strings.h b/include/strings.h index bff724d9ba..e9812335f7 100644 --- a/include/strings.h +++ b/include/strings.h @@ -47,7 +47,11 @@ /**************************************************************************** * Pre-processor Definitions ****************************************************************************/ -/* Compatibility definitions */ +/* Compatibility definitions + * + * Marked LEGACY in Open Group Base Specifications Issue 6/IEEE Std 1003.1-2004 + * Removed from Open Group Base Specifications Issue 7/IEEE Std 1003.1-2008 + */ #define bcmp(b1,b2,len) memcmp(b1,b2,(size_t)len) #define bcopy(b1,b2,len) (void)memmove(b2,b1,len)