Print this page
3853 __cplusplus change and headers incompatipility with clang

Split Close
Expand all
Collapse all
          --- old/usr/src/head/malloc.h
          +++ new/usr/src/head/malloc.h
↓ open down ↓ 18 lines elided ↑ open up ↑
  19   19   *
  20   20   * CDDL HEADER END
  21   21   */
  22   22  /*      Copyright (c) 1988 AT&T */
  23   23  /*        All Rights Reserved   */
  24   24  
  25   25  
  26   26  #ifndef _MALLOC_H
  27   27  #define _MALLOC_H
  28   28  
  29      -#pragma ident   "%Z%%M% %I%     %E% SMI"        /* SVr4.0 1.7   */
  30      -
  31   29  #include <sys/types.h>
  32   30  
  33   31  #ifdef  __cplusplus
  34   32  extern "C" {
  35   33  #endif
  36   34  
  37   35  /*
  38   36   *      Constants defining mallopt operations
  39   37   */
  40   38  #define M_MXFAST        1       /* set size of blocks to be fast */
↓ open down ↓ 13 lines elided ↑ open up ↑
  54   52          unsigned long hblkhd;   /* space in holding block headers */
  55   53          unsigned long usmblks;  /* space in small blocks in use */
  56   54          unsigned long fsmblks;  /* space in free small blocks */
  57   55          unsigned long uordblks; /* space in ordinary blocks in use */
  58   56          unsigned long fordblks; /* space in free ordinary blocks */
  59   57          unsigned long keepcost; /* cost of enabling keep option */
  60   58  };
  61   59  
  62   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   68  void *malloc(size_t);
  65   69  void free(void *);
  66   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   83  int mallopt(int, int);
  68   84  struct mallinfo mallinfo(void);
  69      -void *calloc(size_t, size_t);
  70   85  
  71   86  #else
  72   87  
  73   88  void *malloc();
  74   89  void free();
  75   90  void *realloc();
       91 +void *calloc();
  76   92  int mallopt();
  77   93  struct mallinfo mallinfo();
  78      -void *calloc();
  79   94  
  80   95  #endif  /* __STDC__ */
  81   96  
  82   97  #ifdef  __cplusplus
  83   98  }
  84   99  #endif
  85  100  
  86  101  #endif  /* _MALLOC_H */
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX