summaryrefslogtreecommitdiff
path: root/usr/src/head/iso/stdlib_c11.h
blob: 69334f5985dcf3cb77b94f2d22abda830f31dc45 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
/*
 * This file and its contents are supplied under the terms of the
 * Common Development and Distribution License ("CDDL"), version 1.0.
 * You may only use this file in accordance with the terms of version
 * 1.0 of the CDDL.
 *
 * A full copy of the text of the CDDL should have accompanied this
 * source.  A copy of the CDDL is also available via the Internet at
 * http://www.illumos.org/license/CDDL.
 */

/*
 * Copyright 2016 Joyent, Inc.
 */

/*
 * An application should not include this header directly.  Instead it
 * should be included only through the inclusion of other illumos headers.
 *
 * The contents of this header is limited to identifiers specified in
 * the C11 standard and in conflict with the C++ implementation of the
 * standard header.  The C++ standard may adopt the C11 standard at
 * which point it is expected that the symbols included here will
 * become part of the C++ std namespace.
 */

#ifndef _ISO_STDLIB_C11_H
#define	_ISO_STDLIB_C11_H

#include <sys/feature_tests.h>

#ifdef __cplusplus
extern "C" {
#endif

#if __cplusplus >= 199711L
namespace std {
#endif

/*
 * The following have been added as a result of the ISO/IEC 9899:2011
 * standard. For a strictly conforming C application, visibility is
 * contingent on the value of __STDC_VERSION__ (see sys/feature_tests.h).
 * For non-strictly conforming C applications, there are no restrictions
 * on the C namespace.
 */

/*
 * Work around fix-includes and other bad actors with using multiple headers.
 */
#if !defined(_NORETURN_KYWD)
#if __STDC_VERSION__ - 0 >= 201112L
#define	_NORETURN_KYWD	_Noreturn
#else
#define	_NORETURN_KYWD
#endif	/* __STDC_VERSION__ - 0 >= 201112L */
#endif	/* !defined(_NORETURN_KYWD) */

#if !defined(_STRICT_SYMBOLS) || defined(_STDC_C11)
extern void *aligned_alloc(size_t, size_t);
extern int at_quick_exit(void (*)(void));
extern _NORETURN_KYWD void quick_exit(int);
#endif /* !_STRICT_SYMBOLS || _STDC_C11 */

#if __cplusplus >= 199711L
}
#endif

#ifdef __cplusplus
}
#endif

#endif /* _ISO_STDLIB_C11_H */