Your message dated Sun, 19 Oct 2008 23:21:30 +0300
with message-id <[EMAIL PROTECTED]>
has caused the   report #320286,
regarding h2xs doesn't recognise enums properly
to be marked as having been forwarded to the upstream software
author(s) [EMAIL PROTECTED]

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [EMAIL PROTECTED]
immediately.)


-- 
320286: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=320286
Debian Bug Tracking System
Contact [EMAIL PROTECTED] with problems
--- Begin Message ---
Contrary to the comment in the code, h2xs mishandles enums that
contain C++ style comments.

An example of a failing header:
enum {
    A = -1, // negative one
            // with more comments
    B = -2, // negative two
    C = -3 // negative two
};

which generates exported constants for 'A' and 'negative'.

The patch is slightly modified from the one by Daniel Burr in
http://bugs.debian.org/320286
---
 utils/h2xs.PL |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/utils/h2xs.PL b/utils/h2xs.PL
index c774d62..4bb7897 100644
--- a/utils/h2xs.PL
+++ b/utils/h2xs.PL
@@ -901,6 +901,7 @@ if( @path_h ){
 
         # Remove C and C++ comments
         $src =~ 
s#/\*[^*]*\*+([^/*][^*]*\*+)*/|("(\\.|[^"\\])*"|'(\\.|[^'\\])*'|.[^/"'\\]*)#$2#gs;
+        $src =~ s#//.*$##gm;
 
        while ($src =~ /\benum\s*([\w_]*)\s*\{\s([^}]+)\}/gsc) {
            my ($enum_name, $enum_body) = ($1, $2);
-- 
1.5.6.5



--- End Message ---

Reply via email to