Introduce I_STDCKDINT config macro

This macro is defined in config.h if <stdckdint.h> is available,
and used in previously commited code
(0f2b1e648156555a96ed54170e1b385a60010910, GH #23503).
This commit is contained in:
TAKAI Kousuke 2025-08-29 01:48:30 +09:00 committed by Karl Williamson
parent d9affba121
commit d51aa1a511
14 changed files with 50 additions and 6 deletions

View File

@ -1052,6 +1052,7 @@ i_quadmath=''
i_shadow=''
i_socks=''
i_stdbool=''
i_stdckdint=''
i_stdint=''
i_stdlib=''
i_sunmath=''
@ -24226,6 +24227,10 @@ $rm_try
set i_stdbool
eval $setvar
: see if C23 stdckdint is available
set stdckdint.h i_stdckdint
eval $inhdr
: see if stdint is available
set stdint.h i_stdint
eval $inhdr
@ -25636,6 +25641,7 @@ i_sgtty='$i_sgtty'
i_shadow='$i_shadow'
i_socks='$i_socks'
i_stdbool='$i_stdbool'
i_stdckdint='$i_stdckdint'
i_stdint='$i_stdint'
i_stdlib='$i_stdlib'
i_sunmath='$i_sunmath'

View File

@ -791,6 +791,7 @@ i_sgtty='undef'
i_shadow='define'
i_socks='undef'
i_stdbool='undef'
i_stdckdint='undef'
i_stdint='define'
i_stdlib='define'
i_sunmath='undef'

View File

@ -789,6 +789,7 @@ i_sgtty='undef'
i_shadow='define'
i_socks='undef'
i_stdbool='undef'
i_stdckdint='undef'
i_stdint='define'
i_stdlib='define'
i_sunmath='undef'

View File

@ -3722,6 +3722,11 @@ i_stdbool (i_stdbool.U):
indicates to the C program that <stdbool.h> exists and should
be included.
i_stdckdint (i_stdckdint.U):
This variable conditionally defines the I_STDCKDINT symbol, which
indicates to the C program that <stdckdint.h> exists and should
be included.
i_stdint (i_stdint.U):
This variable conditionally defines the I_STDINT symbol, which
indicates to the C program that <stdint.h> exists and should

View File

@ -813,6 +813,7 @@ i_sgtty='undef'
i_shadow='define'
i_socks='define'
i_stdbool='define'
i_stdckdint='undef'
i_stdint='define'
i_stdlib='define'
i_sunmath='undef'

View File

@ -3842,6 +3842,12 @@ sed <<!GROK!THIS! >$CONFIG_H -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un
*/
#$i_stdbool I_STDBOOL /**/
/* I_STDCKDINT:
* This symbol, if defined, indicates that <stdckdint.h> exists and
* can be included.
*/
#$i_stdckdint I_STDCKDINT /**/
/* I_STDINT:
* This symbol, if defined, indicates that <stdint.h> exists and
* should be included.

View File

@ -3667,6 +3667,12 @@ $ d_fd_set="define"
$ echo4 "Well, your system knows about the normal fd_set typedef..."
$ ENDIF
$!
$! Check for stdckdint.h
$!
$ tmp = "stdckdint.h"
$ GOSUB inhdr
$ i_stdckdint = tmp
$!
$! Check for stdint.h
$!
$ tmp = "stdint.h"
@ -6550,6 +6556,7 @@ $ WC "i_stdbool='define'"
$ ELSE
$ WC "i_stdbool='undef'"
$ ENDIF
$ WC "i_stdckdint='" + i_stdckdint + "'"
$ WC "i_stdint='" + i_stdint + "'"
$ WC "i_stdlib='define'"
$ WC "i_sunmath='undef'"

View File

@ -3456,8 +3456,11 @@ S_lossless_NV_to_IV(const NV nv, IV *ivp)
# define IV_MUL_OVERFLOW_IS_EXPENSIVE (IVSIZE > PTRSIZE)
# endif
# ifdef I_STDCKDINT
# include <stdckdint.h>
# endif
# if defined(I_STDCKDINT) && !IV_ADD_SUB_OVERFLOW_IS_EXPENSIVE
/* XXX Preparation for upcoming C23, but I_STDCKDINT is not yet tested */
# define S_iv_add_may_overflow(il, ir, result) ckd_add(result, il, ir)
# elif defined(HAS_BUILTIN_ADD_OVERFLOW) && !IV_ADD_SUB_OVERFLOW_IS_EXPENSIVE
# define S_iv_add_may_overflow __builtin_add_overflow
@ -3485,7 +3488,6 @@ S_iv_add_may_overflow (IV il, IV ir, IV *const result)
*/
# if defined(I_STDCKDINT)
/* XXX Preparation for upcoming C23, but I_STDCKDINT is not yet tested */
# define S_uv_add_overflow(auv, buv, result) ckd_add(result, auv, buv)
# elif defined(HAS_BUILTIN_ADD_OVERFLOW)
# define S_uv_add_overflow __builtin_add_overflow
@ -3502,7 +3504,6 @@ S_uv_add_overflow (UV auv, UV buv, UV *const result)
# endif
# if defined(I_STDCKDINT) && !IV_ADD_SUB_OVERFLOW_IS_EXPENSIVE
/* XXX Preparation for upcoming C23, but I_STDCKDINT is not yet tested */
# define S_iv_sub_may_overflow(il, ir, result) ckd_sub(result, il, ir)
# elif defined(HAS_BUILTIN_SUB_OVERFLOW) && !IV_ADD_SUB_OVERFLOW_IS_EXPENSIVE
# define S_iv_sub_may_overflow __builtin_sub_overflow
@ -3524,7 +3525,6 @@ S_iv_sub_may_overflow (IV il, IV ir, IV *const result)
# endif
# if defined(I_STDCKDINT)
/* XXX Preparation for upcoming C23, but I_STDCKDINT is not yet tested */
# define S_uv_sub_overflow(auv, buv, result) ckd_sub(result, auv, buv)
# elif defined(HAS_BUILTIN_SUB_OVERFLOW)
# define S_uv_sub_overflow __builtin_sub_overflow
@ -3537,7 +3537,6 @@ S_uv_sub_overflow (UV auv, UV buv, UV *const result)
# endif
# if defined(I_STDCKDINT) && !IV_MUL_OVERFLOW_IS_EXPENSIVE
/* XXX Preparation for upcoming C23, but I_STDCKDINT is not yet tested */
# define S_iv_mul_may_overflow(il, ir, result) ckd_mul(result, il, ir)
# elif defined(HAS_BUILTIN_MUL_OVERFLOW) && !IV_MUL_OVERFLOW_IS_EXPENSIVE
# define S_iv_mul_may_overflow __builtin_mul_overflow
@ -3565,7 +3564,6 @@ S_iv_mul_may_overflow (IV il, IV ir, IV *const result)
# endif
# if defined(I_STDCKDINT)
/* XXX Preparation for upcoming C23, but I_STDCKDINT is not yet tested */
# define S_uv_mul_overflow(auv, buv, result) ckd_mul(result, auv, buv)
# elif defined(HAS_BUILTIN_MUL_OVERFLOW)
# define S_uv_mul_overflow __builtin_mul_overflow

View File

@ -785,6 +785,7 @@ i_sgtty='undef'
i_shadow='undef'
i_socks='undef'
i_stdbool='undef'
i_stdckdint='undef'
i_stdint='undef'
i_stdlib='define'
i_sunmath='undef'

View File

@ -275,6 +275,10 @@ L</Platform Support> section, instead.
=item *
C23 F<< <stdckdint.h> >> and associated macros are now used if available.
=item *
XXX
=back

View File

@ -782,6 +782,7 @@ i_sgtty='undef'
i_shadow='undef'
i_socks='undef'
i_stdbool='define'
i_stdckdint='undef'
i_stdint='define'
i_stdlib='define'
i_sunmath='undef'

View File

@ -781,6 +781,7 @@ i_sgtty='undef'
i_shadow='undef'
i_socks='undef'
i_stdbool='undef'
i_stdckdint='undef'
i_stdint='undef'
i_stdlib='define'
i_sunmath='undef'

View File

@ -3801,6 +3801,12 @@
*/
#define I_STDBOOL /**/
/* I_STDCKDINT:
* This symbol, if defined, indicates that <stdckdint.h> exists and
* can be included.
*/
/*#define I_STDCKDINT / **/
/* I_STDINT:
* This symbol, if defined, indicates that <stdint.h> exists and
* should be included.

View File

@ -3801,6 +3801,12 @@
*/
/*#define I_STDBOOL / **/
/* I_STDCKDINT:
* This symbol, if defined, indicates that <stdckdint.h> exists and
* can be included.
*/
/*#define I_STDCKDINT / **/
/* I_STDINT:
* This symbol, if defined, indicates that <stdint.h> exists and
* should be included.