Skip to content

Commit

Permalink
3853 __cplusplus change and headers incompatipility with clang
Browse files Browse the repository at this point in the history
Reviewed by: Albert Lee <trisk@nexenta.com>
Reviewed by: Andrew Stormont <andyjstormont@gmail.com>
Reviewed by: Cedric Blancher <cedric.blancher@googlemail.com>
Reviewed by: Ian Collins <ian@ianshome.com>
Reviewed by: Don Cragun <dcragun@sonic.net>
Reviewed by: Richard Lowe <richlowe@richlowe.net>
Approved by: Dan McDonald <danmcd@nexenta.com>
  • Loading branch information
pyhalov authored and Dan McDonald committed Jul 17, 2013
1 parent 5c069a6 commit 5bc7ce9
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 4 deletions.
23 changes: 19 additions & 4 deletions usr/src/head/malloc.h
Expand Up @@ -26,8 +26,6 @@
#ifndef _MALLOC_H
#define _MALLOC_H

#pragma ident "%Z%%M% %I% %E% SMI" /* SVr4.0 1.7 */

#include <sys/types.h>

#ifdef __cplusplus
Expand Down Expand Up @@ -61,21 +59,38 @@ struct mallinfo {

#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__ */

Expand Down
8 changes: 8 additions & 0 deletions usr/src/head/unistd.h
Expand Up @@ -461,7 +461,15 @@ extern ssize_t readlink(const char *_RESTRICT_KYWD, char *_RESTRICT_KYWD,
#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);
Expand Down

0 comments on commit 5bc7ce9

Please sign in to comment.