Print this page
remove support for non-ANSI compilation


   3  *
   4  * The contents of this file are subject to the terms of the
   5  * Common Development and Distribution License, Version 1.0 only
   6  * (the "License").  You may not use this file except in compliance
   7  * with the License.
   8  *
   9  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
  10  * or http://www.opensolaris.org/os/licensing.
  11  * See the License for the specific language governing permissions
  12  * and limitations under the License.
  13  *
  14  * When distributing Covered Code, include this CDDL HEADER in each
  15  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  16  * If applicable, add the following below this CDDL HEADER, with the
  17  * fields enclosed by brackets "[]" replaced with your own identifying
  18  * information: Portions Copyright [yyyy] [name of copyright owner]
  19  *
  20  * CDDL HEADER END
  21  */
  22 /*


  23  * Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
  24  * Use is subject to license terms.
  25  */
  26 /*
  27  * Copyright 2013 Garrett D'Amore <garrett@damore.org>
  28  */
  29 
  30 /*      Copyright (c) 1988 AT&T     */
  31 /*        All Rights Reserved   */
  32 
  33 
  34 /*
  35  * An application should not include this header directly.  Instead it
  36  * should be included only through the inclusion of other Sun headers.
  37  *
  38  * The contents of this header is limited to identifiers specified in the
  39  * C Standard.  Any new identifiers specified in future amendments to the
  40  * C Standard must be placed in this header.  If these new identifiers
  41  * are required to also be in the C++ Standard "std" namespace, then for
  42  * anything other than macro definitions, corresponding "using" directives
  43  * must also be added to <locale.h>.
  44  */
  45 
  46 #ifndef _ISO_STDLIB_ISO_H
  47 #define _ISO_STDLIB_ISO_H
  48 
  49 #include <sys/feature_tests.h>
  50 
  51 #ifdef  __cplusplus
  52 extern "C" {
  53 #endif
  54 
  55 #if defined(__STDC__)
  56 unsigned char __mb_cur_max(void);
  57 #else
  58 unsigned char __mb_cur_max();
  59 #endif
  60 #ifndef MB_CUR_MAX
  61 #define MB_CUR_MAX      (__mb_cur_max())
  62 #endif
  63 
  64 #if __cplusplus >= 199711L
  65 namespace std {
  66 #endif
  67 
  68 typedef struct {
  69         int     quot;
  70         int     rem;
  71 } div_t;
  72 
  73 typedef struct {
  74         long    quot;
  75         long    rem;
  76 } ldiv_t;
  77 
  78 #if !defined(_SIZE_T) || __cplusplus >= 199711L
  79 #define _SIZE_T


 103  * header for use by gcc and g++. In that version it adds a redundant
 104  * guard for __cplusplus. To avoid the creation of a gcc/g++ specific
 105  * header we need to include the following magic comment:
 106  *
 107  * we must use the C++ compiler's type
 108  *
 109  * The above comment should not be removed or changed until GNU
 110  * gcc/fixinc/inclhack.def is updated to bypass this header.
 111  */
 112 #if !defined(__cplusplus) || (__cplusplus < 199711L && !defined(__GNUG__))
 113 #ifndef _WCHAR_T
 114 #define _WCHAR_T
 115 #if defined(_LP64)
 116 typedef int     wchar_t;
 117 #else
 118 typedef long    wchar_t;
 119 #endif
 120 #endif  /* !_WCHAR_T */
 121 #endif  /* !defined(__cplusplus) ... */
 122 
 123 #if defined(__STDC__)
 124 
 125 extern void abort(void) __NORETURN;
 126 extern int abs(int);
 127 extern int atexit(void (*)(void));
 128 extern double atof(const char *);
 129 extern int atoi(const char *);
 130 extern long int atol(const char *);
 131 extern void *bsearch(const void *, const void *, size_t, size_t,
 132         int (*)(const void *, const void *));
 133 #if __cplusplus >= 199711L && defined(__SUNPRO_CC)
 134 extern "C++" {
 135         void *bsearch(const void *, const void *, size_t, size_t,
 136                 int (*)(const void *, const void *));
 137 }
 138 #endif /* __cplusplus >= 199711L && defined(__SUNPRO_CC) */
 139 extern void *calloc(size_t, size_t);
 140 extern div_t div(int, int);
 141 extern void exit(int)
 142         __NORETURN;
 143 extern void free(void *);
 144 extern char *getenv(const char *);


 157 #endif /* __cplusplus >= 199711L && defined(__SUNPRO_CC) */
 158 extern int rand(void);
 159 extern void *realloc(void *, size_t);
 160 extern void srand(unsigned int);
 161 extern double strtod(const char *_RESTRICT_KYWD, char **_RESTRICT_KYWD);
 162 extern long int strtol(const char *_RESTRICT_KYWD, char **_RESTRICT_KYWD, int);
 163 extern unsigned long int strtoul(const char *_RESTRICT_KYWD,
 164         char **_RESTRICT_KYWD, int);
 165 extern int system(const char *);
 166 extern int wctomb(char *, wchar_t);
 167 extern size_t wcstombs(char *_RESTRICT_KYWD, const wchar_t *_RESTRICT_KYWD,
 168         size_t);
 169 
 170 #if __cplusplus >= 199711L
 171 extern "C++" {
 172         inline long   abs(long _l) { return labs(_l); }
 173         inline ldiv_t div(long _l1, long _l2) { return ldiv(_l1, _l2); }
 174 }
 175 #endif /* __cplusplus */
 176 
 177 #else /* not __STDC__ */
 178 
 179 extern void abort();
 180 extern int abs();
 181 extern int atexit();
 182 extern double atof();
 183 extern int atoi();
 184 extern long int atol();
 185 extern void *bsearch();
 186 extern void *calloc();
 187 extern div_t div();
 188 extern void exit();
 189 extern void free();
 190 extern char *getenv();
 191 extern long int labs();
 192 extern ldiv_t ldiv();
 193 extern void *malloc();
 194 extern int mblen();
 195 extern size_t mbstowcs();
 196 extern int mbtowc();
 197 extern void qsort();
 198 extern int rand();
 199 extern void *realloc();
 200 extern void srand();
 201 extern double strtod();
 202 extern long int strtol();
 203 extern unsigned long strtoul();
 204 extern int system();
 205 extern int wctomb();
 206 extern size_t wcstombs();
 207 
 208 #endif  /* __STDC__ */
 209 
 210 #if __cplusplus >= 199711L
 211 }
 212 #endif /* end of namespace std */
 213 
 214 #ifdef  __cplusplus
 215 }
 216 #endif
 217 
 218 #endif  /* _ISO_STDLIB_ISO_H */


   3  *
   4  * The contents of this file are subject to the terms of the
   5  * Common Development and Distribution License, Version 1.0 only
   6  * (the "License").  You may not use this file except in compliance
   7  * with the License.
   8  *
   9  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
  10  * or http://www.opensolaris.org/os/licensing.
  11  * See the License for the specific language governing permissions
  12  * and limitations under the License.
  13  *
  14  * When distributing Covered Code, include this CDDL HEADER in each
  15  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  16  * If applicable, add the following below this CDDL HEADER, with the
  17  * fields enclosed by brackets "[]" replaced with your own identifying
  18  * information: Portions Copyright [yyyy] [name of copyright owner]
  19  *
  20  * CDDL HEADER END
  21  */
  22 /*
  23  * Copyright 2014 Garrett D'Amore <garrett@damore.org>
  24  *
  25  * Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
  26  * Use is subject to license terms.
  27  */



  28 
  29 /*      Copyright (c) 1988 AT&T     */
  30 /*        All Rights Reserved   */
  31 
  32 
  33 /*
  34  * An application should not include this header directly.  Instead it
  35  * should be included only through the inclusion of other Sun headers.
  36  *
  37  * The contents of this header is limited to identifiers specified in the
  38  * C Standard.  Any new identifiers specified in future amendments to the
  39  * C Standard must be placed in this header.  If these new identifiers
  40  * are required to also be in the C++ Standard "std" namespace, then for
  41  * anything other than macro definitions, corresponding "using" directives
  42  * must also be added to <locale.h>.
  43  */
  44 
  45 #ifndef _ISO_STDLIB_ISO_H
  46 #define _ISO_STDLIB_ISO_H
  47 
  48 #include <sys/feature_tests.h>
  49 
  50 #ifdef  __cplusplus
  51 extern "C" {
  52 #endif
  53 

  54 unsigned char __mb_cur_max(void);



  55 #ifndef MB_CUR_MAX
  56 #define MB_CUR_MAX      (__mb_cur_max())
  57 #endif
  58 
  59 #if __cplusplus >= 199711L
  60 namespace std {
  61 #endif
  62 
  63 typedef struct {
  64         int     quot;
  65         int     rem;
  66 } div_t;
  67 
  68 typedef struct {
  69         long    quot;
  70         long    rem;
  71 } ldiv_t;
  72 
  73 #if !defined(_SIZE_T) || __cplusplus >= 199711L
  74 #define _SIZE_T


  98  * header for use by gcc and g++. In that version it adds a redundant
  99  * guard for __cplusplus. To avoid the creation of a gcc/g++ specific
 100  * header we need to include the following magic comment:
 101  *
 102  * we must use the C++ compiler's type
 103  *
 104  * The above comment should not be removed or changed until GNU
 105  * gcc/fixinc/inclhack.def is updated to bypass this header.
 106  */
 107 #if !defined(__cplusplus) || (__cplusplus < 199711L && !defined(__GNUG__))
 108 #ifndef _WCHAR_T
 109 #define _WCHAR_T
 110 #if defined(_LP64)
 111 typedef int     wchar_t;
 112 #else
 113 typedef long    wchar_t;
 114 #endif
 115 #endif  /* !_WCHAR_T */
 116 #endif  /* !defined(__cplusplus) ... */
 117 


 118 extern void abort(void) __NORETURN;
 119 extern int abs(int);
 120 extern int atexit(void (*)(void));
 121 extern double atof(const char *);
 122 extern int atoi(const char *);
 123 extern long int atol(const char *);
 124 extern void *bsearch(const void *, const void *, size_t, size_t,
 125         int (*)(const void *, const void *));
 126 #if __cplusplus >= 199711L && defined(__SUNPRO_CC)
 127 extern "C++" {
 128         void *bsearch(const void *, const void *, size_t, size_t,
 129                 int (*)(const void *, const void *));
 130 }
 131 #endif /* __cplusplus >= 199711L && defined(__SUNPRO_CC) */
 132 extern void *calloc(size_t, size_t);
 133 extern div_t div(int, int);
 134 extern void exit(int)
 135         __NORETURN;
 136 extern void free(void *);
 137 extern char *getenv(const char *);


 150 #endif /* __cplusplus >= 199711L && defined(__SUNPRO_CC) */
 151 extern int rand(void);
 152 extern void *realloc(void *, size_t);
 153 extern void srand(unsigned int);
 154 extern double strtod(const char *_RESTRICT_KYWD, char **_RESTRICT_KYWD);
 155 extern long int strtol(const char *_RESTRICT_KYWD, char **_RESTRICT_KYWD, int);
 156 extern unsigned long int strtoul(const char *_RESTRICT_KYWD,
 157         char **_RESTRICT_KYWD, int);
 158 extern int system(const char *);
 159 extern int wctomb(char *, wchar_t);
 160 extern size_t wcstombs(char *_RESTRICT_KYWD, const wchar_t *_RESTRICT_KYWD,
 161         size_t);
 162 
 163 #if __cplusplus >= 199711L
 164 extern "C++" {
 165         inline long   abs(long _l) { return labs(_l); }
 166         inline ldiv_t div(long _l1, long _l2) { return ldiv(_l1, _l2); }
 167 }
 168 #endif /* __cplusplus */
 169 

































 170 #if __cplusplus >= 199711L
 171 }
 172 #endif /* end of namespace std */
 173 
 174 #ifdef  __cplusplus
 175 }
 176 #endif
 177 
 178 #endif  /* _ISO_STDLIB_ISO_H */