Skip to content

Commit dac3546

Browse files
committed
Remove redundant defines for UINT32_C, etc
These are furnished by C99 compilers; no need for us to have them too. The set we did have was incomplete.
1 parent 46a87be commit dac3546

File tree

2 files changed

+1
-87
lines changed

2 files changed

+1
-87
lines changed

perl.h

Lines changed: 0 additions & 86 deletions
Original file line numberDiff line numberDiff line change
@@ -1425,51 +1425,6 @@ EXTERN_C int syscall(int, ...);
14251425
EXTERN_C int usleep(unsigned int);
14261426
#endif
14271427

1428-
/* Macros for correct constant construction. These are in C99 <stdint.h>
1429-
* (so they will not be available in strict C89 mode), but they are nice, so
1430-
* let's define them if necessary. */
1431-
1432-
/*
1433-
=for apidoc_section $integer
1434-
=for apidoc Am|I16|INT16_C|number
1435-
=for apidoc_item |I32|INT32_C|number
1436-
=for apidoc_item |I64|INT64_C|number
1437-
1438-
Returns a token the C compiler recognizes for the constant C<number> of the
1439-
corresponding integer type on the machine.
1440-
1441-
If the machine does not have a 64-bit type, C<INT64_C> is undefined.
1442-
Use C<L</INTMAX_C>> to get the largest type available on the platform.
1443-
1444-
=for apidoc Am|U16|UINT16_C|number
1445-
=for apidoc_item |U32|UINT32_C|number
1446-
=for apidoc_item |U64|UINT64_C|number
1447-
1448-
Returns a token the C compiler recognizes for the constant C<number> of the
1449-
corresponding unsigned integer type on the machine.
1450-
1451-
If the machine does not have a 64-bit type, C<UINT64_C> is undefined.
1452-
Use C<L</UINTMAX_C>> to get the largest type available on the platform.
1453-
1454-
1455-
=cut
1456-
*/
1457-
#ifndef UINT16_C
1458-
# if INTSIZE >= 2
1459-
# define UINT16_C(x) ((U16_TYPE)x##U)
1460-
# else
1461-
# define UINT16_C(x) ((U16_TYPE)x##UL)
1462-
# endif
1463-
#endif
1464-
1465-
#ifndef UINT32_C
1466-
# if INTSIZE >= 4
1467-
# define UINT32_C(x) ((U32_TYPE)x##U)
1468-
# else
1469-
# define UINT32_C(x) ((U32_TYPE)x##UL)
1470-
# endif
1471-
#endif
1472-
14731428
#ifdef I_STDINT
14741429
typedef intmax_t PERL_INTMAX_T;
14751430
typedef uintmax_t PERL_UINTMAX_T;
@@ -1481,43 +1436,6 @@ Use C<L</UINTMAX_C>> to get the largest type available on the platform.
14811436
* removing the undef. */
14821437

14831438
#if defined(QUADKIND)
1484-
# undef PeRl_INT64_C
1485-
# undef PeRl_UINT64_C
1486-
/* Prefer the native integer types (int and long) over long long
1487-
* (which is not C89) and Win32-specific __int64. */
1488-
# if QUADKIND == QUAD_IS_INT && INTSIZE == 8
1489-
# define PeRl_INT64_C(c) (c)
1490-
# define PeRl_UINT64_C(c) CAT2(c,U)
1491-
# endif
1492-
# if QUADKIND == QUAD_IS_LONG && LONGSIZE == 8
1493-
# define PeRl_INT64_C(c) CAT2(c,L)
1494-
# define PeRl_UINT64_C(c) CAT2(c,UL)
1495-
# endif
1496-
# if QUADKIND == QUAD_IS_LONG_LONG && defined(HAS_LONG_LONG)
1497-
# define PeRl_INT64_C(c) CAT2(c,LL)
1498-
# define PeRl_UINT64_C(c) CAT2(c,ULL)
1499-
# endif
1500-
# if QUADKIND == QUAD_IS___INT64
1501-
# define PeRl_INT64_C(c) CAT2(c,I64)
1502-
# define PeRl_UINT64_C(c) CAT2(c,UI64)
1503-
# endif
1504-
# ifndef PeRl_INT64_C
1505-
# define PeRl_INT64_C(c) ((I64)(c)) /* last resort */
1506-
# define PeRl_UINT64_C(c) ((U64TYPE)(c))
1507-
# endif
1508-
/* In OS X the INT64_C/UINT64_C are defined with LL/ULL, which will
1509-
* not fly with C89-pedantic gcc, so let's undefine them first so that
1510-
* we can redefine them with our native integer preferring versions. */
1511-
# if defined(PERL_DARWIN) && defined(PERL_GCC_PEDANTIC)
1512-
# undef INT64_C
1513-
# undef UINT64_C
1514-
# endif
1515-
# ifndef INT64_C
1516-
# define INT64_C(c) PeRl_INT64_C(c)
1517-
# endif
1518-
# ifndef UINT64_C
1519-
# define UINT64_C(c) PeRl_UINT64_C(c)
1520-
# endif
15211439

15221440
/*
15231441
=for apidoc_section $integer
@@ -1528,8 +1446,6 @@ long>s, C<INTMAX_C(-1)> would yield
15281446
15291447
-1LL
15301448
1531-
See also, for example, C<L</INT32_C>>.
1532-
15331449
Use L</IV> to declare variables of the maximum usable size on this platform.
15341450
15351451
=for apidoc Am||UINTMAX_C|number
@@ -1539,8 +1455,6 @@ C<long>s, C<UINTMAX_C(1)> would yield
15391455
15401456
1UL
15411457
1542-
See also, for example, C<L</UINT32_C>>.
1543-
15441458
Use L</UV> to declare variables of the maximum usable size on this platform.
15451459
15461460
=cut

pod/perlguts.pod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ be undefined. Use IV and UV to declare the largest practicable, and
5858
C<L<perlapi/WIDEST_UTYPE>> for the absolute maximum unsigned, but which
5959
may not be usable in all circumstances.
6060

61-
A numeric constant can be specified with L<perlapi/C<INT16_C>>,
61+
A numeric constant can be specified with the C99 macros like C<INT16_C>,
6262
L<perlapi/C<UINTMAX_C>>, and similar.
6363

6464
=for apidoc_section $integer

0 commit comments

Comments
 (0)