@@ -317,166 +317,55 @@ typedef __UINTMAX_TYPE__ uintmax_t;
317317 * integer width that the target implements, so corresponding macros are
318318 * defined below, too.
319319 *
320- * These macros are defined using the same successive-shrinking approach as
321- * the type definitions above. It is likewise important that macros are defined
322- * in order of decending width.
323- *
324320 * Note that C++ should not check __STDC_CONSTANT_MACROS here, contrary to the
325321 * claims of the C standard (see C++ 18.3.1p2, [cstdint.syn]).
326322 */
327323
328- #define __int_c_join (a , b ) a ## b
329- #define __int_c (v , suffix ) __int_c_join(v, suffix)
330- #define __uint_c (v , suffix ) __int_c_join(v##U, suffix)
331-
332-
333- #ifdef __INT64_TYPE__
334- # undef __int64_c_suffix
335- # undef __int32_c_suffix
336- # undef __int16_c_suffix
337- # undef __int8_c_suffix
338- # ifdef __INT64_C_SUFFIX__
339- # define __int64_c_suffix __INT64_C_SUFFIX__
340- # define __int32_c_suffix __INT64_C_SUFFIX__
341- # define __int16_c_suffix __INT64_C_SUFFIX__
342- # define __int8_c_suffix __INT64_C_SUFFIX__
343- # endif /* __INT64_C_SUFFIX__ */
344- #endif /* __INT64_TYPE__ */
345-
346324#ifdef __int_least64_t
347- # ifdef __int64_c_suffix
348- # define INT64_C (v ) __int_c(v, __int64_c_suffix)
349- # define UINT64_C (v ) __uint_c(v, __int64_c_suffix)
350- # else
351- # define INT64_C (v ) v
352- # define UINT64_C (v ) v ## U
353- # endif /* __int64_c_suffix */
325+ #define INT64_C (v ) __INT64_C(v)
326+ #define UINT64_C (v ) __UINT64_C(v)
354327#endif /* __int_least64_t */
355328
356329
357330#ifdef __INT56_TYPE__
358- # undef __int32_c_suffix
359- # undef __int16_c_suffix
360- # undef __int8_c_suffix
361- # ifdef __INT56_C_SUFFIX__
362- # define INT56_C (v ) __int_c(v, __INT56_C_SUFFIX__)
363- # define UINT56_C (v ) __uint_c(v, __INT56_C_SUFFIX__)
364- # define __int32_c_suffix __INT56_C_SUFFIX__
365- # define __int16_c_suffix __INT56_C_SUFFIX__
366- # define __int8_c_suffix __INT56_C_SUFFIX__
367- # else
368- # define INT56_C (v ) v
369- # define UINT56_C (v ) v ## U
370- # endif /* __INT56_C_SUFFIX__ */
331+ #define INT56_C (v ) __INT56_C(v)
332+ #define UINT56_C (v ) __UINT56_C(v)
371333#endif /* __INT56_TYPE__ */
372334
373335
374336#ifdef __INT48_TYPE__
375- # undef __int32_c_suffix
376- # undef __int16_c_suffix
377- # undef __int8_c_suffix
378- # ifdef __INT48_C_SUFFIX__
379- # define INT48_C (v ) __int_c(v, __INT48_C_SUFFIX__)
380- # define UINT48_C (v ) __uint_c(v, __INT48_C_SUFFIX__)
381- # define __int32_c_suffix __INT48_C_SUFFIX__
382- # define __int16_c_suffix __INT48_C_SUFFIX__
383- # define __int8_c_suffix __INT48_C_SUFFIX__
384- # else
385- # define INT48_C (v ) v
386- # define UINT48_C (v ) v ## U
387- # endif /* __INT48_C_SUFFIX__ */
337+ #define INT48_C (v ) __INT48_C(v)
338+ #define UINT48_C (v ) __UINT48_C(v)
388339#endif /* __INT48_TYPE__ */
389340
390341
391342#ifdef __INT40_TYPE__
392- # undef __int32_c_suffix
393- # undef __int16_c_suffix
394- # undef __int8_c_suffix
395- # ifdef __INT40_C_SUFFIX__
396- # define INT40_C (v ) __int_c(v, __INT40_C_SUFFIX__)
397- # define UINT40_C (v ) __uint_c(v, __INT40_C_SUFFIX__)
398- # define __int32_c_suffix __INT40_C_SUFFIX__
399- # define __int16_c_suffix __INT40_C_SUFFIX__
400- # define __int8_c_suffix __INT40_C_SUFFIX__
401- # else
402- # define INT40_C (v ) v
403- # define UINT40_C (v ) v ## U
404- # endif /* __INT40_C_SUFFIX__ */
343+ #define INT40_C (v ) __INT40_C(v)
344+ #define UINT40_C (v ) __UINT40_C(v)
405345#endif /* __INT40_TYPE__ */
406346
407347
408- #ifdef __INT32_TYPE__
409- # undef __int32_c_suffix
410- # undef __int16_c_suffix
411- # undef __int8_c_suffix
412- # ifdef __INT32_C_SUFFIX__
413- # define __int32_c_suffix __INT32_C_SUFFIX__
414- # define __int16_c_suffix __INT32_C_SUFFIX__
415- # define __int8_c_suffix __INT32_C_SUFFIX__
416- # endif /* __INT32_C_SUFFIX__ */
417- #endif /* __INT32_TYPE__ */
418-
419348#ifdef __int_least32_t
420- # ifdef __int32_c_suffix
421- # define INT32_C (v ) __int_c(v, __int32_c_suffix)
422- # define UINT32_C (v ) __uint_c(v, __int32_c_suffix)
423- # else
424- # define INT32_C (v ) v
425- # define UINT32_C (v ) v ## U
426- # endif /* __int32_c_suffix */
349+ #define INT32_C (v ) __INT32_C(v)
350+ #define UINT32_C (v ) __UINT32_C(v)
427351#endif /* __int_least32_t */
428352
429353
430354#ifdef __INT24_TYPE__
431- # undef __int16_c_suffix
432- # undef __int8_c_suffix
433- # ifdef __INT24_C_SUFFIX__
434- # define INT24_C (v ) __int_c(v, __INT24_C_SUFFIX__)
435- # define UINT24_C (v ) __uint_c(v, __INT24_C_SUFFIX__)
436- # define __int16_c_suffix __INT24_C_SUFFIX__
437- # define __int8_c_suffix __INT24_C_SUFFIX__
438- # else
439- # define INT24_C (v ) v
440- # define UINT24_C (v ) v ## U
441- # endif /* __INT24_C_SUFFIX__ */
355+ #define INT24_C (v ) __INT24_C(v)
356+ #define UINT24_C (v ) __UINT24_C(v)
442357#endif /* __INT24_TYPE__ */
443358
444359
445- #ifdef __INT16_TYPE__
446- # undef __int16_c_suffix
447- # undef __int8_c_suffix
448- # ifdef __INT16_C_SUFFIX__
449- # define __int16_c_suffix __INT16_C_SUFFIX__
450- # define __int8_c_suffix __INT16_C_SUFFIX__
451- # endif /* __INT16_C_SUFFIX__ */
452- #endif /* __INT16_TYPE__ */
453-
454360#ifdef __int_least16_t
455- # ifdef __int16_c_suffix
456- # define INT16_C (v ) __int_c(v, __int16_c_suffix)
457- # define UINT16_C (v ) __uint_c(v, __int16_c_suffix)
458- # else
459- # define INT16_C (v ) v
460- # define UINT16_C (v ) v ## U
461- # endif /* __int16_c_suffix */
361+ #define INT16_C (v ) __INT16_C(v)
362+ #define UINT16_C (v ) __UINT16_C(v)
462363#endif /* __int_least16_t */
463364
464365
465- #ifdef __INT8_TYPE__
466- # undef __int8_c_suffix
467- # ifdef __INT8_C_SUFFIX__
468- # define __int8_c_suffix __INT8_C_SUFFIX__
469- # endif /* __INT8_C_SUFFIX__ */
470- #endif /* __INT8_TYPE__ */
471-
472366#ifdef __int_least8_t
473- # ifdef __int8_c_suffix
474- # define INT8_C (v ) __int_c(v, __int8_c_suffix)
475- # define UINT8_C (v ) __uint_c(v, __int8_c_suffix)
476- # else
477- # define INT8_C (v ) v
478- # define UINT8_C (v ) v ## U
479- # endif /* __int8_c_suffix */
367+ #define INT8_C (v ) __INT8_C(v)
368+ #define UINT8_C (v ) __UINT8_C(v)
480369#endif /* __int_least8_t */
481370
482371
@@ -938,8 +827,8 @@ typedef __UINTMAX_TYPE__ uintmax_t;
938827#endif
939828
940829/* 7.18.4.2 Macros for greatest-width integer constants. */
941- #define INTMAX_C (v ) __int_c(v, __INTMAX_C_SUFFIX__ )
942- #define UINTMAX_C (v ) __int_c(v, __UINTMAX_C_SUFFIX__ )
830+ #define INTMAX_C (v ) __INTMAX_C(v )
831+ #define UINTMAX_C (v ) __UINTMAX_C(v )
943832
944833/* C23 7.22.3.x Width of other integer types. */
945834#if defined(__STDC_VERSION__ ) && __STDC_VERSION__ >= 202311L
0 commit comments