Fix parser error containing multiple #define statements inside an enum.

The second #define fails to parse:

  enum FooEnum {
    ENUM1 = 0,
    ENUM2 = 1,

  #define MACRO_DEF1 "Hello"
  #define MACRO_DEF2 "World!"

    ENUM3 = 2,
    ENUM4 = 3,
  };

Bug mentioned at https://sourceforge.net/p/swig/patches/333/
This commit is contained in:
William S Fulton 2019-02-16 08:09:56 +00:00
commit eb7b989c61
6 changed files with 92 additions and 17 deletions

View file

@ -88,6 +88,30 @@ public class enum_macro_runme {
{
Greeks13 a = null;
}
{
Greeks15 a = Greeks15.alpha15;
a = Greeks15.beta15;
a = Greeks15.theta15;
a = Greeks15.delta15;
if (a.swigValue() != 153)
throw new RuntimeException("Greeks15");
}
{
Greeks16 a = Greeks16.alpha16;
a = Greeks16.beta16;
a = Greeks16.theta16;
a = Greeks16.delta16;
if (a.swigValue() != 163)
throw new RuntimeException("Greeks16");
}
{
Greeks17 a = Greeks17.alpha17;
a = Greeks17.beta17;
a = Greeks17.theta17;
a = Greeks17.delta17;
if (a.swigValue() != 173)
throw new RuntimeException("Greeks17");
}
}
}