xref: /titanic_51/usr/src/head/iso/stdlib_c99.h (revision a3623a387b6b052fb916c3fa0bfc1b672a3cbc88)
1 /*
2  * CDDL HEADER START
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 2004 Sun Microsystems, Inc.  All rights reserved.
26  * Use is subject to license terms.
27  */
28 
29 /*
30  * An application should not include this header directly.  Instead it
31  * should be included only through the inclusion of other Sun headers.
32  *
33  * The contents of this header is limited to identifiers specified in
34  * the C99 standard and in conflict with the C++ implementation of the
35  * standard header.  The C++ standard may adopt the C99 standard at
36  * which point it is expected that the symbols included here will
37  * become part of the C++ std namespace.
38  */
39 
40 #ifndef _ISO_STDLIB_C99_H
41 #define	_ISO_STDLIB_C99_H
42 
43 #include <sys/feature_tests.h>
44 
45 #ifdef	__cplusplus
46 extern "C" {
47 #endif
48 
49 /*
50  * The following have been added as a result of the ISO/IEC 9899:1999
51  * standard. For a strictly conforming C application, visibility is
52  * contingent on the value of __STDC_VERSION__ (see sys/feature_tests.h).
53  * For non-strictly conforming C applications, there are no restrictions
54  * on the C namespace.
55  */
56 
57 #if defined(_LONGLONG_TYPE)
58 typedef struct {
59 	long long	quot;
60 	long long	rem;
61 } lldiv_t;
62 #endif  /* defined(_LONGLONG_TYPE) */
63 
64 #if (!defined(_STRICT_STDC) && !defined(__XOPEN_OR_POSIX)) || \
65 	defined(_STDC_C99) || defined(__EXTENSIONS__)
66 
67 #if !defined(_NORETURN_KYWD)
68 #if __STDC_VERSION__ - 0 >= 201112L
69 #define	_NORETURN_KYWD	_Noreturn
70 #else
71 #define	_NORETURN_KYWD
72 #endif	/* __STDC_VERSION__ - 0 >= 201112L */
73 #endif	/* !defined(_NORETURN_KYWD) */
74 
75 extern _NORETURN_KYWD void _Exit(int);
76 extern float strtof(const char *_RESTRICT_KYWD, char **_RESTRICT_KYWD);
77 extern long double strtold(const char *_RESTRICT_KYWD, char **_RESTRICT_KYWD);
78 
79 #if defined(_LONGLONG_TYPE)
80 extern long long atoll(const char *);
81 extern long long llabs(long long);
82 extern lldiv_t lldiv(long long, long long);
83 extern long long strtoll(const char *_RESTRICT_KYWD, char **_RESTRICT_KYWD,
84 	int);
85 extern unsigned long long strtoull(const char *_RESTRICT_KYWD,
86 	char **_RESTRICT_KYWD, int);
87 #endif /* defined(_LONGLONG_TYPE) */
88 
89 #endif  /* (!defined(_STRICT_STDC) && !defined(__XOPEN_OR_POSIX)) ... */
90 
91 #ifdef	__cplusplus
92 }
93 #endif
94 
95 #endif	/* _ISO_STDLIB_C99_H */
96