[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index][Thread Index][Top&Search][Original]

[perl #55896] h2xs does not handle properly enum constants



> As a side note, there have been several fixes that have gone into h2xs
> since that blog entry was created, so I'm not sure how relevant it may
> still be.  Setting the precedent for --skip-ppport is a bit troubling.

> I had thought that all the enum problems had been nailed down though.
> Is there a particular .h that is causing problems.  What was the exact
> command line you were using?

If you try the example in the blog[1], the only bug that has been
fixed in 5.10 is

  870c868
  < my ($key, $declared_val) = $item =~ /(\w*)\s*=\s*(.*)/;
  ---
  > my ($key, $declared_val) = $item =~ /(\w+)\s*[=,]*\s*(.*)/;

all of the others remain. The .h in question is:

#define XST_DEFINE 1

typedef enum xst_enum {
        XST_ENUM_1,
        XST_ENUM_2,
} xst_enum_t;

typedef enum xst_enum_val {
        XST_ENUM_VAL_1 = 1,
        XST_ENUM_VAL_2 = 2,
} xst_enum_val_t;

The command was:

h2xs --skip-ppport --overwrite-ok --autogen-xsubs --name=XS::Test xs_test.h

Regards

Jeff

[1] http://blogs.sun.com/akolb/entry/pitfals_of_the_perl_xs


[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index][Thread Index][Top&Search][Original]