comparison usr/src/head/malloc.h @ 14081:dfcd374b3af2

3853 __cplusplus change and headers incompatipility with clang 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>
author Alexander Pyhalov <apyhalov@gmail.com>
date Thu, 04 Jul 2013 18:25:13 +0400
parents 68f95e015346
children
comparison
equal deleted inserted replaced
14080:d1349977b975 14081:dfcd374b3af2
23 /* All Rights Reserved */ 23 /* All Rights Reserved */
24 24
25 25
26 #ifndef _MALLOC_H 26 #ifndef _MALLOC_H
27 #define _MALLOC_H 27 #define _MALLOC_H
28
29 #pragma ident "%Z%%M% %I% %E% SMI" /* SVr4.0 1.7 */
30 28
31 #include <sys/types.h> 29 #include <sys/types.h>
32 30
33 #ifdef __cplusplus 31 #ifdef __cplusplus
34 extern "C" { 32 extern "C" {
59 unsigned long keepcost; /* cost of enabling keep option */ 57 unsigned long keepcost; /* cost of enabling keep option */
60 }; 58 };
61 59
62 #if defined(__STDC__) 60 #if defined(__STDC__)
63 61
62 #if (!defined(_STRICT_STDC) && !defined(__XOPEN_OR_POSIX)) || \
63 defined(_XPG3)
64 #if __cplusplus >= 199711L
65 namespace std {
66 #endif
67
64 void *malloc(size_t); 68 void *malloc(size_t);
65 void free(void *); 69 void free(void *);
66 void *realloc(void *, size_t); 70 void *realloc(void *, size_t);
71 void *calloc(size_t, size_t);
72
73 #if __cplusplus >= 199711L
74 } /* end of namespace std */
75
76 using std::malloc;
77 using std::free;
78 using std::realloc;
79 using std::calloc;
80 #endif /* __cplusplus >= 199711L */
81 #endif /* (!defined(_STRICT_STDC) && !defined(__XOPEN_OR_POSIX)) || ... */
82
67 int mallopt(int, int); 83 int mallopt(int, int);
68 struct mallinfo mallinfo(void); 84 struct mallinfo mallinfo(void);
69 void *calloc(size_t, size_t);
70 85
71 #else 86 #else
72 87
73 void *malloc(); 88 void *malloc();
74 void free(); 89 void free();
75 void *realloc(); 90 void *realloc();
91 void *calloc();
76 int mallopt(); 92 int mallopt();
77 struct mallinfo mallinfo(); 93 struct mallinfo mallinfo();
78 void *calloc();
79 94
80 #endif /* __STDC__ */ 95 #endif /* __STDC__ */
81 96
82 #ifdef __cplusplus 97 #ifdef __cplusplus
83 } 98 }