comm: add -Wall
[unleashed.git] / include / inttypes.h
blob9c6f57915de85fc067c49eed0ad4a4d0bed52768
1 /*
2 * CDDL HEADER START
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.
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.
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]
20 * CDDL HEADER END
23 * Copyright 2014 Garrett D'Amore <garrett@damore.org>
25 * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
26 * Use is subject to license terms.
29 #ifndef _INTTYPES_H
30 #define _INTTYPES_H
33 * This file, <inttypes.h>, is specified by the ISO C standard,
34 * standard, ISO/IEC 9899:1999 Programming language - C and is
35 * also defined by SUSv3.
37 * ISO International Organization for Standardization.
38 * SUSv3 Single Unix Specification, Version 3
41 #include <sys/feature_tests.h>
42 #include <sys/inttypes.h>
44 #if (!defined(_XOPEN_SOURCE) || defined(_XPG6)) || defined(_STDC_C99) || \
45 defined(__EXTENSIONS__)
46 #include <sys/stdint.h>
47 #endif
49 #ifdef __cplusplus
50 extern "C" {
51 #endif
53 /* Inclusion of <stddef.h> breaks namespace, therefore define wchar_t */
56 * wchar_t is a built-in type in standard C++ and as such is not
57 * defined here when using standard C++. However, the GNU compiler
58 * fixincludes utility nonetheless creates its own version of this
59 * header for use by gcc and g++. In that version it adds a redundant
60 * guard for __cplusplus. To avoid the creation of a gcc/g++ specific
61 * header we need to include the following magic comment:
63 * we must use the C++ compiler's type
65 * The above comment should not be removed or changed until GNU
66 * gcc/fixinc/inclhack.def is updated to bypass this header.
68 #if !defined(__cplusplus) || (__cplusplus < 199711L && !defined(__GNUG__))
69 #ifndef _WCHAR_T
70 #define _WCHAR_T
71 #if defined(_LP64)
72 typedef int wchar_t;
73 #else
74 typedef long wchar_t;
75 #endif
76 #endif /* !_WCHAR_T */
77 #endif /* !__cplusplus || (__cplusplus < 199711L && !__GNUG__) */
79 #if (!defined(_XOPEN_SOURCE) || defined(_XPG6)) || defined(_STDC_C99) || \
80 defined(__EXTENSIONS__)
81 typedef struct {
82 intmax_t quot;
83 intmax_t rem;
84 } imaxdiv_t;
85 #endif /* (!defined(_XOPEN_SOURCE) || defined(_XPG6)) ... */
87 #if (!defined(_XOPEN_SOURCE) || defined(_XPG6)) || defined(_STDC_C99) || \
88 defined(__EXTENSIONS__)
90 extern intmax_t imaxabs(intmax_t);
91 extern imaxdiv_t imaxdiv(intmax_t, intmax_t);
92 extern intmax_t strtoimax(const char *_RESTRICT_KYWD, char **_RESTRICT_KYWD,
93 int);
94 extern uintmax_t strtoumax(const char *_RESTRICT_KYWD, char **_RESTRICT_KYWD,
95 int);
96 extern intmax_t wcstoimax(const wchar_t *_RESTRICT_KYWD,
97 wchar_t **_RESTRICT_KYWD, int);
98 extern uintmax_t wcstoumax(const wchar_t *_RESTRICT_KYWD,
99 wchar_t **_RESTRICT_KYWD, int);
101 #endif /* (!defined(_XOPEN_SOURCE) || defined(_XPG6)) ... */
103 #ifdef __cplusplus
105 #endif
107 #endif /* _INTTYPES_H */