[Workflow] Roll back some settings since they caused more issues
[llvm-project.git] / libc / spec / gnu_ext.td
blob362add7283d6e114c0254990db2be0aae430384b
1 def CpuSetT : NamedType<"cpu_set_t">;
2 def CpuSetPtr : PtrType<CpuSetT>;
3 def ConstCpuSetPtr : ConstType<CpuSetPtr>;
5 def QSortRCompareT : NamedType<"__qsortrcompare_t">;
7 def GnuExtensions : StandardSpec<"GNUExtensions"> {
8   NamedType CookieIOFunctionsT = NamedType<"cookie_io_functions_t">;
9   HeaderSpec CType = HeaderSpec<
10     "ctype.h",
11     [], // Macros
12     [], // Types
13     [], // Enumerations
14     [
15         FunctionSpec<
16             "toascii",
17             RetValSpec<IntType>,
18             [ArgSpec<IntType>]
19         >,
20     ]
21   >;
23   HeaderSpec Math = HeaderSpec<
24       "math.h",
25       [], // Macros
26       [], // Types
27       [], // Enumerations
28       [
29         FunctionSpec<
30             "sincosf",
31             RetValSpec<VoidType>,
32             [ArgSpec<FloatType>, ArgSpec<FloatPtr>, ArgSpec<FloatPtr>]
33         >,
34         FunctionSpec<"exp10", RetValSpec<DoubleType>, [ArgSpec<DoubleType>]>,
35         FunctionSpec<"exp10f", RetValSpec<FloatType>, [ArgSpec<FloatType>]>,
36       ]
37   >;
39   HeaderSpec Sched = HeaderSpec<
40       "sched.h",
41       [], // Macros
42       [PidT, SizeTType, CpuSetT], // Types
43       [], // Enumerations
44       [
45         FunctionSpec<
46             "sched_getaffinity",
47             RetValSpec<IntType>,
48             [ArgSpec<PidT>, ArgSpec<SizeTType>, ArgSpec<CpuSetPtr>]
49         >,
50         FunctionSpec<
51             "sched_setaffinity",
52             RetValSpec<IntType>,
53             [ArgSpec<PidT>, ArgSpec<SizeTType>, ArgSpec<ConstCpuSetPtr>]
54         >,
55       ]
56   >;
58   HeaderSpec String = HeaderSpec<
59       "string.h",
60       [], // Macros
61       [], // Types
62       [], // Enumerations
63       [
64          FunctionSpec<
65             "memmem",
66             RetValSpec<VoidPtr>,
67             [ArgSpec<ConstVoidPtr>, ArgSpec<SizeTType>, ArgSpec<ConstVoidPtr>, ArgSpec<SizeTType>]
68         >,
69         FunctionSpec<
70             "memrchr",
71             RetValSpec<VoidPtr>,
72             [ArgSpec<VoidPtr>, ArgSpec<IntType>, ArgSpec<SizeTType>]
73         >,
74         FunctionSpec<
75             "strerror_r",
76             RetValSpec<CharPtr>,
77             [ArgSpec<IntType>, ArgSpec<CharPtr>, ArgSpec<SizeTType>]
78         >,
79         FunctionSpec<
80             "strcasestr",
81             RetValSpec<CharPtr>,
82             [ArgSpec<ConstCharPtr>, ArgSpec<ConstCharPtr>]
83         >,
84         FunctionSpec<
85             "strchrnul",
86             RetValSpec<CharPtr>,
87             [ArgSpec<ConstCharPtr>, ArgSpec<IntType>]
88         >,
89       ]
90   >;
92   HeaderSpec FEnv = HeaderSpec<
93       "fenv.h",
94       [], // Macros
95       [], // Types
96       [], // Enumerations
97       [
98         FunctionSpec<
99             "fedisableexcept",
100             RetValSpec<IntType>,
101             [ArgSpec<IntType>]
102         >,
103         FunctionSpec<
104             "feenableexcept",
105             RetValSpec<IntType>,
106             [ArgSpec<IntType>]
107         >,
108         FunctionSpec<
109             "fegetexcept",
110             RetValSpec<IntType>,
111             []
112         >
113       ]
114   >;
116   HeaderSpec StdIO = HeaderSpec<
117       "stdio.h",
118       [], // Macros
119       [CookieIOFunctionsT], // Types
120       [], // Enumerations
121       [
122           FunctionSpec<
123               "clearerr_unlocked",
124               RetValSpec<VoidType>,
125               [ArgSpec<FILEPtr>]
126           >,
127           FunctionSpec<
128               "feof_unlocked",
129               RetValSpec<IntType>,
130               [ArgSpec<FILEPtr>]
131           >,
132           FunctionSpec<
133               "ferror_unlocked",
134               RetValSpec<IntType>,
135               [ArgSpec<FILEPtr>]
136           >,
137           FunctionSpec<
138               "fopencookie",
139               RetValSpec<FILEPtr>,
140               [ArgSpec<VoidPtr>, ArgSpec<ConstCharPtr>, ArgSpec<CookieIOFunctionsT>]
141           >,
142           FunctionSpec<
143               "fread_unlocked",
144               RetValSpec<SizeTType>,
145               [ArgSpec<VoidRestrictedPtr>,
146                ArgSpec<SizeTType>,
147                ArgSpec<SizeTType>,
148                ArgSpec<FILERestrictedPtr>]
149           >,
150           FunctionSpec<
151               "fwrite_unlocked",
152               RetValSpec<SizeTType>,
153               [ArgSpec<ConstVoidRestrictedPtr>,
154                ArgSpec<SizeTType>,
155                ArgSpec<SizeTType>,
156                ArgSpec<FILERestrictedPtr>]
157           >,
158           FunctionSpec<
159               "fgetc_unlocked",
160               RetValSpec<IntType>,
161               [ArgSpec<FILEPtr>]
162           >,
163       ]
164   >;
166   HeaderSpec StdLib = HeaderSpec<
167       "stdlib.h",
168       [], // Macros
169       [QSortRCompareT], // Types
170       [], // Enumerations
171       [
172           FunctionSpec<
173                 "qsort_r", 
174                 RetValSpec<VoidType>, 
175                 [ArgSpec<VoidPtr>, ArgSpec<SizeTType>, ArgSpec<SizeTType>, ArgSpec<QSortRCompareT>, ArgSpec<VoidPtr>]
176           >,
177       ]
178   >;
180   HeaderSpec PThread = HeaderSpec<
181       "pthread.h",
182       [], // Macros
183       [], // Types
184       [], // Enumerations
185       [
186           FunctionSpec<
187               "pthread_setname_np",
188               RetValSpec<IntType>,
189               [ArgSpec<PThreadTType>, ArgSpec<ConstCharPtr>]
190           >,
191           FunctionSpec<
192               "pthread_getname_np",
193               RetValSpec<IntType>,
194               [ArgSpec<PThreadTType>, ArgSpec<CharPtr>, ArgSpec<SizeTType>]
195           >,
196       ]
197   >;
199   HeaderSpec SysAuxv = HeaderSpec<
200       "sys/auxv.h",
201       [], // Macros
202       [], // Types
203       [], // Enumerations
204       []  // Functions
205   >;
207   HeaderSpec SendFile = HeaderSpec<
208       "sys/sendfile.h",
209       [], // Macros
210       [OffTType, SizeTType, SSizeTType,], // Types
211       [], // Enumerations
212       [
213           FunctionSpec<
214               "sendfile",
215               RetValSpec<SSizeTType>,
216               [ArgSpec<IntType>, ArgSpec<IntType>, ArgSpec<OffTPtr>, ArgSpec<SizeTType>]
217           >,
218       ]
219   >;
221   HeaderSpec UniStd = HeaderSpec<
222     "unistd.h",
223     [], // Macros
224     [], // Types
225     [], // Enumerations
226     [
227         FunctionSpec<
228             "dup2",
229             RetValSpec<IntType>,
230             [ArgSpec<IntType>, ArgSpec<IntType>, ArgSpec<IntType>]
231         >,
232     ]
233   >;
235   let Headers = [
236     CType,
237     FEnv,
238     Math,
239     PThread,
240     Sched,
241     SendFile,
242     SysAuxv,
243     StdIO,
244     StdLib,
245     String,
246     UniStd,
247   ];