Skip to content

Commit 9145338

Browse files
committed
Cherry pick patch for 5.16
1 parent e5213bc commit 9145338

File tree

2 files changed

+86
-0
lines changed

2 files changed

+86
-0
lines changed
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
From 6f87f404fa51739971a4068da1f11443024f3fc4 Mon Sep 17 00:00:00 2001
2+
From: Andy Dougherty <[email protected]>
3+
Date: Wed, 6 Jun 2012 11:12:58 -0400
4+
Subject: [perl #113024] Configure: Avoid Cppsym warnings for extra tokens
5+
[perl #113024]
6+
7+
The cppsymbols can include macros such as __INT16_C(c), which can't
8+
be tested with a simple #ifdef. This patch strips off the opening
9+
parenthesis and everything following it. These macros were generated
10+
by cpp -dM.
11+
12+
Also ensure Cppsym.true list is sorted for later input to comm.
13+
(I noticed this while testing this change on Solaris.)
14+
---
15+
Configure | 5 +++--
16+
1 file changed, 3 insertions(+), 2 deletions(-)
17+
18+
diff --git a/Configure b/Configure
19+
index a780b81..3ae16ca 100755
20+
--- a/Configure
21+
+++ b/Configure
22+
@@ -21936,15 +21936,16 @@ $cc -o try -Dcpp_stuff=$cpp_stuff $optimize \$ccflags $ldflags try.c $libs && $r
23+
EOSH
24+
chmod +x Cppsym.try
25+
$eunicefix Cppsym.try
26+
-./Cppsym < Cppsym.know > Cppsym.true
27+
+./Cppsym < Cppsym.know | $sort | $uniq > Cppsym.true
28+
: Add in any linux cpp "predefined macros":
29+
case "$osname::$gccversion" in
30+
*linux*::*.*|*gnukfreebsd*::*.*|gnu::*.*)
31+
tHdrH=_tmpHdr
32+
rm -f $tHdrH'.h' $tHdrH
33+
touch $tHdrH'.h'
34+
+ # Filter out macro arguments, such as Linux's __INT8_C(c)
35+
if $cpp -dM $tHdrH'.h' > $tHdrH'_cppsym.h' && [ -s $tHdrH'_cppsym.h' ]; then
36+
- sed 's/#define[\ \ ]*//;s/[\ \ ].*$//' <$tHdrH'_cppsym.h' >$tHdrH'_cppsym.real'
37+
+ sed -e 's/#define[\ \ ]*//;s/[\ \ ].*$//' -e 's/(.*//' <$tHdrH'_cppsym.h' >$tHdrH'_cppsym.real'
38+
if [ -s $tHdrH'_cppsym.real' ]; then
39+
cat $tHdrH'_cppsym.real' Cppsym.know | sort | uniq | ./Cppsym | sort | uniq > Cppsym.true
40+
fi
41+
--
42+
2.1.4
43+
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
From 6f87f404fa51739971a4068da1f11443024f3fc4 Mon Sep 17 00:00:00 2001
2+
From: Andy Dougherty <[email protected]>
3+
Date: Wed, 6 Jun 2012 11:12:58 -0400
4+
Subject: [perl #113024] Configure: Avoid Cppsym warnings for extra tokens
5+
[perl #113024]
6+
7+
The cppsymbols can include macros such as __INT16_C(c), which can't
8+
be tested with a simple #ifdef. This patch strips off the opening
9+
parenthesis and everything following it. These macros were generated
10+
by cpp -dM.
11+
12+
Also ensure Cppsym.true list is sorted for later input to comm.
13+
(I noticed this while testing this change on Solaris.)
14+
---
15+
Configure | 5 +++--
16+
1 file changed, 3 insertions(+), 2 deletions(-)
17+
18+
diff --git a/Configure b/Configure
19+
index a780b81..3ae16ca 100755
20+
--- a/Configure
21+
+++ b/Configure
22+
@@ -21936,15 +21936,16 @@ $cc -o try -Dcpp_stuff=$cpp_stuff $optimize \$ccflags $ldflags try.c $libs && $r
23+
EOSH
24+
chmod +x Cppsym.try
25+
$eunicefix Cppsym.try
26+
-./Cppsym < Cppsym.know > Cppsym.true
27+
+./Cppsym < Cppsym.know | $sort | $uniq > Cppsym.true
28+
: Add in any linux cpp "predefined macros":
29+
case "$osname::$gccversion" in
30+
*linux*::*.*|*gnukfreebsd*::*.*|gnu::*.*)
31+
tHdrH=_tmpHdr
32+
rm -f $tHdrH'.h' $tHdrH
33+
touch $tHdrH'.h'
34+
+ # Filter out macro arguments, such as Linux's __INT8_C(c)
35+
if $cpp -dM $tHdrH'.h' > $tHdrH'_cppsym.h' && [ -s $tHdrH'_cppsym.h' ]; then
36+
- sed 's/#define[\ \ ]*//;s/[\ \ ].*$//' <$tHdrH'_cppsym.h' >$tHdrH'_cppsym.real'
37+
+ sed -e 's/#define[\ \ ]*//;s/[\ \ ].*$//' -e 's/(.*//' <$tHdrH'_cppsym.h' >$tHdrH'_cppsym.real'
38+
if [ -s $tHdrH'_cppsym.real' ]; then
39+
cat $tHdrH'_cppsym.real' Cppsym.know | sort | uniq | ./Cppsym | sort | uniq > Cppsym.true
40+
fi
41+
--
42+
2.1.4
43+

0 commit comments

Comments
 (0)