Skip to content

Commit d51aa1a

Browse files
t-a-kkhwilliamson
authored andcommitted
Introduce I_STDCKDINT config macro
This macro is defined in config.h if <stdckdint.h> is available, and used in previously commited code (0f2b1e6, GH #23503).
1 parent d9affba commit d51aa1a

File tree

14 files changed

+50
-6
lines changed

14 files changed

+50
-6
lines changed

Configure

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1052,6 +1052,7 @@ i_quadmath=''
10521052
i_shadow=''
10531053
i_socks=''
10541054
i_stdbool=''
1055+
i_stdckdint=''
10551056
i_stdint=''
10561057
i_stdlib=''
10571058
i_sunmath=''
@@ -24226,6 +24227,10 @@ $rm_try
2422624227
set i_stdbool
2422724228
eval $setvar
2422824229

24230+
: see if C23 stdckdint is available
24231+
set stdckdint.h i_stdckdint
24232+
eval $inhdr
24233+
2422924234
: see if stdint is available
2423024235
set stdint.h i_stdint
2423124236
eval $inhdr
@@ -25636,6 +25641,7 @@ i_sgtty='$i_sgtty'
2563625641
i_shadow='$i_shadow'
2563725642
i_socks='$i_socks'
2563825643
i_stdbool='$i_stdbool'
25644+
i_stdckdint='$i_stdckdint'
2563925645
i_stdint='$i_stdint'
2564025646
i_stdlib='$i_stdlib'
2564125647
i_sunmath='$i_sunmath'

Cross/config.sh-arm-linux

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -791,6 +791,7 @@ i_sgtty='undef'
791791
i_shadow='define'
792792
i_socks='undef'
793793
i_stdbool='undef'
794+
i_stdckdint='undef'
794795
i_stdint='define'
795796
i_stdlib='define'
796797
i_sunmath='undef'

Cross/config.sh-arm-linux-n770

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -789,6 +789,7 @@ i_sgtty='undef'
789789
i_shadow='define'
790790
i_socks='undef'
791791
i_stdbool='undef'
792+
i_stdckdint='undef'
792793
i_stdint='define'
793794
i_stdlib='define'
794795
i_sunmath='undef'

Porting/Glossary

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3722,6 +3722,11 @@ i_stdbool (i_stdbool.U):
37223722
indicates to the C program that <stdbool.h> exists and should
37233723
be included.
37243724

3725+
i_stdckdint (i_stdckdint.U):
3726+
This variable conditionally defines the I_STDCKDINT symbol, which
3727+
indicates to the C program that <stdckdint.h> exists and should
3728+
be included.
3729+
37253730
i_stdint (i_stdint.U):
37263731
This variable conditionally defines the I_STDINT symbol, which
37273732
indicates to the C program that <stdint.h> exists and should

Porting/config.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -813,6 +813,7 @@ i_sgtty='undef'
813813
i_shadow='define'
814814
i_socks='define'
815815
i_stdbool='define'
816+
i_stdckdint='undef'
816817
i_stdint='define'
817818
i_stdlib='define'
818819
i_sunmath='undef'

config_h.SH

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3842,6 +3842,12 @@ sed <<!GROK!THIS! >$CONFIG_H -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un
38423842
*/
38433843
#$i_stdbool I_STDBOOL /**/
38443844
3845+
/* I_STDCKDINT:
3846+
* This symbol, if defined, indicates that <stdckdint.h> exists and
3847+
* can be included.
3848+
*/
3849+
#$i_stdckdint I_STDCKDINT /**/
3850+
38453851
/* I_STDINT:
38463852
* This symbol, if defined, indicates that <stdint.h> exists and
38473853
* should be included.

configure.com

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3667,6 +3667,12 @@ $ d_fd_set="define"
36673667
$ echo4 "Well, your system knows about the normal fd_set typedef..."
36683668
$ ENDIF
36693669
$!
3670+
$! Check for stdckdint.h
3671+
$!
3672+
$ tmp = "stdckdint.h"
3673+
$ GOSUB inhdr
3674+
$ i_stdckdint = tmp
3675+
$!
36703676
$! Check for stdint.h
36713677
$!
36723678
$ tmp = "stdint.h"
@@ -6550,6 +6556,7 @@ $ WC "i_stdbool='define'"
65506556
$ ELSE
65516557
$ WC "i_stdbool='undef'"
65526558
$ ENDIF
6559+
$ WC "i_stdckdint='" + i_stdckdint + "'"
65536560
$ WC "i_stdint='" + i_stdint + "'"
65546561
$ WC "i_stdlib='define'"
65556562
$ WC "i_sunmath='undef'"

inline.h

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3456,8 +3456,11 @@ S_lossless_NV_to_IV(const NV nv, IV *ivp)
34563456
# define IV_MUL_OVERFLOW_IS_EXPENSIVE (IVSIZE > PTRSIZE)
34573457
# endif
34583458

3459+
# ifdef I_STDCKDINT
3460+
# include <stdckdint.h>
3461+
# endif
3462+
34593463
# if defined(I_STDCKDINT) && !IV_ADD_SUB_OVERFLOW_IS_EXPENSIVE
3460-
/* XXX Preparation for upcoming C23, but I_STDCKDINT is not yet tested */
34613464
# define S_iv_add_may_overflow(il, ir, result) ckd_add(result, il, ir)
34623465
# elif defined(HAS_BUILTIN_ADD_OVERFLOW) && !IV_ADD_SUB_OVERFLOW_IS_EXPENSIVE
34633466
# 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)
34853488
*/
34863489

34873490
# if defined(I_STDCKDINT)
3488-
/* XXX Preparation for upcoming C23, but I_STDCKDINT is not yet tested */
34893491
# define S_uv_add_overflow(auv, buv, result) ckd_add(result, auv, buv)
34903492
# elif defined(HAS_BUILTIN_ADD_OVERFLOW)
34913493
# define S_uv_add_overflow __builtin_add_overflow
@@ -3502,7 +3504,6 @@ S_uv_add_overflow (UV auv, UV buv, UV *const result)
35023504
# endif
35033505

35043506
# if defined(I_STDCKDINT) && !IV_ADD_SUB_OVERFLOW_IS_EXPENSIVE
3505-
/* XXX Preparation for upcoming C23, but I_STDCKDINT is not yet tested */
35063507
# define S_iv_sub_may_overflow(il, ir, result) ckd_sub(result, il, ir)
35073508
# elif defined(HAS_BUILTIN_SUB_OVERFLOW) && !IV_ADD_SUB_OVERFLOW_IS_EXPENSIVE
35083509
# 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)
35243525
# endif
35253526

35263527
# if defined(I_STDCKDINT)
3527-
/* XXX Preparation for upcoming C23, but I_STDCKDINT is not yet tested */
35283528
# define S_uv_sub_overflow(auv, buv, result) ckd_sub(result, auv, buv)
35293529
# elif defined(HAS_BUILTIN_SUB_OVERFLOW)
35303530
# define S_uv_sub_overflow __builtin_sub_overflow
@@ -3537,7 +3537,6 @@ S_uv_sub_overflow (UV auv, UV buv, UV *const result)
35373537
# endif
35383538

35393539
# if defined(I_STDCKDINT) && !IV_MUL_OVERFLOW_IS_EXPENSIVE
3540-
/* XXX Preparation for upcoming C23, but I_STDCKDINT is not yet tested */
35413540
# define S_iv_mul_may_overflow(il, ir, result) ckd_mul(result, il, ir)
35423541
# elif defined(HAS_BUILTIN_MUL_OVERFLOW) && !IV_MUL_OVERFLOW_IS_EXPENSIVE
35433542
# 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)
35653564
# endif
35663565

35673566
# if defined(I_STDCKDINT)
3568-
/* XXX Preparation for upcoming C23, but I_STDCKDINT is not yet tested */
35693567
# define S_uv_mul_overflow(auv, buv, result) ckd_mul(result, auv, buv)
35703568
# elif defined(HAS_BUILTIN_MUL_OVERFLOW)
35713569
# define S_uv_mul_overflow __builtin_mul_overflow

plan9/config_sh.sample

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -785,6 +785,7 @@ i_sgtty='undef'
785785
i_shadow='undef'
786786
i_socks='undef'
787787
i_stdbool='undef'
788+
i_stdckdint='undef'
788789
i_stdint='undef'
789790
i_stdlib='define'
790791
i_sunmath='undef'

pod/perldelta.pod

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,10 @@ L</Platform Support> section, instead.
275275

276276
=item *
277277

278+
C23 F<< <stdckdint.h> >> and associated macros are now used if available.
279+
280+
=item *
281+
278282
XXX
279283

280284
=back

0 commit comments

Comments
 (0)