You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@thrift.apache.org by Dheeraj Goswami <dh...@yahoo.com> on 2010/11/01 22:17:54 UTC

Update to 0.5.0 issue in generated enum code

Hi All,
I am trying to update to thrift 0.5.0 and
 noticed that my code failed to compiled because of enum generated code has 
changed.

Earlier it was like this
namespace myns {
enum My {
  A,
  B,
};
}

Now with 0.5.0 it is like this
namespace myns {
struct My {
  enum type
 {
    A = 0,
    B = 1,
  };
};
}

Because of this, I had the calling code like myns::A that needs to be changed to myns::My::A

Is this correct and expected or am I doing something wrong?

thanks,

--dheeraj

Re: Update to 0.5.0 issue in generated enum code

Posted by Tony Kinnis <tk...@yahoo.com>.
I believe that change was introduced by: 
https://issues.apache.org/jira/browse/THRIFT-897 and related.


----- Original Message ----
From: Dheeraj Goswami <dh...@yahoo.com>
To: user@thrift.apache.org
Sent: Mon, November 1, 2010 2:17:54 PM
Subject: Update to 0.5.0 issue in generated enum code

Hi All,
I am trying to update to thrift 0.5.0 and
noticed that my code failed to compiled because of enum generated code has 
changed.

Earlier it was like this
namespace myns {
enum My {
  A,
  B,
};
}

Now with 0.5.0 it is like this
namespace myns {
struct My {
  enum type
{
    A = 0,
    B = 1,
  };
};
}

Because of this, I had the calling code like myns::A that needs to be changed to 
myns::My::A

Is this correct and expected or am I doing something wrong?

thanks,

--dheeraj


      

Re: Update to 0.5.0 issue in generated enum code

Posted by ro...@bufferoverflow.ch.
yes, thats correct!

as alternative you can use the pure_enums option to get old style cpp files:
  --gen cpp:pure_enums

-Roger



Quoting Dheeraj Goswami <dh...@yahoo.com>:

> Hi All,
> I am trying to update to thrift 0.5.0 and
>  noticed that my code failed to compiled because of enum generated code has
> changed.
>
> Earlier it was like this
> namespace myns {
> enum My {
>   A,
>   B,
> };
> }
>
> Now with 0.5.0 it is like this
> namespace myns {
> struct My {
>   enum type
>  {
>     A = 0,
>     B = 1,
>   };
> };
> }
>
> Because of this, I had the calling code like myns::A that needs to  
> be changed to myns::My::A
>
> Is this correct and expected or am I doing something wrong?
>
> thanks,
>
> --dheeraj



----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.