Just realized that the new thrift has a "pure_enum" option when
generating cpp files. So another workaround is to apply this patch:
===================== CODE BEGINS ============================
diff --git a/src/Makefile.am b/src/Makefile.am
index 7a6ce48..e5c07c4 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -112,8 +112,8 @@ endif
# Set up Thrift specific activity here.
# We assume that a <name>+types.cpp will always be built from
<name>.thrift.
-$(eval $(call thrift_template,.,$(srcdir)/../if/scribe.thrift, -I $
(fb303_home)/share/ --cpp --py --php --java))
-$(eval $(call thrift_template,.,$(srcdir)/../if/bucketupdater.thrift,
-I $(fb303_home)/share/ --cpp --py --php --java))
+$(eval $(call thrift_template,.,$(srcdir)/../if/scribe.thrift, -I $
(fb303_home)/share/ --gen cpp:pure_enums --gen py --gen php --gen
java))
+$(eval $(call thrift_template,.,$(srcdir)/../if/bucketupdater.thrift,
-I $(fb303_home)/share/ --gen cpp:pure_enums --gen py --gen php --gen
java))
if FACEBOOK
$(eval $(call thrift_template,.,$(smc_home)/if/
ServiceManager.thrift,--cpp))
========================= CODE ENDS ==========================
Ying-Yi
> ...
>
> read more »