# HG changeset patch # User Alexander Pyhalov # Date 1372947913 -14400 # Node ID dfcd374b3af2fd6f5892ec1f0c0c45a2d6efac74 # Parent d1349977b97514c8031cc668aab843d50eb83d44 3853 __cplusplus change and headers incompatipility with clang Reviewed by: Albert Lee Reviewed by: Andrew Stormont Reviewed by: Cedric Blancher Reviewed by: Ian Collins Reviewed by: Don Cragun Reviewed by: Richard Lowe Approved by: Dan McDonald diff -r d1349977b975 -r dfcd374b3af2 usr/src/head/malloc.h --- a/usr/src/head/malloc.h Wed Jun 26 16:36:05 2013 -0400 +++ b/usr/src/head/malloc.h Thu Jul 04 18:25:13 2013 +0400 @@ -26,8 +26,6 @@ #ifndef _MALLOC_H #define _MALLOC_H -#pragma ident "%Z%%M% %I% %E% SMI" /* SVr4.0 1.7 */ - #include #ifdef __cplusplus @@ -61,21 +59,38 @@ #if defined(__STDC__) +#if (!defined(_STRICT_STDC) && !defined(__XOPEN_OR_POSIX)) || \ + defined(_XPG3) +#if __cplusplus >= 199711L +namespace std { +#endif + void *malloc(size_t); void free(void *); void *realloc(void *, size_t); +void *calloc(size_t, size_t); + +#if __cplusplus >= 199711L +} /* end of namespace std */ + +using std::malloc; +using std::free; +using std::realloc; +using std::calloc; +#endif /* __cplusplus >= 199711L */ +#endif /* (!defined(_STRICT_STDC) && !defined(__XOPEN_OR_POSIX)) || ... */ + int mallopt(int, int); struct mallinfo mallinfo(void); -void *calloc(size_t, size_t); #else void *malloc(); void free(); void *realloc(); +void *calloc(); int mallopt(); struct mallinfo mallinfo(); -void *calloc(); #endif /* __STDC__ */ diff -r d1349977b975 -r dfcd374b3af2 usr/src/head/unistd.h --- a/usr/src/head/unistd.h Wed Jun 26 16:36:05 2013 -0400 +++ b/usr/src/head/unistd.h Thu Jul 04 18:25:13 2013 +0400 @@ -461,7 +461,15 @@ #endif #if (!defined(__XOPEN_OR_POSIX) || (defined(_XPG3) && !defined(_XPG4))) || \ defined(__EXTENSIONS__) +#if __cplusplus >= 199711L +namespace std { +#endif extern int rename(const char *, const char *); +#if __cplusplus >= 199711L +} /* end of namespace std */ + +using std::rename; +#endif /* __cplusplus >= 199711L */ #endif /* (!defined(__XOPEN_OR_POSIX) || (defined(_XPG3)... */ #if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__) extern int resolvepath(const char *, char *, size_t);