1
- add_entrypoint_object (
1
+ # Helper to only add the generic implementations if they aren't handled by a
2
+ # more specific implementation.
3
+ # TODO: This should probably be cleaned up and formalized.
4
+ function (add_generic_entrypoint_object name )
5
+ if (NOT TARGET libc.src.stdio.${LIBC_TARGET_OS}.${name} )
6
+ add_entrypoint_object (
7
+ ${name}
8
+ ${ARGN}
9
+ )
10
+ endif ()
11
+ endfunction (add_generic_entrypoint_object )
12
+
13
+ add_generic_entrypoint_object (
2
14
clearerr
3
15
SRCS
4
16
clearerr.cpp
@@ -10,7 +22,7 @@ add_entrypoint_object(
10
22
libc.src.__support.File.platform_file
11
23
)
12
24
13
- add_entrypoint_object (
25
+ add_generic_entrypoint_object (
14
26
clearerr_unlocked
15
27
SRCS
16
28
clearerr_unlocked.cpp
@@ -22,7 +34,7 @@ add_entrypoint_object(
22
34
libc.src.__support.File.platform_file
23
35
)
24
36
25
- add_entrypoint_object (
37
+ add_generic_entrypoint_object (
26
38
feof
27
39
SRCS
28
40
feof.cpp
@@ -34,7 +46,7 @@ add_entrypoint_object(
34
46
libc.src.__support.File.platform_file
35
47
)
36
48
37
- add_entrypoint_object (
49
+ add_generic_entrypoint_object (
38
50
feof_unlocked
39
51
SRCS
40
52
feof_unlocked.cpp
@@ -46,7 +58,7 @@ add_entrypoint_object(
46
58
libc.src.__support.File.platform_file
47
59
)
48
60
49
- add_entrypoint_object (
61
+ add_generic_entrypoint_object (
50
62
ferror
51
63
SRCS
52
64
ferror.cpp
@@ -58,7 +70,7 @@ add_entrypoint_object(
58
70
libc.src.__support.File.platform_file
59
71
)
60
72
61
- add_entrypoint_object (
73
+ add_generic_entrypoint_object (
62
74
ferror_unlocked
63
75
SRCS
64
76
ferror_unlocked.cpp
@@ -70,7 +82,7 @@ add_entrypoint_object(
70
82
libc.src.__support.File.platform_file
71
83
)
72
84
73
- add_entrypoint_object (
85
+ add_generic_entrypoint_object (
74
86
fileno
75
87
SRCS
76
88
fileno.cpp
@@ -82,7 +94,7 @@ add_entrypoint_object(
82
94
libc.src.__support.File.platform_file
83
95
)
84
96
85
- add_entrypoint_object (
97
+ add_generic_entrypoint_object (
86
98
fflush
87
99
SRCS
88
100
fflush.cpp
@@ -95,7 +107,7 @@ add_entrypoint_object(
95
107
libc.src.__support.File.platform_file
96
108
)
97
109
98
- add_entrypoint_object (
110
+ add_generic_entrypoint_object (
99
111
fseek
100
112
SRCS
101
113
fseek.cpp
@@ -107,7 +119,7 @@ add_entrypoint_object(
107
119
libc.src.__support.File.platform_file
108
120
)
109
121
110
- add_entrypoint_object (
122
+ add_generic_entrypoint_object (
111
123
ftell
112
124
SRCS
113
125
ftell.cpp
@@ -119,7 +131,7 @@ add_entrypoint_object(
119
131
libc.src.__support.File.platform_file
120
132
)
121
133
122
- add_entrypoint_object (
134
+ add_generic_entrypoint_object (
123
135
fseeko
124
136
SRCS
125
137
fseeko.cpp
@@ -131,7 +143,7 @@ add_entrypoint_object(
131
143
libc.src.__support.File.platform_file
132
144
)
133
145
134
- add_entrypoint_object (
146
+ add_generic_entrypoint_object (
135
147
ftello
136
148
SRCS
137
149
ftello.cpp
@@ -143,7 +155,7 @@ add_entrypoint_object(
143
155
libc.src.__support.File.platform_file
144
156
)
145
157
146
- add_entrypoint_object (
158
+ add_generic_entrypoint_object (
147
159
fopen
148
160
SRCS
149
161
fopen.cpp
@@ -155,7 +167,7 @@ add_entrypoint_object(
155
167
libc.src.__support.File.platform_file
156
168
)
157
169
158
- add_entrypoint_object (
170
+ add_generic_entrypoint_object (
159
171
fclose
160
172
SRCS
161
173
fclose.cpp
@@ -168,7 +180,7 @@ add_entrypoint_object(
168
180
libc.src.__support.File.platform_file
169
181
)
170
182
171
- add_entrypoint_object (
183
+ add_generic_entrypoint_object (
172
184
fread_unlocked
173
185
SRCS
174
186
fread_unlocked.cpp
@@ -181,7 +193,7 @@ add_entrypoint_object(
181
193
libc.src.__support.File.platform_file
182
194
)
183
195
184
- add_entrypoint_object (
196
+ add_generic_entrypoint_object (
185
197
fread
186
198
SRCS
187
199
fread.cpp
@@ -194,7 +206,7 @@ add_entrypoint_object(
194
206
libc.src.__support.File.platform_file
195
207
)
196
208
197
- add_entrypoint_object (
209
+ add_generic_entrypoint_object (
198
210
fputs
199
211
SRCS
200
212
fputs.cpp
@@ -207,7 +219,7 @@ add_entrypoint_object(
207
219
libc.src.__support.File.platform_file
208
220
)
209
221
210
- add_entrypoint_object (
222
+ add_generic_entrypoint_object (
211
223
puts
212
224
SRCS
213
225
puts.cpp
@@ -220,7 +232,7 @@ add_entrypoint_object(
220
232
libc.src.__support.File.platform_stdout
221
233
)
222
234
223
- add_entrypoint_object (
235
+ add_generic_entrypoint_object (
224
236
fwrite_unlocked
225
237
SRCS
226
238
fwrite_unlocked.cpp
@@ -233,7 +245,7 @@ add_entrypoint_object(
233
245
libc.src.__support.File.platform_file
234
246
)
235
247
236
- add_entrypoint_object (
248
+ add_generic_entrypoint_object (
237
249
fwrite
238
250
SRCS
239
251
fwrite.cpp
@@ -246,7 +258,7 @@ add_entrypoint_object(
246
258
libc.src.__support.File.platform_file
247
259
)
248
260
249
- add_entrypoint_object (
261
+ add_generic_entrypoint_object (
250
262
fputc
251
263
SRCS
252
264
fputc.cpp
@@ -259,7 +271,7 @@ add_entrypoint_object(
259
271
libc.src.__support.File.platform_file
260
272
)
261
273
262
- add_entrypoint_object (
274
+ add_generic_entrypoint_object (
263
275
putc
264
276
SRCS
265
277
putc.cpp
@@ -272,7 +284,7 @@ add_entrypoint_object(
272
284
libc.src.__support.File.platform_file
273
285
)
274
286
275
- add_entrypoint_object (
287
+ add_generic_entrypoint_object (
276
288
putchar
277
289
SRCS
278
290
putchar.cpp
@@ -285,7 +297,7 @@ add_entrypoint_object(
285
297
libc.src.__support.File.platform_file
286
298
)
287
299
288
- add_entrypoint_object (
300
+ add_generic_entrypoint_object (
289
301
fgetc
290
302
SRCS
291
303
fgetc.cpp
@@ -298,7 +310,7 @@ add_entrypoint_object(
298
310
libc.src.__support.File.platform_file
299
311
)
300
312
301
- add_entrypoint_object (
313
+ add_generic_entrypoint_object (
302
314
fgetc_unlocked
303
315
SRCS
304
316
fgetc_unlocked.cpp
@@ -311,7 +323,7 @@ add_entrypoint_object(
311
323
libc.src.__support.File.platform_file
312
324
)
313
325
314
- add_entrypoint_object (
326
+ add_generic_entrypoint_object (
315
327
getc
316
328
SRCS
317
329
getc.cpp
@@ -324,7 +336,7 @@ add_entrypoint_object(
324
336
libc.src.__support.File.platform_file
325
337
)
326
338
327
- add_entrypoint_object (
339
+ add_generic_entrypoint_object (
328
340
getc_unlocked
329
341
SRCS
330
342
getc_unlocked.cpp
@@ -337,7 +349,7 @@ add_entrypoint_object(
337
349
libc.src.__support.File.platform_file
338
350
)
339
351
340
- add_entrypoint_object (
352
+ add_generic_entrypoint_object (
341
353
getchar
342
354
SRCS
343
355
getchar.cpp
@@ -350,7 +362,7 @@ add_entrypoint_object(
350
362
libc.src.__support.File.platform_file
351
363
)
352
364
353
- add_entrypoint_object (
365
+ add_generic_entrypoint_object (
354
366
getchar_unlocked
355
367
SRCS
356
368
getchar_unlocked.cpp
@@ -385,7 +397,7 @@ if(LLVM_LIBC_FULL_BUILD)
385
397
)
386
398
endif ()
387
399
388
- add_entrypoint_object (
400
+ add_generic_entrypoint_object (
389
401
printf
390
402
SRCS
391
403
printf.cpp
@@ -395,7 +407,7 @@ add_entrypoint_object(
395
407
${printf_deps}
396
408
)
397
409
398
- add_entrypoint_object (
410
+ add_generic_entrypoint_object (
399
411
vprintf
400
412
SRCS
401
413
vprintf.cpp
@@ -405,7 +417,7 @@ add_entrypoint_object(
405
417
${printf_deps}
406
418
)
407
419
408
- add_entrypoint_object (
420
+ add_generic_entrypoint_object (
409
421
fprintf
410
422
SRCS
411
423
fprintf.cpp
@@ -415,7 +427,7 @@ add_entrypoint_object(
415
427
${fprintf_deps}
416
428
)
417
429
418
- add_entrypoint_object (
430
+ add_generic_entrypoint_object (
419
431
vfprintf
420
432
SRCS
421
433
vfprintf.cpp
@@ -439,7 +451,7 @@ if(LLVM_LIBC_FULL_BUILD AND NOT LIBC_TARGET_OS_IS_GPU)
439
451
)
440
452
endif ()
441
453
442
- add_entrypoint_object (
454
+ add_generic_entrypoint_object (
443
455
fscanf
444
456
SRCS
445
457
fscanf.cpp
@@ -449,7 +461,7 @@ add_entrypoint_object(
449
461
${scanf_deps}
450
462
)
451
463
452
- add_entrypoint_object (
464
+ add_generic_entrypoint_object (
453
465
vfscanf
454
466
SRCS
455
467
vfscanf.cpp
@@ -459,7 +471,7 @@ add_entrypoint_object(
459
471
${scanf_deps}
460
472
)
461
473
462
- add_entrypoint_object (
474
+ add_generic_entrypoint_object (
463
475
scanf
464
476
SRCS
465
477
scanf.cpp
@@ -469,7 +481,7 @@ add_entrypoint_object(
469
481
${scanf_deps}
470
482
)
471
483
472
- add_entrypoint_object (
484
+ add_generic_entrypoint_object (
473
485
vscanf
474
486
SRCS
475
487
vscanf.cpp
@@ -479,7 +491,7 @@ add_entrypoint_object(
479
491
${scanf_deps}
480
492
)
481
493
482
- add_entrypoint_object (
494
+ add_generic_entrypoint_object (
483
495
fgets
484
496
SRCS
485
497
fgets.cpp
@@ -492,7 +504,7 @@ add_entrypoint_object(
492
504
libc.src.__support.File.platform_file
493
505
)
494
506
495
- add_entrypoint_object (
507
+ add_generic_entrypoint_object (
496
508
ungetc
497
509
SRCS
498
510
ungetc.cpp
@@ -504,7 +516,7 @@ add_entrypoint_object(
504
516
libc.src.__support.File.platform_file
505
517
)
506
518
507
- add_entrypoint_object (
519
+ add_generic_entrypoint_object (
508
520
stdin
509
521
SRCS
510
522
stdin.cpp
@@ -516,7 +528,7 @@ add_entrypoint_object(
516
528
libc.src.__support.File.platform_stdin
517
529
)
518
530
519
- add_entrypoint_object (
531
+ add_generic_entrypoint_object (
520
532
stdout
521
533
SRCS
522
534
stdout.cpp
@@ -528,7 +540,7 @@ add_entrypoint_object(
528
540
libc.src.__support.File.platform_stdout
529
541
)
530
542
531
- add_entrypoint_object (
543
+ add_generic_entrypoint_object (
532
544
stderr
533
545
SRCS
534
546
stderr.cpp
0 commit comments