copy from thrift svn repo (Revision 1429613)