New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
_h2ph_pre.ph / $Config{cppsymbols} omits gcc-3.4+ cpp "predefined macros" #8305
Comments
From jvdias@redhat.comCreated by jvdias@redhat.comThe gcc cpp "predefined macros" have no definitions in _h2ph_pre.ph, __LONG_MAX__, and __INT_MAX__, and many other '#define's, have NO touch foo.h; cpp -dM foo.h will show all the predefined macros. With gcc-4+ on i386 Fedora Core, many '#define's are "predefined" in cpp: Also, many of these '#define's will cause the current version of So here's a patch against the 5.8.8-RC1 source to merge in the cpp internal <pre> Inline Patch--- perl-5.8.8-RC1/Configure.bz178343 2006-01-08 09:51:03.000000000 -0500
+++ perl-5.8.8-RC1/Configure 2006-01-31 11:50:02.000000000 -0500
@@ -20230,6 +20230,19 @@
chmod +x Cppsym.try
$eunicefix Cppsym.try
./Cppsym < Cppsym.know > Cppsym.true
+: Add in any linux cpp "predefined macros":
+if [[ "$osname" == *linux* ]] && [[ "$ccname" == *gcc* ]]; then
+tHdrH=`mktemp ./XXXXXX`
+rm -f $tHdrH'.h' $tHdrH
+touch $tHdrH'.h'
+if cpp -dM $tHdrH'.h' > $tHdrH'_cppsym.h' && [ -s $tHdrH'_cppsym.h' ] ; then
+ sed 's/#define[\ \ ]*//;s/[\ \ ].*$//' < $tHdrH'_cppsym.h' > $tHdrH'_cppsym.real';
+ if [ -s $tHdrH'_cppsym.real' ]; then
+ cat $tHdrH'_cppsym.real' Cppsym.know | sort | uniq | ./Cppsym | sort | uniq > Cppsym.true;
+ fi;
+fi
+rm -f $tHdrH'.h' $tHdrH'_cppsym.h' $tHdrH'_cppsym.real';
+fi;
: now check the C compiler for additional symbols
postprocess_cc_v=''
case "$osname" in
--- perl-5.8.8-RC1/utils/h2ph.PL.bz178343 2006-01-13 12:56:47.000000000 -0500
+++ perl-5.8.8-RC1/utils/h2ph.PL 2006-01-31 11:53:24.000000000 -0500
@@ -778,8 +778,16 @@
if ($opt_D) {
print PREAMBLE "# $_=$define{$_}\n";
}
-
- if ($define{$_} =~ /^(\d+)U?L{0,2}$/i) {
+ if ($define{$_} =~ /^\((.*)\)$/) {
+ # parenthesized value: d=(v)
+ $define{$_} = $1;
+ };
+ if ($define{$_} =~ /^([+-]?(\d+)?\.\d+([eE][+-]?\d+)?)[FL]?$/ ) {
+ # float:
+ print PREAMBLE
+ "unless (defined &$_) { sub $_() { $1 } }\n\n";
+ } elsif ($define{$_} =~ /^([+-]?\d+)U?L{0,2}$/i) {
+ # integer:
print PREAMBLE
"unless (defined &$_) { sub $_() { $1 } }\n\n";
} elsif ($define{$_} =~ /^\w+$/) {
@@ -805,9 +813,8 @@
@Config{'ccsymbols', 'cppsymbols', 'cppccsymbols'};
# Split compiler pre-definitions into `key=value' pairs:
- foreach (split /\s+/, $allsymbols) {
- /(.+?)=(.+)/ and $define{$1} = $2;
-
+ while( $allsymbols=~/([^\s]+)=((\\\s|[^\s])+)/g ) {
+ $define{$1} = $2;
if ($opt_D) {
print STDERR "$_: $1 -> $2\n";
}
Please consider fixing this issue in the upcoming 5.8.8 / 5.9.3 releases, Thanks & Regards, Perl Info
|
From @TuxThe intent of this patch is correct, but the implementation leaves some : Add in any linux cpp "predefined macros": (changes 27363 and 27367) |
@Tux - Status changed from 'new' to 'resolved' |
Migrated from rt.perl.org#38385 (status was 'resolved')
Searchable as RT38385$
The text was updated successfully, but these errors were encountered: