ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> perl5-porters
perl5-porters
[perl #57176] Including XSUB.h before perl.h gives nasty error
by Fawaka@Gmail.Com other posts by this author
Jul 21 2008 4:20PM messages near this date
Smoke [5.11.0] 34153 FAIL(Ft) MSWin32 WinXP/.Net SP3 (x86/2 cpu) | XS_Loader.pm .bs strangeness
# New Ticket Created by  fawaka@[...].com 
# Please include the string:  [perl #57176]
# in the subject line of all future correspondence about this issue. 
# <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=57176 > 



This is a bug report for perl from fawaka@[...].com,
generated with the help of perlbug 1.35 running under perl v5.8.8.


-----------------------------------------------------------------
[Please enter your report here]

Including XSUB.h before perl.h gives nasty error

This simple program:

#include <XSUB.h> 
#include <EXTERN.h> 
#include <perl.h> 

Will give this error for me (using the headers of perl 5.10 and gcc 4.2.3)

In file included from /home/leon/Programs/perl/perl-5.10.0/perl.h:4700,
                 from test.C:3:
/home/leon/Programs/perl/perl-5.10.0/embedvar.h:179:1: warning: "PL_madskills" redefined
In file included from test.C:1:
/home/leon/Programs/perl/perl-5.10.0/XSUB.h:421:1: warning: this is the location of the prev
ious definition
In file included from /home/leon/Programs/perl/perl-5.10.0/perl.h:4700,
                 from test.C:3:
/home/leon/Programs/perl/perl-5.10.0/embedvar.h:349:1: warning: "PL_xmlfp" redefined
In file included from test.C:1:
/home/leon/Programs/perl/perl-5.10.0/XSUB.h:422:1: warning: this is the location of the prev
ious definition

This used to work using perl 5.8.8. It can be solved by including XSUB.h after perl.h. A mor
e structural solution seems to be simply removing lines 418-423 of XSUB.h (they are identica
l to line 4777-4782 of perl.h, they seem to be superfluous).

Regards,

Leon Timmermans

The patch:

diff -ruN perl-current/XSUB.h perl-patched/XSUB.h
--- perl-current/XSUB.h 2008-01-04 01:37:40.000000000 +0100
+++ perl-patched/XSUB.h 2008-07-21 19:02:11.000000000 +0200
@@ -415,12 +415,6 @@
 #endif

 #include "perlapi.h"
-#ifndef PERL_MAD
-#  undef PL_madskills
-#  undef PL_xmlfp
-#  define PL_madskills 0
-#  define PL_xmlfp 0
-#endif

 #if defined(PERL_IMPLICIT_CONTEXT) && !defined(PERL_NO_GET_CONTEXT) && !defined(PERL_CORE)
 #  undef aTHX


[Please do not change anything below this line]
-----------------------------------------------------------------
---
Flags:
    category=core
    severity=low
---
Site configuration information for perl v5.8.8:

Deleted to avoid confusion. The problem happens when compiling against a different version o
f perl than the one I'm running. What is important is that PERL_MAD was not defined during c
ompilation.

---
Environment for perl v5.8.8:
    HOME=/home/leon
    LANG=en_US.UTF-8
    LANGUAGE (unset)
    LOGDIR (unset)
    PATH=/home/leon/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/ga
mes
    PERL_BADLANG (unset)
    SHELL=/bin/bash

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved