xref: /illumos-gate/usr/src/test/header-tests/cfg/cxx-symbols/cstdlib_h.cfg (revision 1072464281f5b1736a36f54036d362c13ca7a4e0)
1#
2# This file and its contents are supplied under the terms of the
3# Common Development and Distribution License ("CDDL"), version 1.0.
4# You may only use this file in accordance with the terms of version
5# 1.0 of the CDDL.
6#
7# A full copy of the text of the CDDL should have accompanied this
8# source.  A copy of the CDDL is also available via the Internet at
9# http://www.illumos.org/license/CDDL.
10#
11
12#
13# Copyright 2026 Gordon W. Ross
14#
15
16#
17# Design notes for <cstdlib> test cases
18#
19# <cstdlib> must provide all C90 stdlib functions in namespace std::.
20# C99 stdlib functions require the C99 compilation environment.
21# C11 stdlib functions require the C11 compilation environment.
22#
23
24#
25# Types - must be in std::
26#
27type | std::div_t	| cstdlib | CXX98+
28type | std::ldiv_t	| cstdlib | CXX98+
29type | std::size_t	| cstdlib | CXX98+
30type | std::lldiv_t	| cstdlib | CXX11+
31
32#
33# C90 functions - must be in std::
34#
35func | std::abort			|\
36	void				|\
37					|\
38	cstdlib | CXX98+
39func | std::abs				|\
40	int				|\
41	int				|\
42	cstdlib | CXX98+
43func | std::atexit			|\
44	int				|\
45	void (*)()			|\
46	cstdlib | CXX98+
47func | std::atof			|\
48	double				|\
49	const char *			|\
50	cstdlib | CXX98+
51func | std::atoi			|\
52	int				|\
53	const char *			|\
54	cstdlib | CXX98+
55func | std::atol			|\
56	long				|\
57	const char *			|\
58	cstdlib | CXX98+
59func | std::calloc			|\
60	void *				|\
61	size_t; size_t			|\
62	cstdlib | CXX98+
63func | std::div				|\
64	div_t				|\
65	int; int			|\
66	cstdlib | CXX98+
67func | std::free			|\
68	void				|\
69	void *				|\
70	cstdlib | CXX98+
71func | std::getenv			|\
72	char *				|\
73	const char *			|\
74	cstdlib | CXX98+
75func | std::labs			|\
76	long				|\
77	long				|\
78	cstdlib | CXX98+
79func | std::ldiv			|\
80	ldiv_t				|\
81	long; long			|\
82	cstdlib | CXX98+
83func | std::malloc			|\
84	void *				|\
85	size_t				|\
86	cstdlib | CXX98+
87func | std::rand			|\
88	int				|\
89					|\
90	cstdlib | CXX98+
91func | std::realloc			|\
92	void *				|\
93	void *; size_t			|\
94	cstdlib | CXX98+
95func | std::srand			|\
96	void				|\
97	unsigned int			|\
98	cstdlib | CXX98+
99func | std::strtod			|\
100	double				|\
101	const char *; char **		|\
102	cstdlib | CXX98+
103func | std::strtol			|\
104	long				|\
105	const char *; char **; int	|\
106	cstdlib | CXX98+
107func | std::strtoul			|\
108	unsigned long			|\
109	const char *; char **; int	|\
110	cstdlib | CXX98+
111func | std::bsearch			|\
112	void *				|\
113	const void *; const void *; size_t; size_t; int (*)(const void *, const void *)	|\
114	cstdlib | CXX98+
115func | std::exit			|\
116	void				|\
117	int				|\
118	cstdlib | CXX98+
119func | std::qsort			|\
120	void				|\
121	void *; size_t; size_t; int (*)(const void *, const void *)	|\
122	cstdlib | CXX98+
123func | std::system			|\
124	int				|\
125	const char *			|\
126	cstdlib | CXX98+
127
128#
129# C90 multibyte/wide conversion functions - must be in std:: since C++98
130#
131func | std::mblen			|\
132	int				|\
133	const char *; size_t		|\
134	cstdlib | CXX98+
135func | std::mbtowc			|\
136	int				|\
137	wchar_t *; const char *; size_t	|\
138	cstdlib | CXX98+
139func | std::wctomb			|\
140	int				|\
141	char *; wchar_t			|\
142	cstdlib | CXX98+
143func | std::mbstowcs			|\
144	size_t				|\
145	wchar_t *; const char *; size_t	|\
146	cstdlib | CXX98+
147func | std::wcstombs			|\
148	size_t				|\
149	char *; const wchar_t *; size_t	|\
150	cstdlib | CXX98+
151
152#
153# C++ overloads for abs and div with long - must be in std::
154#
155func | std::abs			|\
156	long			|\
157	long			|\
158	cstdlib | CXX98+
159func | std::div			|\
160	ldiv_t			|\
161	long; long		|\
162	cstdlib | CXX98+
163
164#
165# Regression tests for 15209 - see cmath_h.cfg for details.
166# abs(double) must not be ambiguous.
167#
168func | abs			|\
169	int			|\
170	int			|\
171	cstdlib | CXX98+
172func | abs			|\
173	long			|\
174	long			|\
175	cstdlib | CXX98+
176func | abs			|\
177	double			|\
178	double			|\
179	cstdlib | CXX98+
180
181#
182# C99 functions - required in std:: since C++11.
183# (illumos also exposes these in C++98 via CXX_C99+)
184#
185func | std::llabs			|\
186	long long			|\
187	long long			|\
188	cstdlib | CXX11+
189func | std::strtof			|\
190	float				|\
191	const char *; char **		|\
192	cstdlib | CXX11+
193func | std::strtold			|\
194	long double			|\
195	const char *; char **		|\
196	cstdlib | CXX11+
197func | std::strtoll			|\
198	long long			|\
199	const char *; char **; int	|\
200	cstdlib | CXX11+
201func | std::strtoull			|\
202	unsigned long long		|\
203	const char *; char **; int	|\
204	cstdlib | CXX11+
205func | std::atoll			|\
206	long long			|\
207	const char *			|\
208	cstdlib | CXX11+
209func | std::lldiv			|\
210	lldiv_t				|\
211	long long; long long		|\
212	cstdlib | CXX11+
213
214#
215# C11 functions - required in std:: since C++11; illumos exposes earlier.
216# (stdlib_c11.h wraps in namespace std::)
217#
218func | std::at_quick_exit	|\
219	int			|\
220	void (*)(void)		|\
221	cstdlib | CXX11+
222func | std::quick_exit		|\
223	void			|\
224	int			|\
225	cstdlib | CXX11+
226func | std::aligned_alloc	|\
227	void *			|\
228	size_t; size_t		|\
229	cstdlib | CXX17+
230