THRIFT-1552 Include paths for c/c++ should be prefixed with 'thrift/'

To ensure there are no include path collisions the C and C++ header
include paths should include 'thrift' as the root leaf. This will
prevent having to place /usr/include/thrift into the compilers include
header search path, which might otherwise result in the compiler
accidentally picking up headers that it shouldn't.

e.g. #include <foo/bar.h> should be #include <thrift/foo/bar.h>

Change-Id: I48f2b0f549bda0fc81e85506ac857adc800b98a1

git-svn-id: https://svn.apache.org/repos/asf/thrift/trunk@1325674 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/LICENSE b/LICENSE
index 9d189ef..697fc95 100644
--- a/LICENSE
+++ b/LICENSE
@@ -223,25 +223,25 @@
 under the Apache 2.0 License:
 
   compiler/cpp/Makefile.am
-  compiler/cpp/src/generate/t_cocoa_generator.cc
-  compiler/cpp/src/generate/t_cpp_generator.cc
-  compiler/cpp/src/generate/t_csharp_generator.cc
-  compiler/cpp/src/generate/t_erl_generator.cc
-  compiler/cpp/src/generate/t_hs_generator.cc
-  compiler/cpp/src/generate/t_java_generator.cc
-  compiler/cpp/src/generate/t_ocaml_generator.cc
-  compiler/cpp/src/generate/t_perl_generator.cc
-  compiler/cpp/src/generate/t_php_generator.cc
-  compiler/cpp/src/generate/t_py_generator.cc
-  compiler/cpp/src/generate/t_rb_generator.cc
-  compiler/cpp/src/generate/t_st_generator.cc
-  compiler/cpp/src/generate/t_xsd_generator.cc
-  compiler/cpp/src/main.cc
-  compiler/cpp/src/parse/t_field.h
-  compiler/cpp/src/parse/t_program.h
-  compiler/cpp/src/platform.h
-  compiler/cpp/src/thriftl.ll
-  compiler/cpp/src/thrifty.yy
+  compiler/cpp/src/thrift/generate/t_cocoa_generator.cc
+  compiler/cpp/src/thrift/generate/t_cpp_generator.cc
+  compiler/cpp/src/thrift/generate/t_csharp_generator.cc
+  compiler/cpp/src/thrift/generate/t_erl_generator.cc
+  compiler/cpp/src/thrift/generate/t_hs_generator.cc
+  compiler/cpp/src/thrift/generate/t_java_generator.cc
+  compiler/cpp/src/thrift/generate/t_ocaml_generator.cc
+  compiler/cpp/src/thrift/generate/t_perl_generator.cc
+  compiler/cpp/src/thrift/generate/t_php_generator.cc
+  compiler/cpp/src/thrift/generate/t_py_generator.cc
+  compiler/cpp/src/thrift/generate/t_rb_generator.cc
+  compiler/cpp/src/thrift/generate/t_st_generator.cc
+  compiler/cpp/src/thrift/generate/t_xsd_generator.cc
+  compiler/cpp/src/thrift/main.cc
+  compiler/cpp/src/thrift/parse/t_field.h
+  compiler/cpp/src/thrift/parse/t_program.h
+  compiler/cpp/src/thrift/platform.h
+  compiler/cpp/src/thrift/thriftl.ll
+  compiler/cpp/src/thrift/thrifty.yy
   lib/csharp/src/Protocol/TBinaryProtocol.cs
   lib/csharp/src/Protocol/TField.cs
   lib/csharp/src/Protocol/TList.cs
@@ -289,7 +289,7 @@
 #   the copyright notice and this notice are preserved.
 
 --------------------------------------------------
-For the compiler/cpp/src/md5.[ch] components:
+For the compiler/cpp/src/thrift/md5.[ch] components:
 
 /*
   Copyright (C) 1999, 2000, 2002 Aladdin Enterprises.  All rights reserved.
diff --git a/compiler/cpp/compiler.vcxproj b/compiler/cpp/compiler.vcxproj
index a01f3f2..16ea2c0 100644
--- a/compiler/cpp/compiler.vcxproj
+++ b/compiler/cpp/compiler.vcxproj
@@ -19,66 +19,66 @@
     </ProjectConfiguration>
   </ItemGroup>
   <ItemGroup>
-    <ClInclude Include="src\generate\t_generator.h" />
-    <ClInclude Include="src\generate\t_generator_registry.h" />
-    <ClInclude Include="src\generate\t_oop_generator.h" />
-    <ClInclude Include="src\globals.h" />
-    <ClInclude Include="src\main.h" />
-    <ClInclude Include="src\md5.h" />
-    <ClInclude Include="src\parse\t_base_type.h" />
-    <ClInclude Include="src\parse\t_const.h" />
-    <ClInclude Include="src\parse\t_const_value.h" />
-    <ClInclude Include="src\parse\t_container.h" />
-    <ClInclude Include="src\parse\t_doc.h" />
-    <ClInclude Include="src\parse\t_enum.h" />
-    <ClInclude Include="src\parse\t_enum_value.h" />
-    <ClInclude Include="src\parse\t_field.h" />
-    <ClInclude Include="src\parse\t_function.h" />
-    <ClInclude Include="src\parse\t_list.h" />
-    <ClInclude Include="src\parse\t_map.h" />
-    <ClInclude Include="src\parse\t_program.h" />
-    <ClInclude Include="src\parse\t_scope.h" />
-    <ClInclude Include="src\parse\t_service.h" />
-    <ClInclude Include="src\parse\t_set.h" />
-    <ClInclude Include="src\parse\t_struct.h" />
-    <ClInclude Include="src\parse\t_type.h" />
-    <ClInclude Include="src\parse\t_typedef.h" />
-    <ClInclude Include="src\platform.h" />
-    <ClInclude Include="src\thrifty.h" />
-    <ClInclude Include="src\windows\config.h" />
-    <ClInclude Include="src\windows\version.h" />
+    <ClInclude Include="src\thrift\generate\t_generator.h" />
+    <ClInclude Include="src\thrift\generate\t_generator_registry.h" />
+    <ClInclude Include="src\thrift\generate\t_oop_generator.h" />
+    <ClInclude Include="src\thrift\globals.h" />
+    <ClInclude Include="src\thrift\main.h" />
+    <ClInclude Include="src\thrift\md5.h" />
+    <ClInclude Include="src\thrift\parse\t_base_type.h" />
+    <ClInclude Include="src\thrift\parse\t_const.h" />
+    <ClInclude Include="src\thrift\parse\t_const_value.h" />
+    <ClInclude Include="src\thrift\parse\t_container.h" />
+    <ClInclude Include="src\thrift\parse\t_doc.h" />
+    <ClInclude Include="src\thrift\parse\t_enum.h" />
+    <ClInclude Include="src\thrift\parse\t_enum_value.h" />
+    <ClInclude Include="src\thrift\parse\t_field.h" />
+    <ClInclude Include="src\thrift\parse\t_function.h" />
+    <ClInclude Include="src\thrift\parse\t_list.h" />
+    <ClInclude Include="src\thrift\parse\t_map.h" />
+    <ClInclude Include="src\thrift\parse\t_program.h" />
+    <ClInclude Include="src\thrift\parse\t_scope.h" />
+    <ClInclude Include="src\thrift\parse\t_service.h" />
+    <ClInclude Include="src\thrift\parse\t_set.h" />
+    <ClInclude Include="src\thrift\parse\t_struct.h" />
+    <ClInclude Include="src\thrift\parse\t_type.h" />
+    <ClInclude Include="src\thrift\parse\t_typedef.h" />
+    <ClInclude Include="src\thrift\platform.h" />
+    <ClInclude Include="src\thrift\thrifty.h" />
+    <ClInclude Include="src\thrift\windows\config.h" />
+    <ClInclude Include="src\thrift\windows\version.h" />
   </ItemGroup>
   <ItemGroup>
-    <ClCompile Include="src\generate\t_as3_generator.cc" />
-    <ClCompile Include="src\generate\t_cocoa_generator.cc" />
-    <ClCompile Include="src\generate\t_cpp_generator.cc" />
-    <ClCompile Include="src\generate\t_csharp_generator.cc" />
-    <ClCompile Include="src\generate\t_c_glib_generator.cc" />
-    <ClCompile Include="src\generate\t_erl_generator.cc" />
-    <ClCompile Include="src\generate\t_generator.cc" />
-    <ClCompile Include="src\generate\t_go_generator.cc" />
-    <ClCompile Include="src\generate\t_hs_generator.cc" />
-    <ClCompile Include="src\generate\t_html_generator.cc" />
-    <ClCompile Include="src\generate\t_javame_generator.cc" />
-    <ClCompile Include="src\generate\t_java_generator.cc" />
-    <ClCompile Include="src\generate\t_js_generator.cc" />
-    <ClCompile Include="src\generate\t_ocaml_generator.cc" />
-    <ClCompile Include="src\generate\t_perl_generator.cc" />
-    <ClCompile Include="src\generate\t_php_generator.cc" />
-    <ClCompile Include="src\generate\t_py_generator.cc" />
-    <ClCompile Include="src\generate\t_rb_generator.cc" />
-    <ClCompile Include="src\generate\t_st_generator.cc" />
-    <ClCompile Include="src\generate\t_xsd_generator.cc" />
-    <ClCompile Include="src\main.cc" />
-    <ClCompile Include="src\md5.c" />
-    <ClCompile Include="src\parse\parse.cc" />
-    <ClCompile Include="src\thriftl.cc" />
-    <ClCompile Include="src\thrifty.cc" />
+    <ClCompile Include="src\thrift\generate\t_as3_generator.cc" />
+    <ClCompile Include="src\thrift\generate\t_cocoa_generator.cc" />
+    <ClCompile Include="src\thrift\generate\t_cpp_generator.cc" />
+    <ClCompile Include="src\thrift\generate\t_csharp_generator.cc" />
+    <ClCompile Include="src\thrift\generate\t_c_glib_generator.cc" />
+    <ClCompile Include="src\thrift\generate\t_erl_generator.cc" />
+    <ClCompile Include="src\thrift\generate\t_generator.cc" />
+    <ClCompile Include="src\thrift\generate\t_go_generator.cc" />
+    <ClCompile Include="src\thrift\generate\t_hs_generator.cc" />
+    <ClCompile Include="src\thrift\generate\t_html_generator.cc" />
+    <ClCompile Include="src\thrift\generate\t_javame_generator.cc" />
+    <ClCompile Include="src\thrift\generate\t_java_generator.cc" />
+    <ClCompile Include="src\thrift\generate\t_js_generator.cc" />
+    <ClCompile Include="src\thrift\generate\t_ocaml_generator.cc" />
+    <ClCompile Include="src\thrift\generate\t_perl_generator.cc" />
+    <ClCompile Include="src\thrift\generate\t_php_generator.cc" />
+    <ClCompile Include="src\thrift\generate\t_py_generator.cc" />
+    <ClCompile Include="src\thrift\generate\t_rb_generator.cc" />
+    <ClCompile Include="src\thrift\generate\t_st_generator.cc" />
+    <ClCompile Include="src\thrift\generate\t_xsd_generator.cc" />
+    <ClCompile Include="src\thrift\main.cc" />
+    <ClCompile Include="src\thrift\md5.c" />
+    <ClCompile Include="src\thrift\parse\parse.cc" />
+    <ClCompile Include="src\thrift\thriftl.cc" />
+    <ClCompile Include="src\thrift\thrifty.cc" />
   </ItemGroup>
   <ItemGroup>
     <None Include="README_WINDOWS" />
-    <None Include="src\thriftl.ll" />
-    <None Include="src\thrifty.yy" />
+    <None Include="src\thrift\thriftl.ll" />
+    <None Include="src\thrift\thrifty.yy" />
   </ItemGroup>
   <PropertyGroup Label="Globals">
     <ProjectGuid>{89975A1A-F799-4556-98B8-64E30AB39A90}</ProjectGuid>
@@ -126,25 +126,25 @@
   <PropertyGroup Label="UserMacros" />
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
     <LinkIncremental>true</LinkIncremental>
-    <IncludePath>$(ProjectDir)\src\;$(ProjectDir)\src\windows\;$(IncludePath)</IncludePath>
+    <IncludePath>$(ProjectDir)\src\thrift\;$(ProjectDir)\src\windows\;$(IncludePath)</IncludePath>
     <TargetName>thrift</TargetName>
     <ExecutablePath>$(ExecutablePath);C:\Program Files (x86)\Git\bin</ExecutablePath>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
     <LinkIncremental>true</LinkIncremental>
-    <IncludePath>$(ProjectDir)\src\;$(ProjectDir)\src\windows\;$(IncludePath)</IncludePath>
+    <IncludePath>$(ProjectDir)\src\thrift\;$(ProjectDir)\src\windows\;$(IncludePath)</IncludePath>
     <TargetName>thrift</TargetName>
     <ExecutablePath>$(ExecutablePath);C:\Program Files (x86)\Git\bin</ExecutablePath>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
     <LinkIncremental>false</LinkIncremental>
-    <IncludePath>$(ProjectDir)\src\;$(ProjectDir)\src\windows\;$(IncludePath)</IncludePath>
+    <IncludePath>$(ProjectDir)\src\thrift\;$(ProjectDir)\src\windows\;$(IncludePath)</IncludePath>
     <TargetName>thrift</TargetName>
     <ExecutablePath>$(ExecutablePath);C:\Program Files (x86)\Git\bin</ExecutablePath>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
     <LinkIncremental>false</LinkIncremental>
-    <IncludePath>$(ProjectDir)\src\;$(ProjectDir)\src\windows\;$(IncludePath)</IncludePath>
+    <IncludePath>$(ProjectDir)\src\thrift\;$(ProjectDir)\src\windows\;$(IncludePath)</IncludePath>
     <TargetName>thrift</TargetName>
     <ExecutablePath>$(ExecutablePath);C:\Program Files (x86)\Git\bin</ExecutablePath>
   </PropertyGroup>
@@ -163,8 +163,8 @@
       <GenerateDebugInformation>true</GenerateDebugInformation>
     </Link>
     <PreBuildEvent>
-      <Command>flex -o "src/thriftl.cc" src/thriftl.ll
-bison -y -o "src/thrifty.cc" --defines="src/thrifty.h" src/thrifty.yy</Command>
+      <Command>flex -o "src\thrift\thriftl.cc" src/thriftl.ll
+bison -y -o "src\thrift\thrifty.cc" --defines="src/thrifty.h" src/thrifty.yy</Command>
     </PreBuildEvent>
   </ItemDefinitionGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
@@ -182,8 +182,8 @@
       <GenerateDebugInformation>true</GenerateDebugInformation>
     </Link>
     <PreBuildEvent>
-      <Command>flex -o "src/thriftl.cc" src/thriftl.ll
-bison -y -o "src/thrifty.cc" --defines="src/thrifty.h" src/thrifty.yy</Command>
+      <Command>flex -o "src\thrift\thriftl.cc" src/thriftl.ll
+bison -y -o "src\thrift\thrifty.cc" --defines="src/thrifty.h" src/thrifty.yy</Command>
     </PreBuildEvent>
   </ItemDefinitionGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
@@ -205,8 +205,8 @@
       <OptimizeReferences>true</OptimizeReferences>
     </Link>
     <PreBuildEvent>
-      <Command>flex -o "src/thriftl.cc" src/thriftl.ll
-bison -y -o "src/thrifty.cc" --defines="src/thrifty.h" src/thrifty.yy</Command>
+      <Command>flex -o "src\thrift\thriftl.cc" src/thriftl.ll
+bison -y -o "src\thrift\thrifty.cc" --defines="src/thrifty.h" src/thrifty.yy</Command>
     </PreBuildEvent>
   </ItemDefinitionGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
@@ -228,8 +228,8 @@
       <OptimizeReferences>true</OptimizeReferences>
     </Link>
     <PreBuildEvent>
-      <Command>flex -o "src/thriftl.cc" src/thriftl.ll
-bison -y -o "src/thrifty.cc" --defines="src/thrifty.h" src/thrifty.yy</Command>
+      <Command>flex -o "src\thrift\thriftl.cc" src/thriftl.ll
+bison -y -o "src\thrift\thrifty.cc" --defines="src/thrifty.h" src/thrifty.yy</Command>
     </PreBuildEvent>
   </ItemDefinitionGroup>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
diff --git a/compiler/cpp/src/generate/t_c_glib_generator.cc b/compiler/cpp/src/generate/t_c_glib_generator.cc
index d1fc702..d22b723 100644
--- a/compiler/cpp/src/generate/t_c_glib_generator.cc
+++ b/compiler/cpp/src/generate/t_c_glib_generator.cc
@@ -186,7 +186,7 @@
     "/* base includes */" << endl <<
     "#include <glib-object.h>" << endl <<
     "#include <thrift_struct.h>" << endl <<
-    "#include <protocol/thrift_protocol.h>" << endl;
+    "#include <thrift/protocol/thrift_protocol.h>" << endl;
 
   /* include other thrift includes */
   const vector<t_program *> &includes = program_->get_includes();
@@ -217,7 +217,7 @@
     endl <<
     "#include \"" << this->nspace_lc << program_name_u << 
         "_types.h\"" << endl <<
-    "#include <thrift.h>" << endl <<
+    "#include <thrift/thrift.h>" << endl <<
     endl;
 
   f_types_ <<
@@ -410,7 +410,7 @@
   // include the headers
   f_service_ <<
     "#include <string.h>" << endl <<
-    "#include <thrift.h>" << endl <<
+    "#include <thrift/thrift.h>" << endl <<
     "#include <thrift_application_exception.h>" << endl <<
     "#include \"" << filename << ".h\"" << endl <<
     endl;
diff --git a/compiler/cpp/src/generate/t_cpp_generator.cc b/compiler/cpp/src/generate/t_cpp_generator.cc
index 6b3f4b6..3bc6a81 100755
--- a/compiler/cpp/src/generate/t_cpp_generator.cc
+++ b/compiler/cpp/src/generate/t_cpp_generator.cc
@@ -343,10 +343,10 @@
 
   // Include base types
   f_types_ <<
-    "#include <Thrift.h>" << endl <<
-    "#include <TApplicationException.h>" << endl <<
-    "#include <protocol/TProtocol.h>" << endl <<
-    "#include <transport/TTransport.h>" << endl <<
+    "#include <thrift/Thrift.h>" << endl <<
+    "#include <thrift/TApplicationException.h>" << endl <<
+    "#include <thrift/protocol/TProtocol.h>" << endl <<
+    "#include <thrift/transport/TTransport.h>" << endl <<
     endl;
 
   // Include other Thrift includes
@@ -392,7 +392,7 @@
   // the definition of TypeSpec.
   if (gen_dense_) {
     f_types_impl_ <<
-      "#include <TReflectionLocal.h>" << endl <<
+      "#include <thrift/TReflectionLocal.h>" << endl <<
       endl;
   }
 
@@ -1571,17 +1571,17 @@
     endl;
   if (gen_cob_style_) {
     f_header_ <<
-      "#include <transport/TBufferTransports.h>" << endl << // TMemoryBuffer
+      "#include <thrift/transport/TBufferTransports.h>" << endl << // TMemoryBuffer
       "#include <tr1/functional>" << endl <<
       "namespace apache { namespace thrift { namespace async {" << endl <<
       "class TAsyncChannel;" << endl <<
       "}}}" << endl;
   }
   f_header_ <<
-    "#include <TDispatchProcessor.h>" << endl;
+    "#include <thrift/TDispatchProcessor.h>" << endl;
   if (gen_cob_style_) {
     f_header_ <<
-      "#include <async/TAsyncDispatchProcessor.h>" << endl;
+      "#include <thrift/async/TAsyncDispatchProcessor.h>" << endl;
   }
   f_header_ <<
     "#include \"" << get_include_prefix(*get_program()) << program_name_ <<
@@ -1608,7 +1608,7 @@
     "#include \"" << get_include_prefix(*get_program()) << svcname << ".h\"" << endl;
   if (gen_cob_style_) {
     f_service_ <<
-      "#include \"async/TAsyncChannel.h\"" << endl;
+      "#include \"thrift/async/TAsyncChannel.h\"" << endl;
   }
   if (gen_templates_) {
     f_service_ <<
@@ -1630,7 +1630,7 @@
 
     if (gen_cob_style_) {
       f_service_tcc_ <<
-        "#include \"async/TAsyncChannel.h\"" << endl;
+        "#include \"thrift/async/TAsyncChannel.h\"" << endl;
     }
   }
 
@@ -1974,8 +1974,8 @@
     "// that would otherwise introduce unwanted latency." << endl <<
     endl <<
     "#include \"" << get_include_prefix(*get_program()) << svcname << ".h\"" << endl <<
-    "#include <protocol/TBinaryProtocol.h>" << endl <<
-    "#include <async/TEventServer.h>" << endl <<
+    "#include <thrift/protocol/TBinaryProtocol.h>" << endl <<
+    "#include <thrift/async/TEventServer.h>" << endl <<
     endl <<
     "using namespace ::apache::thrift;" << endl <<
     "using namespace ::apache::thrift::protocol;" << endl <<
@@ -3703,10 +3703,10 @@
     "// You should copy it to another filename to avoid overwriting it." << endl <<
     endl <<
     "#include \"" << get_include_prefix(*get_program()) << svcname << ".h\"" << endl <<
-    "#include <protocol/TBinaryProtocol.h>" << endl <<
-    "#include <server/TSimpleServer.h>" << endl <<
-    "#include <transport/TServerSocket.h>" << endl <<
-    "#include <transport/TBufferTransports.h>" << endl <<
+    "#include <thrift/protocol/TBinaryProtocol.h>" << endl <<
+    "#include <thrift/server/TSimpleServer.h>" << endl <<
+    "#include <thrift/transport/TServerSocket.h>" << endl <<
+    "#include <thrift/transport/TBufferTransports.h>" << endl <<
     endl <<
     "using namespace ::apache::thrift;" << endl <<
     "using namespace ::apache::thrift::protocol;" << endl <<
diff --git a/contrib/async-test/test-server.cpp b/contrib/async-test/test-server.cpp
index a55c348..b304e1b 100644
--- a/contrib/async-test/test-server.cpp
+++ b/contrib/async-test/test-server.cpp
@@ -1,8 +1,8 @@
 #include <tr1/functional>
-#include "protocol/TBinaryProtocol.h"
-#include "async/TAsyncProtocolProcessor.h"
-#include "async/TEvhttpServer.h"
-#include "async/TEvhttpClientChannel.h"
+#include <thrift/protocol/TBinaryProtocol.h>
+#include <thrift/async/TAsyncProtocolProcessor.h>
+#include <thrift/async/TEvhttpServer.h>
+#include <thrift/async/TEvhttpClientChannel.h>
 #include "Aggr.h"
 
 using std::tr1::bind;
diff --git a/contrib/fb303/TClientInfo.cpp b/contrib/fb303/TClientInfo.cpp
index e07eaa8..5959fb1 100644
--- a/contrib/fb303/TClientInfo.cpp
+++ b/contrib/fb303/TClientInfo.cpp
@@ -17,7 +17,7 @@
  * under the License.
  */
 
-#include <server/TClientInfo.h>
+#include <thrift/server/TClientInfo.h>
 
 namespace apache { namespace thrift { namespace server {
 
diff --git a/contrib/fb303/TClientInfo.h b/contrib/fb303/TClientInfo.h
index 9b2d284..d0a9770 100644
--- a/contrib/fb303/TClientInfo.h
+++ b/contrib/fb303/TClientInfo.h
@@ -22,9 +22,9 @@
 
 // for inet_ntop --
 #include <arpa/inet.h>
-#include <server/TServer.h>
-#include <transport/TSocket.h>
-#include <concurrency/Mutex.h>
+#include <thrift/server/TServer.h>
+#include <thrift/transport/TSocket.h>
+#include <thrift/concurrency/Mutex.h>
 
 namespace apache { namespace thrift { namespace server {
 
diff --git a/contrib/fb303/cpp/FacebookBase.h b/contrib/fb303/cpp/FacebookBase.h
index fd169e6..2159c95 100644
--- a/contrib/fb303/cpp/FacebookBase.h
+++ b/contrib/fb303/cpp/FacebookBase.h
@@ -22,8 +22,8 @@
 
 #include "FacebookService.h"
 
-#include "server/TServer.h"
-#include "concurrency/Mutex.h"
+#include <thrift/server/TServer.h>
+#include <thrift/concurrency/Mutex.h>
 
 #include <time.h>
 #include <string>
diff --git a/contrib/fb303/cpp/ServiceTracker.cpp b/contrib/fb303/cpp/ServiceTracker.cpp
index c20a068..2914ff6 100644
--- a/contrib/fb303/cpp/ServiceTracker.cpp
+++ b/contrib/fb303/cpp/ServiceTracker.cpp
@@ -21,7 +21,7 @@
 
 #include "FacebookBase.h"
 #include "ServiceTracker.h"
-#include "concurrency/ThreadManager.h"
+#include <thrift/concurrency/ThreadManager.h>
 
 using namespace std;
 using namespace facebook::fb303;
diff --git a/contrib/fb303/cpp/ServiceTracker.h b/contrib/fb303/cpp/ServiceTracker.h
index 9304386..9a3edd8 100644
--- a/contrib/fb303/cpp/ServiceTracker.h
+++ b/contrib/fb303/cpp/ServiceTracker.h
@@ -100,7 +100,7 @@
 #include <map>
 #include <boost/shared_ptr.hpp>
 
-#include "concurrency/Mutex.h"
+#include <thrift/concurrency/Mutex.h>
 
 
 namespace apache { namespace thrift { namespace concurrency {
diff --git a/contrib/thrift_dump.cpp b/contrib/thrift_dump.cpp
index 0ddfcec..59c8ac8 100644
--- a/contrib/thrift_dump.cpp
+++ b/contrib/thrift_dump.cpp
@@ -20,11 +20,11 @@
 #include <cstdlib>
 #include <iostream>
 
-#include <transport/TBufferTransports.h>
-#include <transport/TFDTransport.h>
-#include <protocol/TBinaryProtocol.h>
-#include <protocol/TDebugProtocol.h>
-#include <protocol/TProtocolTap.h>
+#include <thrift/transport/TBufferTransports.h>
+#include <thrift/transport/TFDTransport.h>
+#include <thrift/protocol/TBinaryProtocol.h>
+#include <thrift/protocol/TDebugProtocol.h>
+#include <thrift/protocol/TProtocolTap.h>
 
 using namespace std;
 using boost::shared_ptr;
diff --git a/contrib/zeromq/TZmqClient.h b/contrib/zeromq/TZmqClient.h
index 9544503..9fcfc06 100644
--- a/contrib/zeromq/TZmqClient.h
+++ b/contrib/zeromq/TZmqClient.h
@@ -21,7 +21,7 @@
 #define _THRIFT_TRANSPORT_TZMQCLIENT_H_ 1
 
 #include <zmq.hpp>
-#include <transport/TBufferTransports.h>
+#include <thrift/transport/TBufferTransports.h>
 
 namespace apache { namespace thrift { namespace transport {
 
diff --git a/contrib/zeromq/TZmqServer.cpp b/contrib/zeromq/TZmqServer.cpp
index c6142d7..f255a66 100644
--- a/contrib/zeromq/TZmqServer.cpp
+++ b/contrib/zeromq/TZmqServer.cpp
@@ -18,7 +18,7 @@
  */
 
 #include "TZmqServer.h"
-#include <transport/TBufferTransports.h>
+#include <thrift/transport/TBufferTransports.h>
 #include <boost/scoped_ptr.hpp>
 
 using boost::shared_ptr;
diff --git a/contrib/zeromq/TZmqServer.h b/contrib/zeromq/TZmqServer.h
index 1603eac..f91c6e8 100644
--- a/contrib/zeromq/TZmqServer.h
+++ b/contrib/zeromq/TZmqServer.h
@@ -21,7 +21,7 @@
 #define _THRIFT_SERVER_TZMQSERVER_H_ 1
 
 #include <zmq.hpp>
-#include <server/TServer.h>
+#include <thrift/server/TServer.h>
 
 namespace apache { namespace thrift { namespace server {
 
diff --git a/contrib/zeromq/test-client.cpp b/contrib/zeromq/test-client.cpp
index 64e20f6..d2fc56c 100644
--- a/contrib/zeromq/test-client.cpp
+++ b/contrib/zeromq/test-client.cpp
@@ -1,6 +1,6 @@
 #include <iostream>
 #include <cstdlib>
-#include <protocol/TBinaryProtocol.h>
+#include <thrift/protocol/TBinaryProtocol.h>
 
 #include "zmq.hpp"
 #include "TZmqClient.h"
diff --git a/contrib/zeromq/test-sender.cpp b/contrib/zeromq/test-sender.cpp
index ca05709..6b0eef1 100644
--- a/contrib/zeromq/test-sender.cpp
+++ b/contrib/zeromq/test-sender.cpp
@@ -1,6 +1,6 @@
 #include <iostream>
 #include <cstdlib>
-#include <protocol/TBinaryProtocol.h>
+#include <thrift/protocol/TBinaryProtocol.h>
 
 #include "zmq.hpp"
 #include "TZmqClient.h"
diff --git a/lib/c_glib/Makefile.am b/lib/c_glib/Makefile.am
index 2f03e3d..d89b22c 100644
--- a/lib/c_glib/Makefile.am
+++ b/lib/c_glib/Makefile.am
@@ -24,7 +24,7 @@
 lib_LTLIBRARIES = libthrift_c_glib.la
 pkgconfig_DATA = thrift_c_glib.pc
 
-common_cflags = -g -Wall -W -Werror -Isrc $(GLIB_CFLAGS)
+common_cflags = -g -Wall -W -Werror -Isrc -I src/thrift $(GLIB_CFLAGS)
 common_ldflags = -g -Wall -W $(GLIB_LDFLAGS) @GCOV_LDFLAGS@
 
 # this removes optimizations and adds coverage flags
@@ -32,56 +32,56 @@
 
 # Define the source files for the module
 
-libthrift_c_glib_la_SOURCES = src/thrift.c \
-                              src/thrift_struct.c \
-                              src/thrift_application_exception.c \
-                              src/processor/thrift_processor.c \
-                              src/protocol/thrift_protocol.c \
-                              src/protocol/thrift_protocol_factory.c \
-                              src/protocol/thrift_binary_protocol.c \
-                              src/protocol/thrift_binary_protocol_factory.c \
-                              src/transport/thrift_transport.c \
-                              src/transport/thrift_transport_factory.c \
-                              src/transport/thrift_socket.c \
-                              src/transport/thrift_server_transport.c \
-                              src/transport/thrift_server_socket.c \
-                              src/transport/thrift_buffered_transport.c \
-                              src/transport/thrift_framed_transport.c \
-                              src/transport/thrift_memory_buffer.c \
-                              src/server/thrift_server.c \
-                              src/server/thrift_simple_server.c
+libthrift_c_glib_la_SOURCES = src/thrift/thrift.c \
+                              src/thrift/thrift_struct.c \
+                              src/thrift/thrift_application_exception.c \
+                              src/thrift/processor/thrift_processor.c \
+                              src/thrift/protocol/thrift_protocol.c \
+                              src/thrift/protocol/thrift_protocol_factory.c \
+                              src/thrift/protocol/thrift_binary_protocol.c \
+                              src/thrift/protocol/thrift_binary_protocol_factory.c \
+                              src/thrift/transport/thrift_transport.c \
+                              src/thrift/transport/thrift_transport_factory.c \
+                              src/thrift/transport/thrift_socket.c \
+                              src/thrift/transport/thrift_server_transport.c \
+                              src/thrift/transport/thrift_server_socket.c \
+                              src/thrift/transport/thrift_buffered_transport.c \
+                              src/thrift/transport/thrift_framed_transport.c \
+                              src/thrift/transport/thrift_memory_buffer.c \
+                              src/thrift/server/thrift_server.c \
+                              src/thrift/server/thrift_simple_server.c
 
 libthrift_c_glib_la_CFLAGS = $(common_cflags)
 
 include_thriftdir = $(includedir)/thrift/c_glib
 include_thrift_HEADERS = \
                          $(top_builddir)/config.h \
-                         src/thrift.h \
-                         src/thrift_application_exception.h \
-                         src/thrift_struct.h
+                         src/thrift/thrift.h \
+                         src/thrift/thrift_application_exception.h \
+                         src/thrift/thrift_struct.h
 
 include_protocoldir = $(include_thriftdir)/protocol
-include_protocol_HEADERS = src/protocol/thrift_protocol.h \
-                           src/protocol/thrift_protocol_factory.h \
-                           src/protocol/thrift_binary_protocol.h \
-                           src/protocol/thrift_binary_protocol_factory.h
+include_protocol_HEADERS = src/thrift/protocol/thrift_protocol.h \
+                           src/thrift/protocol/thrift_protocol_factory.h \
+                           src/thrift/protocol/thrift_binary_protocol.h \
+                           src/thrift/protocol/thrift_binary_protocol_factory.h
 
 include_transportdir = $(include_thriftdir)/transport
-include_transport_HEADERS = src/transport/thrift_buffered_transport.h \
-                            src/transport/thrift_framed_transport.h \
-                            src/transport/thrift_memory_buffer.h \
-                            src/transport/thrift_server_socket.h \
-                            src/transport/thrift_server_transport.h \
-                            src/transport/thrift_socket.h \
-                            src/transport/thrift_transport.h \
-                            src/transport/thrift_transport_factory.h
+include_transport_HEADERS = src/thrift/transport/thrift_buffered_transport.h \
+                            src/thrift/transport/thrift_framed_transport.h \
+                            src/thrift/transport/thrift_memory_buffer.h \
+                            src/thrift/transport/thrift_server_socket.h \
+                            src/thrift/transport/thrift_server_transport.h \
+                            src/thrift/transport/thrift_socket.h \
+                            src/thrift/transport/thrift_transport.h \
+                            src/thrift/transport/thrift_transport_factory.h
 
 include_serverdir = $(include_thriftdir)/server
-include_server_HEADERS = src/server/thrift_server.h \
-                         src/server/thrift_simple_server.h
+include_server_HEADERS = src/thrift/server/thrift_server.h \
+                         src/thrift/server/thrift_simple_server.h
 
 include_processordir = $(include_thriftdir)/processor
-include_processor_HEADERS = src/processor/thrift_processor.h
+include_processor_HEADERS = src/thrift/processor/thrift_processor.h
 
 
 EXTRA_DIST = \
diff --git a/lib/c_glib/src/processor/thrift_processor.c b/lib/c_glib/src/thrift/processor/thrift_processor.c
similarity index 94%
rename from lib/c_glib/src/processor/thrift_processor.c
rename to lib/c_glib/src/thrift/processor/thrift_processor.c
index 6e9f454..a993a62 100644
--- a/lib/c_glib/src/processor/thrift_processor.c
+++ b/lib/c_glib/src/thrift/processor/thrift_processor.c
@@ -17,8 +17,8 @@
  * under the License.
  */
 
-#include "thrift.h"
-#include "processor/thrift_processor.h"
+#include <thrift/thrift.h>
+#include <thrift/processor/thrift_processor.h>
 
 G_DEFINE_ABSTRACT_TYPE(ThriftProcessor, thrift_processor, G_TYPE_OBJECT)
 
diff --git a/lib/c_glib/src/processor/thrift_processor.h b/lib/c_glib/src/thrift/processor/thrift_processor.h
similarity index 97%
rename from lib/c_glib/src/processor/thrift_processor.h
rename to lib/c_glib/src/thrift/processor/thrift_processor.h
index 390e31b..90af7e9 100644
--- a/lib/c_glib/src/processor/thrift_processor.h
+++ b/lib/c_glib/src/thrift/processor/thrift_processor.h
@@ -22,7 +22,7 @@
 
 #include <glib-object.h>
 
-#include "protocol/thrift_protocol.h"
+#include <thrift/protocol/thrift_protocol.h>
 
 G_BEGIN_DECLS
 
diff --git a/lib/c_glib/src/protocol/thrift_binary_protocol.c b/lib/c_glib/src/thrift/protocol/thrift_binary_protocol.c
similarity index 99%
rename from lib/c_glib/src/protocol/thrift_binary_protocol.c
rename to lib/c_glib/src/thrift/protocol/thrift_binary_protocol.c
index 7ee28e8..4e3ee1e 100644
--- a/lib/c_glib/src/protocol/thrift_binary_protocol.c
+++ b/lib/c_glib/src/thrift/protocol/thrift_binary_protocol.c
@@ -20,9 +20,9 @@
 #include <string.h>
 #include <stdio.h>
 
-#include "thrift.h"
-#include "protocol/thrift_protocol.h"
-#include "protocol/thrift_binary_protocol.h"
+#include <thrift/thrift.h>
+#include <thrift/protocol/thrift_protocol.h>
+#include <thrift/protocol/thrift_binary_protocol.h>
 
 G_DEFINE_TYPE(ThriftBinaryProtocol, thrift_binary_protocol, THRIFT_TYPE_PROTOCOL)
 
diff --git a/lib/c_glib/src/protocol/thrift_binary_protocol.h b/lib/c_glib/src/thrift/protocol/thrift_binary_protocol.h
similarity index 96%
rename from lib/c_glib/src/protocol/thrift_binary_protocol.h
rename to lib/c_glib/src/thrift/protocol/thrift_binary_protocol.h
index 95dced9..782d469 100644
--- a/lib/c_glib/src/protocol/thrift_binary_protocol.h
+++ b/lib/c_glib/src/thrift/protocol/thrift_binary_protocol.h
@@ -22,8 +22,8 @@
 
 #include <glib-object.h>
 
-#include "protocol/thrift_protocol.h"
-#include "transport/thrift_transport.h"
+#include <thrift/protocol/thrift_protocol.h>
+#include <thrift/transport/thrift_transport.h>
 
 G_BEGIN_DECLS
 
diff --git a/lib/c_glib/src/protocol/thrift_binary_protocol_factory.c b/lib/c_glib/src/thrift/protocol/thrift_binary_protocol_factory.c
similarity index 92%
rename from lib/c_glib/src/protocol/thrift_binary_protocol_factory.c
rename to lib/c_glib/src/thrift/protocol/thrift_binary_protocol_factory.c
index 3c9f522..1e36b37 100644
--- a/lib/c_glib/src/protocol/thrift_binary_protocol_factory.c
+++ b/lib/c_glib/src/thrift/protocol/thrift_binary_protocol_factory.c
@@ -17,9 +17,9 @@
  * under the License.
  */
 
-#include "thrift.h"
-#include "protocol/thrift_binary_protocol.h"
-#include "protocol/thrift_binary_protocol_factory.h"
+#include <thrift/thrift.h>
+#include <thrift/protocol/thrift_binary_protocol.h>
+#include <thrift/protocol/thrift_binary_protocol_factory.h>
 
 G_DEFINE_TYPE(ThriftBinaryProtocolFactory, thrift_binary_protocol_factory, THRIFT_TYPE_PROTOCOL_FACTORY)
 
diff --git a/lib/c_glib/src/protocol/thrift_binary_protocol_factory.h b/lib/c_glib/src/thrift/protocol/thrift_binary_protocol_factory.h
similarity index 97%
rename from lib/c_glib/src/protocol/thrift_binary_protocol_factory.h
rename to lib/c_glib/src/thrift/protocol/thrift_binary_protocol_factory.h
index 3b7fcc2..48e48f9 100644
--- a/lib/c_glib/src/protocol/thrift_binary_protocol_factory.h
+++ b/lib/c_glib/src/thrift/protocol/thrift_binary_protocol_factory.h
@@ -22,7 +22,7 @@
 
 #include <glib-object.h>
 
-#include "protocol/thrift_protocol_factory.h"
+#include <thrift/protocol/thrift_protocol_factory.h>
 
 G_BEGIN_DECLS
 
diff --git a/lib/c_glib/src/protocol/thrift_protocol.c b/lib/c_glib/src/thrift/protocol/thrift_protocol.c
similarity index 99%
rename from lib/c_glib/src/protocol/thrift_protocol.c
rename to lib/c_glib/src/thrift/protocol/thrift_protocol.c
index d951031..a322fef 100644
--- a/lib/c_glib/src/protocol/thrift_protocol.c
+++ b/lib/c_glib/src/thrift/protocol/thrift_protocol.c
@@ -17,9 +17,9 @@
  * under the License.
  */
 
-#include "thrift.h"
-#include "protocol/thrift_protocol.h"
-#include "transport/thrift_transport.h"
+#include <thrift/thrift.h>
+#include <thrift/protocol/thrift_protocol.h>
+#include <thrift/transport/thrift_transport.h>
 
 /* define the GError domain string */
 #define THRIFT_PROTOCOL_ERROR_DOMAIN "thrift-protocol-error-quark"
diff --git a/lib/c_glib/src/protocol/thrift_protocol.h b/lib/c_glib/src/thrift/protocol/thrift_protocol.h
similarity index 99%
rename from lib/c_glib/src/protocol/thrift_protocol.h
rename to lib/c_glib/src/thrift/protocol/thrift_protocol.h
index 1aeaed9..5dd562d 100644
--- a/lib/c_glib/src/protocol/thrift_protocol.h
+++ b/lib/c_glib/src/thrift/protocol/thrift_protocol.h
@@ -22,7 +22,7 @@
 
 #include <glib-object.h>
 
-#include "transport/thrift_transport.h"
+#include <thrift/transport/thrift_transport.h>
 
 G_BEGIN_DECLS
 
diff --git a/lib/c_glib/src/protocol/thrift_protocol_factory.c b/lib/c_glib/src/thrift/protocol/thrift_protocol_factory.c
similarity index 94%
rename from lib/c_glib/src/protocol/thrift_protocol_factory.c
rename to lib/c_glib/src/thrift/protocol/thrift_protocol_factory.c
index 073b33c..e4c7c12 100644
--- a/lib/c_glib/src/protocol/thrift_protocol_factory.c
+++ b/lib/c_glib/src/thrift/protocol/thrift_protocol_factory.c
@@ -17,8 +17,8 @@
  * under the License.
  */
 
-#include "thrift.h"
-#include "protocol/thrift_protocol_factory.h"
+#include <thrift/thrift.h>
+#include <thrift/protocol/thrift_protocol_factory.h>
 
 G_DEFINE_ABSTRACT_TYPE(ThriftProtocolFactory, thrift_protocol_factory, G_TYPE_OBJECT)
 
diff --git a/lib/c_glib/src/protocol/thrift_protocol_factory.h b/lib/c_glib/src/thrift/protocol/thrift_protocol_factory.h
similarity index 96%
rename from lib/c_glib/src/protocol/thrift_protocol_factory.h
rename to lib/c_glib/src/thrift/protocol/thrift_protocol_factory.h
index b9aeb1b..5975e31 100644
--- a/lib/c_glib/src/protocol/thrift_protocol_factory.h
+++ b/lib/c_glib/src/thrift/protocol/thrift_protocol_factory.h
@@ -22,8 +22,8 @@
 
 #include <glib-object.h>
 
-#include "transport/thrift_transport.h"
-#include "protocol/thrift_protocol.h"
+#include <thrift/transport/thrift_transport.h>
+#include <thrift/protocol/thrift_protocol.h>
 
 G_BEGIN_DECLS
 
diff --git a/lib/c_glib/src/server/thrift_server.c b/lib/c_glib/src/thrift/server/thrift_server.c
similarity index 99%
rename from lib/c_glib/src/server/thrift_server.c
rename to lib/c_glib/src/thrift/server/thrift_server.c
index 6199576..cef5a01 100644
--- a/lib/c_glib/src/server/thrift_server.c
+++ b/lib/c_glib/src/thrift/server/thrift_server.c
@@ -17,7 +17,7 @@
  * under the License.
  */
 
-#include "thrift.h"
+#include <thrift/thrift.h>
 #include "thrift_server.h"
 
 /* object properties */
diff --git a/lib/c_glib/src/server/thrift_server.h b/lib/c_glib/src/thrift/server/thrift_server.h
similarity index 92%
rename from lib/c_glib/src/server/thrift_server.h
rename to lib/c_glib/src/thrift/server/thrift_server.h
index b1113f8..a091a20 100644
--- a/lib/c_glib/src/server/thrift_server.h
+++ b/lib/c_glib/src/thrift/server/thrift_server.h
@@ -22,10 +22,10 @@
 
 #include <glib-object.h>
 
-#include "processor/thrift_processor.h"
-#include "transport/thrift_server_transport.h"
-#include "transport/thrift_transport_factory.h"
-#include "protocol/thrift_protocol_factory.h"
+#include <thrift/processor/thrift_processor.h>
+#include <thrift/transport/thrift_server_transport.h>
+#include <thrift/transport/thrift_transport_factory.h>
+#include <thrift/protocol/thrift_protocol_factory.h>
 
 G_BEGIN_DECLS
 
diff --git a/lib/c_glib/src/server/thrift_simple_server.c b/lib/c_glib/src/thrift/server/thrift_simple_server.c
similarity index 94%
rename from lib/c_glib/src/server/thrift_simple_server.c
rename to lib/c_glib/src/thrift/server/thrift_simple_server.c
index fe3067a..c39a58d 100644
--- a/lib/c_glib/src/server/thrift_simple_server.c
+++ b/lib/c_glib/src/thrift/server/thrift_simple_server.c
@@ -17,10 +17,10 @@
  * under the License.
  */
 
-#include "server/thrift_simple_server.h"
-#include "transport/thrift_transport_factory.h"
-#include "protocol/thrift_protocol_factory.h"
-#include "protocol/thrift_binary_protocol_factory.h"
+#include <thrift/server/thrift_simple_server.h>
+#include <thrift/transport/thrift_transport_factory.h>
+#include <thrift/protocol/thrift_protocol_factory.h>
+#include <thrift/protocol/thrift_binary_protocol_factory.h>
 
 G_DEFINE_TYPE(ThriftSimpleServer, thrift_simple_server, THRIFT_TYPE_SERVER)
 
diff --git a/lib/c_glib/src/server/thrift_simple_server.h b/lib/c_glib/src/thrift/server/thrift_simple_server.h
similarity index 97%
rename from lib/c_glib/src/server/thrift_simple_server.h
rename to lib/c_glib/src/thrift/server/thrift_simple_server.h
index 235500c..3547982 100644
--- a/lib/c_glib/src/server/thrift_simple_server.h
+++ b/lib/c_glib/src/thrift/server/thrift_simple_server.h
@@ -22,7 +22,7 @@
 
 #include <glib-object.h>
 
-#include "server/thrift_server.h"
+#include <thrift/server/thrift_server.h>
 
 G_BEGIN_DECLS
 
diff --git a/lib/c_glib/src/thrift.c b/lib/c_glib/src/thrift/thrift.c
similarity index 97%
rename from lib/c_glib/src/thrift.c
rename to lib/c_glib/src/thrift/thrift.c
index 886e5c3..34cadd4 100644
--- a/lib/c_glib/src/thrift.c
+++ b/lib/c_glib/src/thrift/thrift.c
@@ -17,7 +17,7 @@
  * under the License.
  */
 
-#include "thrift.h"
+#include <thrift/thrift.h>
 
 /**
  * GHashTable callback to add keys to a GList.
diff --git a/lib/c_glib/src/thrift.h b/lib/c_glib/src/thrift/thrift.h
similarity index 100%
rename from lib/c_glib/src/thrift.h
rename to lib/c_glib/src/thrift/thrift.h
diff --git a/lib/c_glib/src/thrift_application_exception.c b/lib/c_glib/src/thrift/thrift_application_exception.c
similarity index 98%
rename from lib/c_glib/src/thrift_application_exception.c
rename to lib/c_glib/src/thrift/thrift_application_exception.c
index f1bee3c..c10a95e 100644
--- a/lib/c_glib/src/thrift_application_exception.c
+++ b/lib/c_glib/src/thrift/thrift_application_exception.c
@@ -18,7 +18,7 @@
  */
 
 #include "thrift_application_exception.h"
-#include "protocol/thrift_protocol.h"
+#include <thrift/protocol/thrift_protocol.h>
 
 G_DEFINE_TYPE(ThriftApplicationException, thrift_application_exception, THRIFT_TYPE_STRUCT)
 
diff --git a/lib/c_glib/src/thrift_application_exception.h b/lib/c_glib/src/thrift/thrift_application_exception.h
similarity index 100%
rename from lib/c_glib/src/thrift_application_exception.h
rename to lib/c_glib/src/thrift/thrift_application_exception.h
diff --git a/lib/c_glib/src/thrift_struct.c b/lib/c_glib/src/thrift/thrift_struct.c
similarity index 98%
rename from lib/c_glib/src/thrift_struct.c
rename to lib/c_glib/src/thrift/thrift_struct.c
index 8a0928a..233d622 100644
--- a/lib/c_glib/src/thrift_struct.c
+++ b/lib/c_glib/src/thrift/thrift_struct.c
@@ -17,7 +17,7 @@
  * under the License.
  */
 
-#include "thrift.h"
+#include <thrift/thrift.h>
 #include "thrift_struct.h"
 
 G_DEFINE_ABSTRACT_TYPE(ThriftStruct, thrift_struct, G_TYPE_OBJECT)
diff --git a/lib/c_glib/src/thrift_struct.h b/lib/c_glib/src/thrift/thrift_struct.h
similarity index 97%
rename from lib/c_glib/src/thrift_struct.h
rename to lib/c_glib/src/thrift/thrift_struct.h
index edf9984..7542c05 100644
--- a/lib/c_glib/src/thrift_struct.h
+++ b/lib/c_glib/src/thrift/thrift_struct.h
@@ -22,7 +22,7 @@
 
 #include <glib-object.h>
 
-#include "protocol/thrift_protocol.h"
+#include <thrift/protocol/thrift_protocol.h>
 
 G_BEGIN_DECLS
 
diff --git a/lib/c_glib/src/transport/thrift_buffered_transport.c b/lib/c_glib/src/thrift/transport/thrift_buffered_transport.c
similarity index 98%
rename from lib/c_glib/src/transport/thrift_buffered_transport.c
rename to lib/c_glib/src/thrift/transport/thrift_buffered_transport.c
index 53c14b1..a3d7c21 100644
--- a/lib/c_glib/src/transport/thrift_buffered_transport.c
+++ b/lib/c_glib/src/thrift/transport/thrift_buffered_transport.c
@@ -24,9 +24,9 @@
 #include <string.h>
 #include <unistd.h>
 
-#include "thrift.h"
-#include "transport/thrift_transport.h"
-#include "transport/thrift_buffered_transport.h"
+#include <thrift/thrift.h>
+#include <thrift/transport/thrift_transport.h>
+#include <thrift/transport/thrift_buffered_transport.h>
 
 /* object properties */
 enum _ThriftBufferedTransportProperties
diff --git a/lib/c_glib/src/transport/thrift_buffered_transport.h b/lib/c_glib/src/thrift/transport/thrift_buffered_transport.h
similarity index 97%
rename from lib/c_glib/src/transport/thrift_buffered_transport.h
rename to lib/c_glib/src/thrift/transport/thrift_buffered_transport.h
index aaa5183..5082cea 100644
--- a/lib/c_glib/src/transport/thrift_buffered_transport.h
+++ b/lib/c_glib/src/thrift/transport/thrift_buffered_transport.h
@@ -23,7 +23,7 @@
 #include <glib.h>
 #include <glib-object.h>
 
-#include "transport/thrift_transport.h"
+#include <thrift/transport/thrift_transport.h>
 
 G_BEGIN_DECLS
 
diff --git a/lib/c_glib/src/transport/thrift_framed_transport.c b/lib/c_glib/src/thrift/transport/thrift_framed_transport.c
similarity index 98%
rename from lib/c_glib/src/transport/thrift_framed_transport.c
rename to lib/c_glib/src/thrift/transport/thrift_framed_transport.c
index 2bed0a1..d764d48 100644
--- a/lib/c_glib/src/transport/thrift_framed_transport.c
+++ b/lib/c_glib/src/thrift/transport/thrift_framed_transport.c
@@ -24,9 +24,9 @@
 #include <string.h>
 #include <unistd.h>
 
-#include "thrift.h"
-#include "transport/thrift_transport.h"
-#include "transport/thrift_framed_transport.h"
+#include <thrift/thrift.h>
+#include <thrift/transport/thrift_transport.h>
+#include <thrift/transport/thrift_framed_transport.h>
 
 /* object properties */
 enum _ThriftFramedTransportProperties
diff --git a/lib/c_glib/src/transport/thrift_framed_transport.h b/lib/c_glib/src/thrift/transport/thrift_framed_transport.h
similarity index 97%
rename from lib/c_glib/src/transport/thrift_framed_transport.h
rename to lib/c_glib/src/thrift/transport/thrift_framed_transport.h
index 5e14e35..da2e42e 100644
--- a/lib/c_glib/src/transport/thrift_framed_transport.h
+++ b/lib/c_glib/src/thrift/transport/thrift_framed_transport.h
@@ -23,7 +23,7 @@
 #include <glib.h>
 #include <glib-object.h>
 
-#include "transport/thrift_transport.h"
+#include <thrift/transport/thrift_transport.h>
 
 G_BEGIN_DECLS
 
diff --git a/lib/c_glib/src/transport/thrift_memory_buffer.c b/lib/c_glib/src/thrift/transport/thrift_memory_buffer.c
similarity index 97%
rename from lib/c_glib/src/transport/thrift_memory_buffer.c
rename to lib/c_glib/src/thrift/transport/thrift_memory_buffer.c
index cc6717d..b32d4a5 100644
--- a/lib/c_glib/src/transport/thrift_memory_buffer.c
+++ b/lib/c_glib/src/thrift/transport/thrift_memory_buffer.c
@@ -24,9 +24,9 @@
 #include <string.h>
 #include <unistd.h>
 
-#include "thrift.h"
-#include "transport/thrift_transport.h"
-#include "transport/thrift_memory_buffer.h"
+#include <thrift/thrift.h>
+#include <thrift/transport/thrift_transport.h>
+#include <thrift/transport/thrift_memory_buffer.h>
 
 /* object properties */
 enum _ThriftMemoryBufferProperties
diff --git a/lib/c_glib/src/transport/thrift_memory_buffer.h b/lib/c_glib/src/thrift/transport/thrift_memory_buffer.h
similarity index 97%
rename from lib/c_glib/src/transport/thrift_memory_buffer.h
rename to lib/c_glib/src/thrift/transport/thrift_memory_buffer.h
index a207929..8ee697e 100644
--- a/lib/c_glib/src/transport/thrift_memory_buffer.h
+++ b/lib/c_glib/src/thrift/transport/thrift_memory_buffer.h
@@ -23,7 +23,7 @@
 #include <glib.h>
 #include <glib-object.h>
 
-#include "transport/thrift_transport.h"
+#include <thrift/transport/thrift_transport.h>
 
 G_BEGIN_DECLS
 
diff --git a/lib/c_glib/src/transport/thrift_server_socket.c b/lib/c_glib/src/thrift/transport/thrift_server_socket.c
similarity index 96%
rename from lib/c_glib/src/transport/thrift_server_socket.c
rename to lib/c_glib/src/thrift/transport/thrift_server_socket.c
index 2ebc01c..88093f2 100644
--- a/lib/c_glib/src/transport/thrift_server_socket.c
+++ b/lib/c_glib/src/thrift/transport/thrift_server_socket.c
@@ -23,11 +23,11 @@
 #include <stdlib.h>
 #include <unistd.h>
 
-#include "thrift.h"
-#include "transport/thrift_socket.h"
-#include "transport/thrift_transport.h"
-#include "transport/thrift_server_transport.h"
-#include "transport/thrift_server_socket.h"
+#include <thrift/thrift.h>
+#include <thrift/transport/thrift_socket.h>
+#include <thrift/transport/thrift_transport.h>
+#include <thrift/transport/thrift_server_transport.h>
+#include <thrift/transport/thrift_server_socket.h>
 
 /* object properties */
 enum _ThriftServerSocketProperties
diff --git a/lib/c_glib/src/transport/thrift_server_socket.h b/lib/c_glib/src/thrift/transport/thrift_server_socket.h
similarity index 100%
rename from lib/c_glib/src/transport/thrift_server_socket.h
rename to lib/c_glib/src/thrift/transport/thrift_server_socket.h
diff --git a/lib/c_glib/src/transport/thrift_server_transport.c b/lib/c_glib/src/thrift/transport/thrift_server_transport.c
similarity index 93%
rename from lib/c_glib/src/transport/thrift_server_transport.c
rename to lib/c_glib/src/thrift/transport/thrift_server_transport.c
index 87ce8e0..d0a46c3 100644
--- a/lib/c_glib/src/transport/thrift_server_transport.c
+++ b/lib/c_glib/src/thrift/transport/thrift_server_transport.c
@@ -17,9 +17,9 @@
  * under the License.
  */
 
-#include "thrift.h"
-#include "transport/thrift_transport.h"
-#include "transport/thrift_server_transport.h"
+#include <thrift/thrift.h>
+#include <thrift/transport/thrift_transport.h>
+#include <thrift/transport/thrift_server_transport.h>
 
 G_DEFINE_ABSTRACT_TYPE(ThriftServerTransport, thrift_server_transport, G_TYPE_OBJECT)
 
diff --git a/lib/c_glib/src/transport/thrift_server_transport.h b/lib/c_glib/src/thrift/transport/thrift_server_transport.h
similarity index 100%
rename from lib/c_glib/src/transport/thrift_server_transport.h
rename to lib/c_glib/src/thrift/transport/thrift_server_transport.h
diff --git a/lib/c_glib/src/transport/thrift_socket.c b/lib/c_glib/src/thrift/transport/thrift_socket.c
similarity index 98%
rename from lib/c_glib/src/transport/thrift_socket.c
rename to lib/c_glib/src/thrift/transport/thrift_socket.c
index d231bc6..c258898 100644
--- a/lib/c_glib/src/transport/thrift_socket.c
+++ b/lib/c_glib/src/thrift/transport/thrift_socket.c
@@ -23,9 +23,9 @@
 #include <string.h>
 #include <unistd.h>
 
-#include "thrift.h"
-#include "transport/thrift_transport.h"
-#include "transport/thrift_socket.h"
+#include <thrift/thrift.h>
+#include <thrift/transport/thrift_transport.h>
+#include <thrift/transport/thrift_socket.h>
 
 /* object properties */
 enum _ThriftSocketProperties
diff --git a/lib/c_glib/src/transport/thrift_socket.h b/lib/c_glib/src/thrift/transport/thrift_socket.h
similarity index 97%
rename from lib/c_glib/src/transport/thrift_socket.h
rename to lib/c_glib/src/thrift/transport/thrift_socket.h
index b3dd357..dde269c 100644
--- a/lib/c_glib/src/transport/thrift_socket.h
+++ b/lib/c_glib/src/thrift/transport/thrift_socket.h
@@ -22,7 +22,7 @@
 
 #include <glib-object.h>
 
-#include "transport/thrift_transport.h"
+#include <thrift/transport/thrift_transport.h>
 
 G_BEGIN_DECLS
 
diff --git a/lib/c_glib/src/transport/thrift_transport.c b/lib/c_glib/src/thrift/transport/thrift_transport.c
similarity index 97%
rename from lib/c_glib/src/transport/thrift_transport.c
rename to lib/c_glib/src/thrift/transport/thrift_transport.c
index a37787d..890bcad 100644
--- a/lib/c_glib/src/transport/thrift_transport.c
+++ b/lib/c_glib/src/thrift/transport/thrift_transport.c
@@ -17,8 +17,8 @@
  * under the License.
  */
 
-#include "thrift.h"
-#include "transport/thrift_transport.h"
+#include <thrift/thrift.h>
+#include <thrift/transport/thrift_transport.h>
 
 /* define the GError domain string */
 #define THRIFT_TRANSPORT_ERROR_DOMAIN "thrift-transport-error-quark"
diff --git a/lib/c_glib/src/transport/thrift_transport.h b/lib/c_glib/src/thrift/transport/thrift_transport.h
similarity index 100%
rename from lib/c_glib/src/transport/thrift_transport.h
rename to lib/c_glib/src/thrift/transport/thrift_transport.h
diff --git a/lib/c_glib/src/transport/thrift_transport_factory.c b/lib/c_glib/src/thrift/transport/thrift_transport_factory.c
similarity index 94%
rename from lib/c_glib/src/transport/thrift_transport_factory.c
rename to lib/c_glib/src/thrift/transport/thrift_transport_factory.c
index 8f9a1f2..e1125a3 100644
--- a/lib/c_glib/src/transport/thrift_transport_factory.c
+++ b/lib/c_glib/src/thrift/transport/thrift_transport_factory.c
@@ -17,8 +17,8 @@
  * under the License.
  */
 
-#include "thrift.h"
-#include "transport/thrift_transport_factory.h"
+#include <thrift/thrift.h>
+#include <thrift/transport/thrift_transport_factory.h>
 
 G_DEFINE_TYPE(ThriftTransportFactory, thrift_transport_factory, G_TYPE_OBJECT)
 
diff --git a/lib/c_glib/src/transport/thrift_transport_factory.h b/lib/c_glib/src/thrift/transport/thrift_transport_factory.h
similarity index 100%
rename from lib/c_glib/src/transport/thrift_transport_factory.h
rename to lib/c_glib/src/thrift/transport/thrift_transport_factory.h
diff --git a/lib/c_glib/test/testbinaryprotocol.c b/lib/c_glib/test/testbinaryprotocol.c
index 34846c6..7545fb9 100644
--- a/lib/c_glib/test/testbinaryprotocol.c
+++ b/lib/c_glib/test/testbinaryprotocol.c
@@ -24,9 +24,9 @@
 #include <netdb.h>
 #include <string.h>
 
-#include "protocol/thrift_protocol.h"
-#include "transport/thrift_socket.h"
-#include "transport/thrift_server_socket.h"
+#include <thrift/protocol/thrift_protocol.h>
+#include <thrift/transport/thrift_socket.h>
+#include <thrift/transport/thrift_server_socket.h>
 
 #define TEST_BOOL TRUE
 #define TEST_BYTE 123
diff --git a/lib/c_glib/test/testbufferedtransport.c b/lib/c_glib/test/testbufferedtransport.c
index fb49c8f..64dbdd1 100644
--- a/lib/c_glib/test/testbufferedtransport.c
+++ b/lib/c_glib/test/testbufferedtransport.c
@@ -20,10 +20,10 @@
 #include <assert.h>
 #include <netdb.h>
 
-#include "transport/thrift_transport.h"
-#include "transport/thrift_socket.h"
-#include "transport/thrift_server_transport.h"
-#include "transport/thrift_server_socket.h"
+#include <thrift/transport/thrift_transport.h>
+#include <thrift/transport/thrift_socket.h>
+#include <thrift/transport/thrift_server_transport.h>
+#include <thrift/transport/thrift_server_socket.h>
 
 #define TEST_DATA { 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j' }
 
diff --git a/lib/c_glib/test/testframedtransport.c b/lib/c_glib/test/testframedtransport.c
index 3269bf5..3587711 100644
--- a/lib/c_glib/test/testframedtransport.c
+++ b/lib/c_glib/test/testframedtransport.c
@@ -20,10 +20,10 @@
 #include <assert.h>
 #include <netdb.h>
 
-#include "transport/thrift_transport.h"
-#include "transport/thrift_socket.h"
-#include "transport/thrift_server_transport.h"
-#include "transport/thrift_server_socket.h"
+#include <thrift/transport/thrift_transport.h>
+#include <thrift/transport/thrift_socket.h>
+#include <thrift/transport/thrift_server_transport.h>
+#include <thrift/transport/thrift_server_socket.h>
 
 #define TEST_DATA { 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j' }
 
diff --git a/lib/c_glib/test/testmemorybuffer.c b/lib/c_glib/test/testmemorybuffer.c
index 65901bf..b716f5f 100644
--- a/lib/c_glib/test/testmemorybuffer.c
+++ b/lib/c_glib/test/testmemorybuffer.c
@@ -20,10 +20,10 @@
 #include <assert.h>
 #include <netdb.h>
 
-#include "transport/thrift_transport.h"
-#include "transport/thrift_socket.h"
-#include "transport/thrift_server_transport.h"
-#include "transport/thrift_server_socket.h"
+#include <thrift/transport/thrift_transport.h>
+#include <thrift/transport/thrift_socket.h>
+#include <thrift/transport/thrift_server_transport.h>
+#include <thrift/transport/thrift_server_socket.h>
 
 #define TEST_DATA { 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j' }
 
diff --git a/lib/c_glib/test/testoptionalrequired.c b/lib/c_glib/test/testoptionalrequired.c
index 7165d93..fdd4c1a 100644
--- a/lib/c_glib/test/testoptionalrequired.c
+++ b/lib/c_glib/test/testoptionalrequired.c
@@ -21,9 +21,9 @@
 #include <glib.h>
 
 #include "thrift_struct.h"
-#include "protocol/thrift_protocol.h"
-#include "protocol/thrift_binary_protocol.h"
-#include "transport/thrift_memory_buffer.h"
+#include <thrift/protocol/thrift_protocol.h>
+#include <thrift/protocol/thrift_binary_protocol.h>
+#include <thrift/transport/thrift_memory_buffer.h>
 #include "gen-c_glib/t_test_optional_required_test_types.h"
 
 #include "gen-c_glib/t_test_optional_required_test_types.c"
diff --git a/lib/c_glib/test/testsimpleserver.c b/lib/c_glib/test/testsimpleserver.c
index 282a6e8..6f7d3a4 100644
--- a/lib/c_glib/test/testsimpleserver.c
+++ b/lib/c_glib/test/testsimpleserver.c
@@ -24,13 +24,13 @@
 #include <sys/types.h>
 #include <sys/wait.h>
 
-#include "thrift.h"
-#include "processor/thrift_processor.h"
-#include "transport/thrift_server_socket.h"
+#include <thrift/thrift.h>
+#include <thrift/processor/thrift_processor.h>
+#include <thrift/transport/thrift_server_socket.h>
 
 #define TEST_PORT 51199
 
-#include "server/thrift_simple_server.c"
+#include <thrift/server/thrift_simple_server.c>
 
 /* create a rudimentary processor */
 #define TEST_PROCESSOR_TYPE (test_processor_get_type ())
diff --git a/lib/c_glib/test/testthrifttest.c b/lib/c_glib/test/testthrifttest.c
index b14b606..806166e 100644
--- a/lib/c_glib/test/testthrifttest.c
+++ b/lib/c_glib/test/testthrifttest.c
@@ -1,8 +1,8 @@
 #include <assert.h>
 #include <netdb.h>
 
-#include "transport/thrift_server_transport.h"
-#include "transport/thrift_server_socket.h"
+#include <thrift/transport/thrift_server_transport.h>
+#include <thrift/transport/thrift_server_socket.h>
 
 static const char TEST_ADDRESS[] = "localhost";
 static const int TEST_PORT = 64444;
diff --git a/lib/c_glib/test/testthrifttestclient.cpp b/lib/c_glib/test/testthrifttestclient.cpp
index 795e47f..fb6af0b 100644
--- a/lib/c_glib/test/testthrifttestclient.cpp
+++ b/lib/c_glib/test/testthrifttestclient.cpp
@@ -22,10 +22,10 @@
 #include <signal.h>
 #include <sys/types.h>
 #include <sys/wait.h>
-#include <protocol/TBinaryProtocol.h>
-#include <protocol/TDebugProtocol.h>
-#include <server/TSimpleServer.h>
-#include <transport/TServerSocket.h>
+#include <thrift/protocol/TBinaryProtocol.h>
+#include <thrift/protocol/TDebugProtocol.h>
+#include <thrift/server/TSimpleServer.h>
+#include <thrift/transport/TServerSocket.h>
 #include "ThriftTest.h"
 #include "ThriftTest_types.h"
 
@@ -314,9 +314,9 @@
 
 #include "t_test_thrift_test.h"
 #include "t_test_thrift_test_types.h"
-#include "transport/thrift_socket.h"
-#include "protocol/thrift_protocol.h"
-#include "protocol/thrift_binary_protocol.h"
+#include <thrift/transport/thrift_socket.h>
+#include <thrift/protocol/thrift_protocol.h>
+#include <thrift/protocol/thrift_binary_protocol.h>
 
 static void
 test_thrift_client (void)
diff --git a/lib/c_glib/test/testtransportsocket.c b/lib/c_glib/test/testtransportsocket.c
index 279da86..cc21d58 100644
--- a/lib/c_glib/test/testtransportsocket.c
+++ b/lib/c_glib/test/testtransportsocket.c
@@ -20,9 +20,9 @@
 #include <assert.h>
 #include <netdb.h>
 
-#include "transport/thrift_transport.h"
-#include "transport/thrift_server_transport.h"
-#include "transport/thrift_server_socket.h"
+#include <thrift/transport/thrift_transport.h>
+#include <thrift/transport/thrift_server_transport.h>
+#include <thrift/transport/thrift_server_socket.h>
 
 #define TEST_DATA { 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j' }
 
diff --git a/lib/cpp/Makefile.am b/lib/cpp/Makefile.am
index 188b371..1eec8ab 100644
--- a/lib/cpp/Makefile.am
+++ b/lib/cpp/Makefile.am
@@ -48,63 +48,63 @@
 endif
 
 AM_CXXFLAGS = -Wall
-AM_CPPFLAGS = $(BOOST_CPPFLAGS) -I$(srcdir)/src
+AM_CPPFLAGS = $(BOOST_CPPFLAGS) -I$(srcdir)/src -I$(srcdir)/src/thrift
 AM_LDFLAGS = $(BOOST_LDFLAGS)
 
 # Define the source files for the module
 
-libthrift_la_SOURCES = src/Thrift.cpp \
-                       src/TApplicationException.cpp \
-                       src/VirtualProfiling.cpp \
-                       src/concurrency/ThreadManager.cpp \
-                       src/concurrency/TimerManager.cpp \
-                       src/concurrency/Util.cpp \
-                       src/protocol/TDebugProtocol.cpp \
-                       src/protocol/TDenseProtocol.cpp \
-                       src/protocol/TJSONProtocol.cpp \
-                       src/protocol/TBase64Utils.cpp \
-                       src/transport/TTransportException.cpp \
-                       src/transport/TFDTransport.cpp \
-                       src/transport/TFileTransport.cpp \
-                       src/transport/TSimpleFileTransport.cpp \
-                       src/transport/THttpTransport.cpp \
-                       src/transport/THttpClient.cpp \
-                       src/transport/THttpServer.cpp \
-                       src/transport/TSocket.cpp \
-                       src/transport/TSSLSocket.cpp \
-                       src/transport/TSocketPool.cpp \
-                       src/transport/TServerSocket.cpp \
-                       src/transport/TSSLServerSocket.cpp \
-                       src/transport/TTransportUtils.cpp \
-                       src/transport/TBufferTransports.cpp \
-                       src/server/TServer.cpp \
-                       src/server/TSimpleServer.cpp \
-                       src/server/TThreadPoolServer.cpp \
-                       src/server/TThreadedServer.cpp \
-                       src/async/TAsyncChannel.cpp \
-                       src/processor/PeekProcessor.cpp
+libthrift_la_SOURCES = src/thrift/Thrift.cpp \
+                       src/thrift/TApplicationException.cpp \
+                       src/thrift/VirtualProfiling.cpp \
+                       src/thrift/concurrency/ThreadManager.cpp \
+                       src/thrift/concurrency/TimerManager.cpp \
+                       src/thrift/concurrency/Util.cpp \
+                       src/thrift/protocol/TDebugProtocol.cpp \
+                       src/thrift/protocol/TDenseProtocol.cpp \
+                       src/thrift/protocol/TJSONProtocol.cpp \
+                       src/thrift/protocol/TBase64Utils.cpp \
+                       src/thrift/transport/TTransportException.cpp \
+                       src/thrift/transport/TFDTransport.cpp \
+                       src/thrift/transport/TFileTransport.cpp \
+                       src/thrift/transport/TSimpleFileTransport.cpp \
+                       src/thrift/transport/THttpTransport.cpp \
+                       src/thrift/transport/THttpClient.cpp \
+                       src/thrift/transport/THttpServer.cpp \
+                       src/thrift/transport/TSocket.cpp \
+                       src/thrift/transport/TSSLSocket.cpp \
+                       src/thrift/transport/TSocketPool.cpp \
+                       src/thrift/transport/TServerSocket.cpp \
+                       src/thrift/transport/TSSLServerSocket.cpp \
+                       src/thrift/transport/TTransportUtils.cpp \
+                       src/thrift/transport/TBufferTransports.cpp \
+                       src/thrift/server/TServer.cpp \
+                       src/thrift/server/TSimpleServer.cpp \
+                       src/thrift/server/TThreadPoolServer.cpp \
+                       src/thrift/server/TThreadedServer.cpp \
+                       src/thrift/async/TAsyncChannel.cpp \
+                       src/thrift/processor/PeekProcessor.cpp
 
 if WITH_BOOSTTHREADS
-libthrift_la_SOURCES += src/concurrency/BoostThreadFactory.cpp \
-                        src/concurrency/BoostMonitor.cpp \
-                        src/concurrency/BoostMutex.cpp
+libthrift_la_SOURCES += src/thrift/concurrency/BoostThreadFactory.cpp \
+                        src/thrift/concurrency/BoostMonitor.cpp \
+                        src/thrift/concurrency/BoostMutex.cpp
 else
-libthrift_la_SOURCES += src/concurrency/Mutex.cpp \
-                        src/concurrency/Monitor.cpp \
-                        src/concurrency/PosixThreadFactory.cpp
+libthrift_la_SOURCES += src/thrift/concurrency/Mutex.cpp \
+                        src/thrift/concurrency/Monitor.cpp \
+                        src/thrift/concurrency/PosixThreadFactory.cpp
 endif
 
-libthriftnb_la_SOURCES = src/server/TNonblockingServer.cpp \
-                         src/async/TAsyncProtocolProcessor.cpp \
-                         src/async/TEvhttpServer.cpp \
-                         src/async/TEvhttpClientChannel.cpp 
+libthriftnb_la_SOURCES = src/thrift/server/TNonblockingServer.cpp \
+                         src/thrift/async/TAsyncProtocolProcessor.cpp \
+                         src/thrift/async/TEvhttpServer.cpp \
+                         src/thrift/async/TEvhttpClientChannel.cpp 
 
-libthriftz_la_SOURCES = src/transport/TZlibTransport.cpp
+libthriftz_la_SOURCES = src/thrift/transport/TZlibTransport.cpp
 
 libthriftqt_la_MOC = src/qt/moc_TQTcpServer.cpp
 libthriftqt_la_SOURCES = $(libthriftqt_la_MOC) \
-                         src/qt/TQIODeviceTransport.cpp \
-                         src/qt/TQTcpServer.cpp
+                         src/thrift/qt/TQIODeviceTransport.cpp \
+                         src/thrift/qt/TQTcpServer.cpp
 CLEANFILES = $(libthriftqt_la_MOC)
 
 # Flags for the various libraries
@@ -121,100 +121,100 @@
 include_thriftdir = $(includedir)/thrift
 include_thrift_HEADERS = \
                          $(top_builddir)/config.h \
-                         src/TDispatchProcessor.h \
-                         src/Thrift.h \
-                         src/TReflectionLocal.h \
-                         src/TProcessor.h \
-                         src/TApplicationException.h \
-                         src/TLogging.h
+                         src/thrift/TDispatchProcessor.h \
+                         src/thrift/Thrift.h \
+                         src/thrift/TReflectionLocal.h \
+                         src/thrift/TProcessor.h \
+                         src/thrift/TApplicationException.h \
+                         src/thrift/TLogging.h
 
 include_concurrencydir = $(include_thriftdir)/concurrency
 include_concurrency_HEADERS = \
-                         src/concurrency/BoostThreadFactory.h \
-                         src/concurrency/Exception.h \
-                         src/concurrency/Mutex.h \
-                         src/concurrency/Monitor.h \
-                         src/concurrency/PlatformThreadFactory.h \
-                         src/concurrency/PosixThreadFactory.h \
-                         src/concurrency/Thread.h \
-                         src/concurrency/ThreadManager.h \
-                         src/concurrency/TimerManager.h \
-                         src/concurrency/FunctionRunner.h \
-                         src/concurrency/Util.h
+                         src/thrift/concurrency/BoostThreadFactory.h \
+                         src/thrift/concurrency/Exception.h \
+                         src/thrift/concurrency/Mutex.h \
+                         src/thrift/concurrency/Monitor.h \
+                         src/thrift/concurrency/PlatformThreadFactory.h \
+                         src/thrift/concurrency/PosixThreadFactory.h \
+                         src/thrift/concurrency/Thread.h \
+                         src/thrift/concurrency/ThreadManager.h \
+                         src/thrift/concurrency/TimerManager.h \
+                         src/thrift/concurrency/FunctionRunner.h \
+                         src/thrift/concurrency/Util.h
 
 include_protocoldir = $(include_thriftdir)/protocol
 include_protocol_HEADERS = \
-                         src/protocol/TBinaryProtocol.h \
-                         src/protocol/TBinaryProtocol.tcc \
-                         src/protocol/TCompactProtocol.h \
-                         src/protocol/TCompactProtocol.tcc \
-                         src/protocol/TDenseProtocol.h \
-                         src/protocol/TDebugProtocol.h \
-                         src/protocol/TBase64Utils.h \
-                         src/protocol/TJSONProtocol.h \
-                         src/protocol/TProtocolTap.h \
-                         src/protocol/TProtocolException.h \
-                         src/protocol/TVirtualProtocol.h \
-                         src/protocol/TProtocol.h
+                         src/thrift/protocol/TBinaryProtocol.h \
+                         src/thrift/protocol/TBinaryProtocol.tcc \
+                         src/thrift/protocol/TCompactProtocol.h \
+                         src/thrift/protocol/TCompactProtocol.tcc \
+                         src/thrift/protocol/TDenseProtocol.h \
+                         src/thrift/protocol/TDebugProtocol.h \
+                         src/thrift/protocol/TBase64Utils.h \
+                         src/thrift/protocol/TJSONProtocol.h \
+                         src/thrift/protocol/TProtocolTap.h \
+                         src/thrift/protocol/TProtocolException.h \
+                         src/thrift/protocol/TVirtualProtocol.h \
+                         src/thrift/protocol/TProtocol.h
 
 include_transportdir = $(include_thriftdir)/transport
 include_transport_HEADERS = \
-                         src/transport/TFDTransport.h \
-                         src/transport/TFileTransport.h \
-                         src/transport/TSimpleFileTransport.h \
-                         src/transport/TServerSocket.h \
-                         src/transport/TSSLServerSocket.h \
-                         src/transport/TServerTransport.h \
-                         src/transport/THttpTransport.h \
-                         src/transport/THttpClient.h \
-                         src/transport/THttpServer.h \
-                         src/transport/TSocket.h \
-                         src/transport/TSSLSocket.h \
-                         src/transport/TSocketPool.h \
-                         src/transport/TVirtualTransport.h \
-                         src/transport/TTransport.h \
-                         src/transport/TTransportException.h \
-                         src/transport/TTransportUtils.h \
-                         src/transport/TBufferTransports.h \
-                         src/transport/TShortReadTransport.h \
-                         src/transport/TZlibTransport.h
+                         src/thrift/transport/TFDTransport.h \
+                         src/thrift/transport/TFileTransport.h \
+                         src/thrift/transport/TSimpleFileTransport.h \
+                         src/thrift/transport/TServerSocket.h \
+                         src/thrift/transport/TSSLServerSocket.h \
+                         src/thrift/transport/TServerTransport.h \
+                         src/thrift/transport/THttpTransport.h \
+                         src/thrift/transport/THttpClient.h \
+                         src/thrift/transport/THttpServer.h \
+                         src/thrift/transport/TSocket.h \
+                         src/thrift/transport/TSSLSocket.h \
+                         src/thrift/transport/TSocketPool.h \
+                         src/thrift/transport/TVirtualTransport.h \
+                         src/thrift/transport/TTransport.h \
+                         src/thrift/transport/TTransportException.h \
+                         src/thrift/transport/TTransportUtils.h \
+                         src/thrift/transport/TBufferTransports.h \
+                         src/thrift/transport/TShortReadTransport.h \
+                         src/thrift/transport/TZlibTransport.h
 
 include_serverdir = $(include_thriftdir)/server
 include_server_HEADERS = \
-                         src/server/TServer.h \
-                         src/server/TSimpleServer.h \
-                         src/server/TThreadPoolServer.h \
-                         src/server/TThreadedServer.h \
-                         src/server/TNonblockingServer.h
+                         src/thrift/server/TServer.h \
+                         src/thrift/server/TSimpleServer.h \
+                         src/thrift/server/TThreadPoolServer.h \
+                         src/thrift/server/TThreadedServer.h \
+                         src/thrift/server/TNonblockingServer.h
 
 include_processordir = $(include_thriftdir)/processor
 include_processor_HEADERS = \
-                         src/processor/PeekProcessor.h \
-                         src/processor/StatsProcessor.h
+                         src/thrift/processor/PeekProcessor.h \
+                         src/thrift/processor/StatsProcessor.h
 
 include_asyncdir = $(include_thriftdir)/async
 include_async_HEADERS = \
-                     src/async/TAsyncChannel.h \
-                     src/async/TAsyncDispatchProcessor.h \
-                     src/async/TAsyncProcessor.h \
-                     src/async/TAsyncBufferProcessor.h \
-                     src/async/TAsyncProtocolProcessor.h \
-                     src/async/TEvhttpClientChannel.h \
-                     src/async/TEvhttpServer.h
+                     src/thrift/async/TAsyncChannel.h \
+                     src/thrift/async/TAsyncDispatchProcessor.h \
+                     src/thrift/async/TAsyncProcessor.h \
+                     src/thrift/async/TAsyncBufferProcessor.h \
+                     src/thrift/async/TAsyncProtocolProcessor.h \
+                     src/thrift/async/TEvhttpClientChannel.h \
+                     src/thrift/async/TEvhttpServer.h
 
 include_qtdir = $(include_thriftdir)/qt
 include_qt_HEADERS = \
-                  src/qt/TQIODeviceTransport.h \
-                  src/qt/TQTcpServer.h
+                  src/thrift/qt/TQIODeviceTransport.h \
+                  src/thrift/qt/TQTcpServer.h
 
 
 noinst_PROGRAMS = concurrency_test
 
 concurrency_test_SOURCES = \
-                           src/concurrency/test/Tests.cpp \
-                           src/concurrency/test/ThreadFactoryTests.h \
-                           src/concurrency/test/ThreadManagerTests.h \
-                           src/concurrency/test/TimerManagerTests.h
+                           src/thrift/concurrency/test/Tests.cpp \
+                           src/thrift/concurrency/test/ThreadFactoryTests.h \
+                           src/thrift/concurrency/test/ThreadManagerTests.h \
+                           src/thrift/concurrency/test/TimerManagerTests.h
 
 concurrency_test_LDADD = libthrift.la
 
diff --git a/lib/cpp/libthrift.vcxproj b/lib/cpp/libthrift.vcxproj
index 57add63..4a28573 100644
--- a/lib/cpp/libthrift.vcxproj
+++ b/lib/cpp/libthrift.vcxproj
@@ -19,192 +19,192 @@
     </ProjectConfiguration>
   </ItemGroup>
   <ItemGroup>
-    <ClCompile Include="src\async\TAsyncChannel.cpp">
+    <ClCompile Include="src\thrift\thrift\async\TAsyncChannel.cpp">
       <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|x64'">_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
     </ClCompile>
-    <ClCompile Include="src\concurrency\BoostMonitor.cpp" />
-    <ClCompile Include="src\concurrency\BoostMutex.cpp" />
-    <ClCompile Include="src\concurrency\BoostThreadFactory.cpp" />
-    <ClCompile Include="src\concurrency\ThreadManager.cpp">
+    <ClCompile Include="src\thrift\thrift\concurrency\BoostMonitor.cpp" />
+    <ClCompile Include="src\thrift\thrift\concurrency\BoostMutex.cpp" />
+    <ClCompile Include="src\thrift\thrift\concurrency\BoostThreadFactory.cpp" />
+    <ClCompile Include="src\thrift\thrift\concurrency\ThreadManager.cpp">
       <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|x64'">_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
     </ClCompile>
-    <ClCompile Include="src\concurrency\TimerManager.cpp">
+    <ClCompile Include="src\thrift\thrift\concurrency\TimerManager.cpp">
       <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|x64'">_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
     </ClCompile>
-    <ClCompile Include="src\concurrency\Util.cpp">
+    <ClCompile Include="src\thrift\thrift\concurrency\Util.cpp">
       <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
     </ClCompile>
-    <ClCompile Include="src\processor\PeekProcessor.cpp">
+    <ClCompile Include="src\thrift\thrift\processor\PeekProcessor.cpp">
       <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|x64'">_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
     </ClCompile>
-    <ClCompile Include="src\protocol\TBase64Utils.cpp" />
-    <ClCompile Include="src\protocol\TDebugProtocol.cpp">
+    <ClCompile Include="src\thrift\thrift\protocol\TBase64Utils.cpp" />
+    <ClCompile Include="src\thrift\thrift\protocol\TDebugProtocol.cpp">
       <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|x64'">_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
     </ClCompile>
-    <ClCompile Include="src\protocol\TDenseProtocol.cpp">
+    <ClCompile Include="src\thrift\thrift\protocol\TDenseProtocol.cpp">
       <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|x64'">_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
     </ClCompile>
-    <ClCompile Include="src\protocol\TJSONProtocol.cpp">
+    <ClCompile Include="src\thrift\thrift\protocol\TJSONProtocol.cpp">
       <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|x64'">_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
     </ClCompile>
-    <ClCompile Include="src\server\TSimpleServer.cpp">
+    <ClCompile Include="src\thrift\thrift\server\TSimpleServer.cpp">
       <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|x64'">_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
     </ClCompile>
-    <ClCompile Include="src\server\TThreadPoolServer.cpp">
+    <ClCompile Include="src\thrift\thrift\server\TThreadPoolServer.cpp">
       <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|x64'">_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
     </ClCompile>
-    <ClCompile Include="src\TApplicationException.cpp">
+    <ClCompile Include="src\thrift\thrift\TApplicationException.cpp">
       <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|x64'">_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
     </ClCompile>
-    <ClCompile Include="src\Thrift.cpp">
+    <ClCompile Include="src\thrift\thrift\Thrift.cpp">
       <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|x64'">_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
     </ClCompile>
-    <ClCompile Include="src\transport\TBufferTransports.cpp">
+    <ClCompile Include="src\thrift\thrift\transport\TBufferTransports.cpp">
       <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|x64'">_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
     </ClCompile>
-    <ClCompile Include="src\transport\TFDTransport.cpp" />
-    <ClCompile Include="src\transport\TFileTransport.cpp">
+    <ClCompile Include="src\thrift\thrift\transport\TFDTransport.cpp" />
+    <ClCompile Include="src\thrift\thrift\transport\TFileTransport.cpp">
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
     </ClCompile>
-    <ClCompile Include="src\transport\THttpClient.cpp" />
-    <ClCompile Include="src\transport\THttpServer.cpp" />
-    <ClCompile Include="src\transport\THttpTransport.cpp">
+    <ClCompile Include="src\thrift\thrift\transport\THttpClient.cpp" />
+    <ClCompile Include="src\thrift\thrift\transport\THttpServer.cpp" />
+    <ClCompile Include="src\thrift\thrift\transport\THttpTransport.cpp">
       <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|x64'">_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
     </ClCompile>
-    <ClCompile Include="src\transport\TPipe.cpp" />
-    <ClCompile Include="src\transport\TPipeServer.cpp" />
-    <ClCompile Include="src\transport\TServerSocket.cpp">
+    <ClCompile Include="src\thrift\thrift\transport\TPipe.cpp" />
+    <ClCompile Include="src\thrift\thrift\transport\TPipeServer.cpp" />
+    <ClCompile Include="src\thrift\thrift\transport\TServerSocket.cpp">
       <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|x64'">_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
     </ClCompile>
-    <ClCompile Include="src\transport\TSimpleFileTransport.cpp" />
-    <ClCompile Include="src\transport\TSocket.cpp">
+    <ClCompile Include="src\thrift\thrift\transport\TSimpleFileTransport.cpp" />
+    <ClCompile Include="src\thrift\thrift\transport\TSocket.cpp">
       <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|x64'">_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
     </ClCompile>
-    <ClCompile Include="src\transport\TSSLSocket.cpp">
+    <ClCompile Include="src\thrift\thrift\transport\TSSLSocket.cpp">
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
     </ClCompile>
-    <ClCompile Include="src\transport\TTransportException.cpp">
+    <ClCompile Include="src\thrift\thrift\transport\TTransportException.cpp">
       <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|x64'">_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
     </ClCompile>
-    <ClCompile Include="src\transport\TTransportUtils.cpp">
+    <ClCompile Include="src\thrift\thrift\transport\TTransportUtils.cpp">
       <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|x64'">_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
     </ClCompile>
-    <ClCompile Include="src\windows\GetTimeOfDay.cpp" />
-    <ClCompile Include="src\windows\SocketPair.cpp" />
-    <ClCompile Include="src\windows\StdAfx.cpp">
+    <ClCompile Include="src\thrift\thrift\windows\GetTimeOfDay.cpp" />
+    <ClCompile Include="src\thrift\thrift\windows\SocketPair.cpp" />
+    <ClCompile Include="src\thrift\thrift\windows\StdAfx.cpp">
       <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">NotUsing</PrecompiledHeader>
       <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">NotUsing</PrecompiledHeader>
       <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">NotUsing</PrecompiledHeader>
       <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">NotUsing</PrecompiledHeader>
     </ClCompile>
-    <ClCompile Include="src\windows\TWinsockSingleton.cpp" />
-    <ClCompile Include="src\windows\WinFcntl.cpp" />
+    <ClCompile Include="src\thrift\thrift\windows\TWinsockSingleton.cpp" />
+    <ClCompile Include="src\thrift\thrift\windows\WinFcntl.cpp" />
   </ItemGroup>
   <ItemGroup>
-    <ClInclude Include="src\async\TAsyncChannel.h" />
-    <ClInclude Include="src\concurrency\BoostThreadFactory.h" />
-    <ClInclude Include="src\concurrency\Exception.h" />
-    <ClInclude Include="src\concurrency\PlatformThreadFactory.h" />
-    <ClInclude Include="src\processor\PeekProcessor.h" />
-    <ClInclude Include="src\protocol\TBinaryProtocol.h" />
-    <ClInclude Include="src\protocol\TDebugProtocol.h" />
-    <ClInclude Include="src\protocol\TDenseProtocol.h" />
-    <ClInclude Include="src\protocol\TJSONProtocol.h" />
-    <ClInclude Include="src\protocol\TProtocol.h" />
-    <ClInclude Include="src\protocol\TVirtualProtocol.h" />
-    <ClInclude Include="src\server\TServer.h" />
-    <ClInclude Include="src\server\TSimpleServer.h" />
-    <ClInclude Include="src\server\TThreadPoolServer.h" />
-    <ClInclude Include="src\TApplicationException.h" />
-    <ClInclude Include="src\Thrift.h" />
-    <ClInclude Include="src\TProcessor.h" />
-    <ClInclude Include="src\transport\TBufferTransports.h" />
-    <ClInclude Include="src\transport\TFDTransport.h" />
-    <ClInclude Include="src\transport\TFileTransport.h" />
-    <ClInclude Include="src\transport\THttpClient.h" />
-    <ClInclude Include="src\transport\THttpServer.h" />
-    <ClInclude Include="src\transport\TPipe.h" />
-    <ClInclude Include="src\transport\TPipeServer.h" />
-    <ClInclude Include="src\transport\TServerSocket.h" />
-    <ClInclude Include="src\transport\TServerTransport.h" />
-    <ClInclude Include="src\transport\TSimpleFileTransport.h" />
-    <ClInclude Include="src\transport\TSocket.h" />
-    <ClInclude Include="src\transport\TSSLSocket.h" />
-    <ClInclude Include="src\transport\TTransport.h" />
-    <ClInclude Include="src\transport\TTransportException.h" />
-    <ClInclude Include="src\transport\TTransportUtils.h" />
-    <ClInclude Include="src\transport\TVirtualTransport.h" />
-    <ClInclude Include="src\windows\config.h" />
-    <ClInclude Include="src\windows\force_inc.h" />
-    <ClInclude Include="src\windows\GetTimeOfDay.h" />
-    <ClInclude Include="src\windows\Operators.h" />
-    <ClInclude Include="src\windows\SocketPair.h" />
-    <ClInclude Include="src\windows\StdAfx.h" />
-    <ClInclude Include="src\windows\TargetVersion.h" />
-    <ClInclude Include="src\windows\TWinsockSingleton.h" />
-    <ClInclude Include="src\windows\WinFcntl.h" />
+    <ClInclude Include="src\thrift\thrift\async\TAsyncChannel.h" />
+    <ClInclude Include="src\thrift\thrift\concurrency\BoostThreadFactory.h" />
+    <ClInclude Include="src\thrift\thrift\concurrency\Exception.h" />
+    <ClInclude Include="src\thrift\thrift\concurrency\PlatformThreadFactory.h" />
+    <ClInclude Include="src\thrift\thrift\processor\PeekProcessor.h" />
+    <ClInclude Include="src\thrift\thrift\protocol\TBinaryProtocol.h" />
+    <ClInclude Include="src\thrift\thrift\protocol\TDebugProtocol.h" />
+    <ClInclude Include="src\thrift\thrift\protocol\TDenseProtocol.h" />
+    <ClInclude Include="src\thrift\thrift\protocol\TJSONProtocol.h" />
+    <ClInclude Include="src\thrift\thrift\protocol\TProtocol.h" />
+    <ClInclude Include="src\thrift\thrift\protocol\TVirtualProtocol.h" />
+    <ClInclude Include="src\thrift\thrift\server\TServer.h" />
+    <ClInclude Include="src\thrift\thrift\server\TSimpleServer.h" />
+    <ClInclude Include="src\thrift\thrift\server\TThreadPoolServer.h" />
+    <ClInclude Include="src\thrift\thrift\TApplicationException.h" />
+    <ClInclude Include="src\thrift\thrift\Thrift.h" />
+    <ClInclude Include="src\thrift\thrift\TProcessor.h" />
+    <ClInclude Include="src\thrift\thrift\transport\TBufferTransports.h" />
+    <ClInclude Include="src\thrift\thrift\transport\TFDTransport.h" />
+    <ClInclude Include="src\thrift\thrift\transport\TFileTransport.h" />
+    <ClInclude Include="src\thrift\thrift\transport\THttpClient.h" />
+    <ClInclude Include="src\thrift\thrift\transport\THttpServer.h" />
+    <ClInclude Include="src\thrift\thrift\transport\TPipe.h" />
+    <ClInclude Include="src\thrift\thrift\transport\TPipeServer.h" />
+    <ClInclude Include="src\thrift\thrift\transport\TServerSocket.h" />
+    <ClInclude Include="src\thrift\thrift\transport\TServerTransport.h" />
+    <ClInclude Include="src\thrift\thrift\transport\TSimpleFileTransport.h" />
+    <ClInclude Include="src\thrift\thrift\transport\TSocket.h" />
+    <ClInclude Include="src\thrift\thrift\transport\TSSLSocket.h" />
+    <ClInclude Include="src\thrift\thrift\transport\TTransport.h" />
+    <ClInclude Include="src\thrift\thrift\transport\TTransportException.h" />
+    <ClInclude Include="src\thrift\thrift\transport\TTransportUtils.h" />
+    <ClInclude Include="src\thrift\thrift\transport\TVirtualTransport.h" />
+    <ClInclude Include="src\thrift\thrift\windows\config.h" />
+    <ClInclude Include="src\thrift\thrift\windows\force_inc.h" />
+    <ClInclude Include="src\thrift\thrift\windows\GetTimeOfDay.h" />
+    <ClInclude Include="src\thrift\thrift\windows\Operators.h" />
+    <ClInclude Include="src\thrift\thrift\windows\SocketPair.h" />
+    <ClInclude Include="src\thrift\thrift\windows\StdAfx.h" />
+    <ClInclude Include="src\thrift\thrift\windows\TargetVersion.h" />
+    <ClInclude Include="src\thrift\thrift\windows\TWinsockSingleton.h" />
+    <ClInclude Include="src\thrift\thrift\windows\WinFcntl.h" />
   </ItemGroup>
   <ItemGroup>
-    <None Include="src\protocol\TBinaryProtocol.tcc" />
-    <None Include="src\windows\tr1\functional" />
+    <None Include="src\thrift\thrift\protocol\TBinaryProtocol.tcc" />
+    <None Include="src\thrift\thrift\windows\tr1\functional" />
   </ItemGroup>
   <PropertyGroup Label="Globals">
     <ProjectGuid>{DD26F57E-60F2-4F37-A616-D219A9BF338F}</ProjectGuid>
@@ -252,16 +252,16 @@
   </ImportGroup>
   <PropertyGroup Label="UserMacros" />
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-    <IncludePath>$(ProjectDir)\src\;$(ProjectDir)\src\windows\;$(ProjectDir)\src\transport\;$(THIRD_PARTY)\boost\boost_1_47_0\include;$(THIRD_PARTY)\boost\boost_1_47_0\;$(THIRD_PARTY)\openssl\OpenSSL-Win32\include\;..\..\..\..\boost;..\..\..\..\boost\boost;$(IncludePath)</IncludePath>
+    <IncludePath>$(ProjectDir)\src\thrift\;$(ProjectDir)\src\windows\;$(ProjectDir)\src\transport\;$(THIRD_PARTY)\boost\boost_1_47_0\include;$(THIRD_PARTY)\boost\boost_1_47_0\;$(THIRD_PARTY)\openssl\OpenSSL-Win32\include\;..\..\..\..\boost;..\..\..\..\boost\boost;$(IncludePath)</IncludePath>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
-    <IncludePath>$(ProjectDir)\src\;$(ProjectDir)\src\windows\;$(ProjectDir)\src\transport\;$(THIRD_PARTY)\boost\boost_1_47_0\include;$(THIRD_PARTY)\boost\boost_1_47_0\;$(THIRD_PARTY)\openssl\OpenSSL-Win32\include\;$(IncludePath)</IncludePath>
+    <IncludePath>$(ProjectDir)\src\thrift\;$(ProjectDir)\src\windows\;$(ProjectDir)\src\transport\;$(THIRD_PARTY)\boost\boost_1_47_0\include;$(THIRD_PARTY)\boost\boost_1_47_0\;$(THIRD_PARTY)\openssl\OpenSSL-Win32\include\;$(IncludePath)</IncludePath>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-    <IncludePath>$(ProjectDir)\src\;$(ProjectDir)\src\windows\;$(ProjectDir)\src\transport\;$(THIRD_PARTY)\boost\boost_1_47_0\include;$(THIRD_PARTY)\boost\boost_1_47_0\;$(THIRD_PARTY)\openssl\OpenSSL-Win32\include\;..\..\..\..\boost;..\..\..\..\boost\boost;$(IncludePath)</IncludePath>
+    <IncludePath>$(ProjectDir)\src\thrift\;$(ProjectDir)\src\windows\;$(ProjectDir)\src\transport\;$(THIRD_PARTY)\boost\boost_1_47_0\include;$(THIRD_PARTY)\boost\boost_1_47_0\;$(THIRD_PARTY)\openssl\OpenSSL-Win32\include\;..\..\..\..\boost;..\..\..\..\boost\boost;$(IncludePath)</IncludePath>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
-    <IncludePath>$(ProjectDir)\src\;$(ProjectDir)\src\windows\;$(ProjectDir)\src\transport\;$(THIRD_PARTY)\boost\boost_1_47_0\include;$(THIRD_PARTY)\boost\boost_1_47_0\;$(THIRD_PARTY)\openssl\OpenSSL-Win32\include\;$(IncludePath)</IncludePath>
+    <IncludePath>$(ProjectDir)\src\thrift\;$(ProjectDir)\src\windows\;$(ProjectDir)\src\transport\;$(THIRD_PARTY)\boost\boost_1_47_0\include;$(THIRD_PARTY)\boost\boost_1_47_0\;$(THIRD_PARTY)\openssl\OpenSSL-Win32\include\;$(IncludePath)</IncludePath>
   </PropertyGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
     <ClCompile>
@@ -328,4 +328,4 @@
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
   <ImportGroup Label="ExtensionTargets">
   </ImportGroup>
-</Project>
\ No newline at end of file
+</Project>
diff --git a/lib/cpp/libthrift.vcxproj.filters b/lib/cpp/libthrift.vcxproj.filters
index 0762fb4..4025270 100644
--- a/lib/cpp/libthrift.vcxproj.filters
+++ b/lib/cpp/libthrift.vcxproj.filters
@@ -1,99 +1,99 @@
 <?xml version="1.0" encoding="utf-8"?>
 <Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
   <ItemGroup>
-    <ClCompile Include="src\transport\TBufferTransports.cpp">
+    <ClCompile Include="src\thrift\transport\TBufferTransports.cpp">
       <Filter>transport</Filter>
     </ClCompile>
-    <ClCompile Include="src\Thrift.cpp" />
-    <ClCompile Include="src\TApplicationException.cpp" />
-    <ClCompile Include="src\windows\StdAfx.cpp">
+    <ClCompile Include="src\thrift\Thrift.cpp" />
+    <ClCompile Include="src\thrift\TApplicationException.cpp" />
+    <ClCompile Include="src\thrift\windows\StdAfx.cpp">
       <Filter>windows</Filter>
     </ClCompile>
-    <ClCompile Include="src\transport\TTransportException.cpp">
+    <ClCompile Include="src\thrift\transport\TTransportException.cpp">
       <Filter>transport</Filter>
     </ClCompile>
-    <ClCompile Include="src\windows\GetTimeOfDay.cpp">
+    <ClCompile Include="src\thrift\windows\GetTimeOfDay.cpp">
       <Filter>windows</Filter>
     </ClCompile>
-    <ClCompile Include="src\concurrency\ThreadManager.cpp">
+    <ClCompile Include="src\thrift\concurrency\ThreadManager.cpp">
       <Filter>concurrency</Filter>
     </ClCompile>
-    <ClCompile Include="src\concurrency\TimerManager.cpp">
+    <ClCompile Include="src\thrift\concurrency\TimerManager.cpp">
       <Filter>concurrency</Filter>
     </ClCompile>
-    <ClCompile Include="src\concurrency\Util.cpp">
+    <ClCompile Include="src\thrift\concurrency\Util.cpp">
       <Filter>concurrency</Filter>
     </ClCompile>
-    <ClCompile Include="src\protocol\TDebugProtocol.cpp">
+    <ClCompile Include="src\thrift\protocol\TDebugProtocol.cpp">
       <Filter>protocal</Filter>
     </ClCompile>
-    <ClCompile Include="src\protocol\TDenseProtocol.cpp">
+    <ClCompile Include="src\thrift\protocol\TDenseProtocol.cpp">
       <Filter>protocal</Filter>
     </ClCompile>
-    <ClCompile Include="src\protocol\TBase64Utils.cpp">
+    <ClCompile Include="src\thrift\protocol\TBase64Utils.cpp">
       <Filter>protocal</Filter>
     </ClCompile>
-    <ClCompile Include="src\protocol\TJSONProtocol.cpp">
+    <ClCompile Include="src\thrift\protocol\TJSONProtocol.cpp">
       <Filter>protocal</Filter>
     </ClCompile>
-    <ClCompile Include="src\transport\TFDTransport.cpp">
+    <ClCompile Include="src\thrift\transport\TFDTransport.cpp">
       <Filter>transport</Filter>
     </ClCompile>
-    <ClCompile Include="src\transport\TFileTransport.cpp">
+    <ClCompile Include="src\thrift\transport\TFileTransport.cpp">
       <Filter>transport</Filter>
     </ClCompile>
-    <ClCompile Include="src\transport\TSimpleFileTransport.cpp">
+    <ClCompile Include="src\thrift\transport\TSimpleFileTransport.cpp">
       <Filter>transport</Filter>
     </ClCompile>
-    <ClCompile Include="src\transport\THttpTransport.cpp">
+    <ClCompile Include="src\thrift\transport\THttpTransport.cpp">
       <Filter>transport</Filter>
     </ClCompile>
-    <ClCompile Include="src\transport\THttpClient.cpp">
+    <ClCompile Include="src\thrift\transport\THttpClient.cpp">
       <Filter>transport</Filter>
     </ClCompile>
-    <ClCompile Include="src\transport\THttpServer.cpp">
+    <ClCompile Include="src\thrift\transport\THttpServer.cpp">
       <Filter>transport</Filter>
     </ClCompile>
-    <ClCompile Include="src\transport\TSSLSocket.cpp">
+    <ClCompile Include="src\thrift\transport\TSSLSocket.cpp">
       <Filter>transport</Filter>
     </ClCompile>
-    <ClCompile Include="src\transport\TTransportUtils.cpp">
+    <ClCompile Include="src\thrift\transport\TTransportUtils.cpp">
       <Filter>transport</Filter>
     </ClCompile>
-    <ClCompile Include="src\server\TSimpleServer.cpp">
+    <ClCompile Include="src\thrift\server\TSimpleServer.cpp">
       <Filter>server</Filter>
     </ClCompile>
-    <ClCompile Include="src\server\TThreadPoolServer.cpp">
+    <ClCompile Include="src\thrift\server\TThreadPoolServer.cpp">
       <Filter>server</Filter>
     </ClCompile>
-    <ClCompile Include="src\async\TAsyncChannel.cpp">
+    <ClCompile Include="src\thrift\async\TAsyncChannel.cpp">
       <Filter>async</Filter>
     </ClCompile>
-    <ClCompile Include="src\processor\PeekProcessor.cpp">
+    <ClCompile Include="src\thrift\processor\PeekProcessor.cpp">
       <Filter>processor</Filter>
     </ClCompile>
-    <ClCompile Include="src\transport\TServerSocket.cpp">
+    <ClCompile Include="src\thrift\transport\TServerSocket.cpp">
       <Filter>transport</Filter>
     </ClCompile>
-    <ClCompile Include="src\transport\TSocket.cpp">
+    <ClCompile Include="src\thrift\transport\TSocket.cpp">
       <Filter>transport</Filter>
     </ClCompile>
-    <ClCompile Include="src\windows\TWinsockSingleton.cpp">
+    <ClCompile Include="src\thrift\windows\TWinsockSingleton.cpp">
       <Filter>windows</Filter>
     </ClCompile>
-    <ClCompile Include="src\windows\SocketPair.cpp">
+    <ClCompile Include="src\thrift\windows\SocketPair.cpp">
       <Filter>windows</Filter>
     </ClCompile>
-    <ClCompile Include="src\concurrency\BoostMonitor.cpp">
+    <ClCompile Include="src\thrift\concurrency\BoostMonitor.cpp">
       <Filter>concurrency</Filter>
     </ClCompile>
-    <ClCompile Include="src\concurrency\BoostMutex.cpp">
+    <ClCompile Include="src\thrift\concurrency\BoostMutex.cpp">
       <Filter>concurrency</Filter>
     </ClCompile>
-    <ClCompile Include="src\concurrency\BoostThreadFactory.cpp">
+    <ClCompile Include="src\thrift\concurrency\BoostThreadFactory.cpp">
       <Filter>concurrency</Filter>
     </ClCompile>
-    <ClCompile Include="src\windows\WinFcntl.cpp">
+    <ClCompile Include="src\thrift\windows\WinFcntl.cpp">
       <Filter>windows</Filter>
     </ClCompile>
     <ClCompile Include="src\transport\TPipeServer.cpp">
@@ -104,118 +104,118 @@
     </ClCompile>
   </ItemGroup>
   <ItemGroup>
-    <ClInclude Include="src\transport\TBufferTransports.h">
+    <ClInclude Include="src\thrift\transport\TBufferTransports.h">
       <Filter>transport</Filter>
     </ClInclude>
-    <ClInclude Include="src\transport\TSocket.h">
+    <ClInclude Include="src\thrift\transport\TSocket.h">
       <Filter>transport</Filter>
     </ClInclude>
-    <ClInclude Include="src\protocol\TBinaryProtocol.h">
+    <ClInclude Include="src\thrift\protocol\TBinaryProtocol.h">
       <Filter>protocal</Filter>
     </ClInclude>
-    <ClInclude Include="src\Thrift.h" />
-    <ClInclude Include="src\TProcessor.h" />
-    <ClInclude Include="src\TApplicationException.h" />
-    <ClInclude Include="src\windows\StdAfx.h">
+    <ClInclude Include="src\thrift\Thrift.h" />
+    <ClInclude Include="src\thrift\TProcessor.h" />
+    <ClInclude Include="src\thrift\TApplicationException.h" />
+    <ClInclude Include="src\thrift\windows\StdAfx.h">
       <Filter>windows</Filter>
     </ClInclude>
-    <ClInclude Include="src\windows\TargetVersion.h">
+    <ClInclude Include="src\thrift\windows\TargetVersion.h">
       <Filter>windows</Filter>
     </ClInclude>
-    <ClInclude Include="src\concurrency\Exception.h">
+    <ClInclude Include="src\thrift\concurrency\Exception.h">
       <Filter>concurrency</Filter>
     </ClInclude>
-    <ClInclude Include="src\transport\TVirtualTransport.h">
+    <ClInclude Include="src\thrift\transport\TVirtualTransport.h">
       <Filter>transport</Filter>
     </ClInclude>
-    <ClInclude Include="src\transport\TTransport.h">
+    <ClInclude Include="src\thrift\transport\TTransport.h">
       <Filter>transport</Filter>
     </ClInclude>
-    <ClInclude Include="src\transport\TTransportException.h">
+    <ClInclude Include="src\thrift\transport\TTransportException.h">
       <Filter>transport</Filter>
     </ClInclude>
-    <ClInclude Include="src\windows\GetTimeOfDay.h">
+    <ClInclude Include="src\thrift\windows\GetTimeOfDay.h">
       <Filter>windows</Filter>
     </ClInclude>
-    <ClInclude Include="src\transport\TServerTransport.h">
+    <ClInclude Include="src\thrift\transport\TServerTransport.h">
       <Filter>transport</Filter>
     </ClInclude>
-    <ClInclude Include="src\windows\config.h">
+    <ClInclude Include="src\thrift\windows\config.h">
       <Filter>windows</Filter>
     </ClInclude>
-    <ClInclude Include="src\protocol\TProtocol.h">
+    <ClInclude Include="src\thrift\protocol\TProtocol.h">
       <Filter>protocal</Filter>
     </ClInclude>
-    <ClInclude Include="src\protocol\TVirtualProtocol.h">
+    <ClInclude Include="src\thrift\protocol\TVirtualProtocol.h">
       <Filter>protocal</Filter>
     </ClInclude>
-    <ClInclude Include="src\server\TServer.h">
+    <ClInclude Include="src\thrift\server\TServer.h">
       <Filter>server</Filter>
     </ClInclude>
-    <ClInclude Include="src\server\TSimpleServer.h">
+    <ClInclude Include="src\thrift\server\TSimpleServer.h">
       <Filter>server</Filter>
     </ClInclude>
-    <ClInclude Include="src\server\TThreadPoolServer.h">
+    <ClInclude Include="src\thrift\server\TThreadPoolServer.h">
       <Filter>server</Filter>
     </ClInclude>
-    <ClInclude Include="src\async\TAsyncChannel.h">
+    <ClInclude Include="src\thrift\async\TAsyncChannel.h">
       <Filter>async</Filter>
     </ClInclude>
-    <ClInclude Include="src\processor\PeekProcessor.h">
+    <ClInclude Include="src\thrift\processor\PeekProcessor.h">
       <Filter>processor</Filter>
     </ClInclude>
-    <ClInclude Include="src\transport\TFDTransport.h">
+    <ClInclude Include="src\thrift\transport\TFDTransport.h">
       <Filter>transport</Filter>
     </ClInclude>
-    <ClInclude Include="src\transport\TFileTransport.h">
+    <ClInclude Include="src\thrift\transport\TFileTransport.h">
       <Filter>transport</Filter>
     </ClInclude>
-    <ClInclude Include="src\transport\THttpClient.h">
+    <ClInclude Include="src\thrift\transport\THttpClient.h">
       <Filter>transport</Filter>
     </ClInclude>
-    <ClInclude Include="src\transport\THttpServer.h">
+    <ClInclude Include="src\thrift\transport\THttpServer.h">
       <Filter>transport</Filter>
     </ClInclude>
-    <ClInclude Include="src\transport\TSSLSocket.h">
+    <ClInclude Include="src\thrift\transport\TSSLSocket.h">
       <Filter>transport</Filter>
     </ClInclude>
-    <ClInclude Include="src\transport\TTransportUtils.h">
+    <ClInclude Include="src\thrift\transport\TTransportUtils.h">
       <Filter>transport</Filter>
     </ClInclude>
-    <ClInclude Include="src\transport\TSimpleFileTransport.h">
+    <ClInclude Include="src\thrift\transport\TSimpleFileTransport.h">
       <Filter>transport</Filter>
     </ClInclude>
-    <ClInclude Include="src\protocol\TJSONProtocol.h">
+    <ClInclude Include="src\thrift\protocol\TJSONProtocol.h">
       <Filter>protocal</Filter>
     </ClInclude>
-    <ClInclude Include="src\protocol\TDenseProtocol.h">
+    <ClInclude Include="src\thrift\protocol\TDenseProtocol.h">
       <Filter>protocal</Filter>
     </ClInclude>
-    <ClInclude Include="src\protocol\TDebugProtocol.h">
+    <ClInclude Include="src\thrift\protocol\TDebugProtocol.h">
       <Filter>protocal</Filter>
     </ClInclude>
-    <ClInclude Include="src\transport\TServerSocket.h">
+    <ClInclude Include="src\thrift\transport\TServerSocket.h">
       <Filter>transport</Filter>
     </ClInclude>
-    <ClInclude Include="src\windows\Operators.h">
+    <ClInclude Include="src\thrift\windows\Operators.h">
       <Filter>windows</Filter>
     </ClInclude>
-    <ClInclude Include="src\windows\TWinsockSingleton.h">
+    <ClInclude Include="src\thrift\windows\TWinsockSingleton.h">
       <Filter>windows</Filter>
     </ClInclude>
-    <ClInclude Include="src\windows\SocketPair.h">
+    <ClInclude Include="src\thrift\windows\SocketPair.h">
       <Filter>windows</Filter>
     </ClInclude>
-    <ClInclude Include="src\windows\force_inc.h">
+    <ClInclude Include="src\thrift\windows\force_inc.h">
       <Filter>windows</Filter>
     </ClInclude>
-    <ClInclude Include="src\concurrency\BoostThreadFactory.h">
+    <ClInclude Include="src\thrift\concurrency\BoostThreadFactory.h">
       <Filter>concurrency</Filter>
     </ClInclude>
-    <ClInclude Include="src\concurrency\PlatformThreadFactory.h">
+    <ClInclude Include="src\thrift\concurrency\PlatformThreadFactory.h">
       <Filter>concurrency</Filter>
     </ClInclude>
-    <ClInclude Include="src\windows\WinFcntl.h">
+    <ClInclude Include="src\thrift\windows\WinFcntl.h">
       <Filter>windows</Filter>
     </ClInclude>
     <ClInclude Include="src\transport\TPipe.h">
@@ -252,10 +252,10 @@
     </Filter>
   </ItemGroup>
   <ItemGroup>
-    <None Include="src\protocol\TBinaryProtocol.tcc">
+    <None Include="src\thrift\protocol\TBinaryProtocol.tcc">
       <Filter>protocal</Filter>
     </None>
-    <None Include="src\windows\tr1\functional">
+    <None Include="src\thrift\windows\tr1\functional">
       <Filter>windows\tr1</Filter>
     </None>
   </ItemGroup>
diff --git a/lib/cpp/libthriftnb.vcxproj b/lib/cpp/libthriftnb.vcxproj
index c075d9c..640397c 100644
--- a/lib/cpp/libthriftnb.vcxproj
+++ b/lib/cpp/libthriftnb.vcxproj
@@ -19,41 +19,41 @@
     </ProjectConfiguration>
   </ItemGroup>
   <ItemGroup>
-    <ClCompile Include="src\async\TAsyncProtocolProcessor.cpp">
+    <ClCompile Include="src\thrift\thrift\async\TAsyncProtocolProcessor.cpp">
       <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|x64'">_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
     </ClCompile>
-    <ClCompile Include="src\async\TEvhttpClientChannel.cpp">
+    <ClCompile Include="src\thrift\thrift\async\TEvhttpClientChannel.cpp">
       <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|x64'">_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
     </ClCompile>
-    <ClCompile Include="src\async\TEvhttpServer.cpp">
+    <ClCompile Include="src\thrift\thrift\async\TEvhttpServer.cpp">
       <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|x64'">_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
     </ClCompile>
-    <ClCompile Include="src\server\TNonblockingServer.cpp">
+    <ClCompile Include="src\thrift\thrift\server\TNonblockingServer.cpp">
       <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|x64'">_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
     </ClCompile>
-    <ClCompile Include="src\windows\StdAfx.cpp" />
+    <ClCompile Include="src\thrift\thrift\windows\StdAfx.cpp" />
   </ItemGroup>
   <ItemGroup>
-    <ClInclude Include="src\async\TAsyncProtocolProcessor.h" />
-    <ClInclude Include="src\async\TEvhttpClientChannel.h" />
-    <ClInclude Include="src\async\TEvhttpServer.h" />
-    <ClInclude Include="src\server\TNonblockingServer.h" />
-    <ClInclude Include="src\windows\config.h" />
-    <ClInclude Include="src\windows\force_inc.h" />
-    <ClInclude Include="src\windows\StdAfx.h" />
-    <ClInclude Include="src\windows\TargetVersion.h" />
+    <ClInclude Include="src\thrift\thrift\async\TAsyncProtocolProcessor.h" />
+    <ClInclude Include="src\thrift\thrift\async\TEvhttpClientChannel.h" />
+    <ClInclude Include="src\thrift\thrift\async\TEvhttpServer.h" />
+    <ClInclude Include="src\thrift\thrift\server\TNonblockingServer.h" />
+    <ClInclude Include="src\thrift\thrift\windows\config.h" />
+    <ClInclude Include="src\thrift\thrift\windows\force_inc.h" />
+    <ClInclude Include="src\thrift\thrift\windows\StdAfx.h" />
+    <ClInclude Include="src\thrift\thrift\windows\TargetVersion.h" />
   </ItemGroup>
   <PropertyGroup Label="Globals">
     <ProjectGuid>{D8696CCE-7D46-4659-B432-91754A41DEB0}</ProjectGuid>
@@ -100,16 +100,16 @@
   </ImportGroup>
   <PropertyGroup Label="UserMacros" />
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-    <IncludePath>$(ProjectDir)\src\;$(ProjectDir)\src\windows\;$(THIRD_PARTY)\boost\boost_1_47_0\include;$(THIRD_PARTY)\boost\boost_1_47_0\;$(THIRD_PARTY)\libevent\libevent-2.0.13-stable\WIN32-Code\;$(THIRD_PARTY)\libevent\libevent-2.0.13-stable\include;$(THIRD_PARTY)\libevent\libevent-2.0.13-stable\;$(IncludePath)</IncludePath>
+    <IncludePath>$(ProjectDir)\src\thrift\;$(ProjectDir)\src\windows\;$(THIRD_PARTY)\boost\boost_1_47_0\include;$(THIRD_PARTY)\boost\boost_1_47_0\;$(THIRD_PARTY)\libevent\libevent-2.0.13-stable\WIN32-Code\;$(THIRD_PARTY)\libevent\libevent-2.0.13-stable\include;$(THIRD_PARTY)\libevent\libevent-2.0.13-stable\;$(IncludePath)</IncludePath>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
-    <IncludePath>$(ProjectDir)\src\;$(ProjectDir)\src\windows\;$(THIRD_PARTY)\boost\boost_1_47_0\include;$(THIRD_PARTY)\boost\boost_1_47_0\;$(THIRD_PARTY)\libevent\libevent-2.0.13-stable\WIN32-Code\;$(THIRD_PARTY)\libevent\libevent-2.0.13-stable\include;$(THIRD_PARTY)\libevent\libevent-2.0.13-stable\;$(IncludePath)</IncludePath>
+    <IncludePath>$(ProjectDir)\src\thrift\;$(ProjectDir)\src\windows\;$(THIRD_PARTY)\boost\boost_1_47_0\include;$(THIRD_PARTY)\boost\boost_1_47_0\;$(THIRD_PARTY)\libevent\libevent-2.0.13-stable\WIN32-Code\;$(THIRD_PARTY)\libevent\libevent-2.0.13-stable\include;$(THIRD_PARTY)\libevent\libevent-2.0.13-stable\;$(IncludePath)</IncludePath>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-    <IncludePath>$(ProjectDir)\src\;$(ProjectDir)\src\windows\;$(THIRD_PARTY)\boost\boost_1_47_0\include;$(THIRD_PARTY)\boost\boost_1_47_0\;$(THIRD_PARTY)\libevent\libevent-2.0.13-stable\WIN32-Code\;$(THIRD_PARTY)\libevent\libevent-2.0.13-stable\include;$(THIRD_PARTY)\libevent\libevent-2.0.13-stable\;$(IncludePath)</IncludePath>
+    <IncludePath>$(ProjectDir)\src\thrift\;$(ProjectDir)\src\windows\;$(THIRD_PARTY)\boost\boost_1_47_0\include;$(THIRD_PARTY)\boost\boost_1_47_0\;$(THIRD_PARTY)\libevent\libevent-2.0.13-stable\WIN32-Code\;$(THIRD_PARTY)\libevent\libevent-2.0.13-stable\include;$(THIRD_PARTY)\libevent\libevent-2.0.13-stable\;$(IncludePath)</IncludePath>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
-    <IncludePath>$(ProjectDir)\src\;$(ProjectDir)\src\windows\;$(THIRD_PARTY)\boost\boost_1_47_0\include;$(THIRD_PARTY)\boost\boost_1_47_0\;$(THIRD_PARTY)\libevent\libevent-2.0.13-stable\WIN32-Code\;$(THIRD_PARTY)\libevent\libevent-2.0.13-stable\include;$(THIRD_PARTY)\libevent\libevent-2.0.13-stable\;$(IncludePath)</IncludePath>
+    <IncludePath>$(ProjectDir)\src\thrift\;$(ProjectDir)\src\windows\;$(THIRD_PARTY)\boost\boost_1_47_0\include;$(THIRD_PARTY)\boost\boost_1_47_0\;$(THIRD_PARTY)\libevent\libevent-2.0.13-stable\WIN32-Code\;$(THIRD_PARTY)\libevent\libevent-2.0.13-stable\include;$(THIRD_PARTY)\libevent\libevent-2.0.13-stable\;$(IncludePath)</IncludePath>
   </PropertyGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
     <ClCompile>
diff --git a/lib/cpp/libthriftnb.vcxproj.filters b/lib/cpp/libthriftnb.vcxproj.filters
index d481d8f..5245544 100644
--- a/lib/cpp/libthriftnb.vcxproj.filters
+++ b/lib/cpp/libthriftnb.vcxproj.filters
@@ -12,45 +12,45 @@
     </Filter>
   </ItemGroup>
   <ItemGroup>
-    <ClCompile Include="src\server\TNonblockingServer.cpp">
+    <ClCompile Include="src\thrift\server\TNonblockingServer.cpp">
       <Filter>server</Filter>
     </ClCompile>
-    <ClCompile Include="src\async\TEvhttpClientChannel.cpp">
+    <ClCompile Include="src\thrift\async\TEvhttpClientChannel.cpp">
       <Filter>async</Filter>
     </ClCompile>
-    <ClCompile Include="src\async\TEvhttpServer.cpp">
+    <ClCompile Include="src\thrift\async\TEvhttpServer.cpp">
       <Filter>async</Filter>
     </ClCompile>
-    <ClCompile Include="src\async\TAsyncProtocolProcessor.cpp">
+    <ClCompile Include="src\thrift\async\TAsyncProtocolProcessor.cpp">
       <Filter>async</Filter>
     </ClCompile>
-    <ClCompile Include="src\windows\StdAfx.cpp">
+    <ClCompile Include="src\thrift\windows\StdAfx.cpp">
       <Filter>windows</Filter>
     </ClCompile>
   </ItemGroup>
   <ItemGroup>
-    <ClInclude Include="src\server\TNonblockingServer.h">
+    <ClInclude Include="src\thrift\server\TNonblockingServer.h">
       <Filter>server</Filter>
     </ClInclude>
-    <ClInclude Include="src\async\TEvhttpClientChannel.h">
+    <ClInclude Include="src\thrift\async\TEvhttpClientChannel.h">
       <Filter>async</Filter>
     </ClInclude>
-    <ClInclude Include="src\async\TEvhttpServer.h">
+    <ClInclude Include="src\thrift\async\TEvhttpServer.h">
       <Filter>async</Filter>
     </ClInclude>
-    <ClInclude Include="src\async\TAsyncProtocolProcessor.h">
+    <ClInclude Include="src\thrift\async\TAsyncProtocolProcessor.h">
       <Filter>async</Filter>
     </ClInclude>
-    <ClInclude Include="src\windows\config.h">
+    <ClInclude Include="src\thrift\windows\config.h">
       <Filter>windows</Filter>
     </ClInclude>
-    <ClInclude Include="src\windows\StdAfx.h">
+    <ClInclude Include="src\thrift\windows\StdAfx.h">
       <Filter>windows</Filter>
     </ClInclude>
-    <ClInclude Include="src\windows\TargetVersion.h">
+    <ClInclude Include="src\thrift\windows\TargetVersion.h">
       <Filter>windows</Filter>
     </ClInclude>
-    <ClInclude Include="src\windows\force_inc.h">
+    <ClInclude Include="src\thrift\windows\force_inc.h">
       <Filter>windows</Filter>
     </ClInclude>
   </ItemGroup>
diff --git a/lib/cpp/src/TApplicationException.cpp b/lib/cpp/src/thrift/TApplicationException.cpp
similarity index 96%
rename from lib/cpp/src/TApplicationException.cpp
rename to lib/cpp/src/thrift/TApplicationException.cpp
index 32238fb..1110ba2 100644
--- a/lib/cpp/src/TApplicationException.cpp
+++ b/lib/cpp/src/thrift/TApplicationException.cpp
@@ -17,8 +17,8 @@
  * under the License.
  */
 
-#include <TApplicationException.h>
-#include <protocol/TProtocol.h>
+#include <thrift/TApplicationException.h>
+#include <thrift/protocol/TProtocol.h>
 
 namespace apache { namespace thrift {
 
diff --git a/lib/cpp/src/TApplicationException.h b/lib/cpp/src/thrift/TApplicationException.h
similarity index 98%
rename from lib/cpp/src/TApplicationException.h
rename to lib/cpp/src/thrift/TApplicationException.h
index 61e6864..79f026d 100644
--- a/lib/cpp/src/TApplicationException.h
+++ b/lib/cpp/src/thrift/TApplicationException.h
@@ -20,7 +20,7 @@
 #ifndef _THRIFT_TAPPLICATIONEXCEPTION_H_
 #define _THRIFT_TAPPLICATIONEXCEPTION_H_ 1
 
-#include <Thrift.h>
+#include <thrift/Thrift.h>
 
 
 namespace apache { namespace thrift {
diff --git a/lib/cpp/src/TDispatchProcessor.h b/lib/cpp/src/thrift/TDispatchProcessor.h
similarity index 100%
rename from lib/cpp/src/TDispatchProcessor.h
rename to lib/cpp/src/thrift/TDispatchProcessor.h
diff --git a/lib/cpp/src/TLogging.h b/lib/cpp/src/thrift/TLogging.h
similarity index 100%
rename from lib/cpp/src/TLogging.h
rename to lib/cpp/src/thrift/TLogging.h
diff --git a/lib/cpp/src/TProcessor.h b/lib/cpp/src/thrift/TProcessor.h
similarity index 99%
rename from lib/cpp/src/TProcessor.h
rename to lib/cpp/src/thrift/TProcessor.h
index 26c3ee4..b4a4657 100644
--- a/lib/cpp/src/TProcessor.h
+++ b/lib/cpp/src/thrift/TProcessor.h
@@ -21,7 +21,7 @@
 #define _THRIFT_TPROCESSOR_H_ 1
 
 #include <string>
-#include <protocol/TProtocol.h>
+#include <thrift/protocol/TProtocol.h>
 #include <boost/shared_ptr.hpp>
 
 namespace apache { namespace thrift {
diff --git a/lib/cpp/src/TReflectionLocal.h b/lib/cpp/src/thrift/TReflectionLocal.h
similarity index 98%
rename from lib/cpp/src/TReflectionLocal.h
rename to lib/cpp/src/thrift/TReflectionLocal.h
index e83e475..2ef7511 100644
--- a/lib/cpp/src/TReflectionLocal.h
+++ b/lib/cpp/src/thrift/TReflectionLocal.h
@@ -22,7 +22,7 @@
 
 #include <stdint.h>
 #include <cstring>
-#include <protocol/TProtocol.h>
+#include <thrift/protocol/TProtocol.h>
 
 /**
  * Local Reflection is a blanket term referring to the the structure
diff --git a/lib/cpp/src/Thrift.cpp b/lib/cpp/src/thrift/Thrift.cpp
similarity index 98%
rename from lib/cpp/src/Thrift.cpp
rename to lib/cpp/src/thrift/Thrift.cpp
index 114947f..bcbdb1a 100644
--- a/lib/cpp/src/Thrift.cpp
+++ b/lib/cpp/src/thrift/Thrift.cpp
@@ -17,7 +17,7 @@
  * under the License.
  */
 
-#include <Thrift.h>
+#include <thrift/Thrift.h>
 #include <cstring>
 #include <cstdlib>
 #include <boost/lexical_cast.hpp>
diff --git a/lib/cpp/src/Thrift.h b/lib/cpp/src/thrift/Thrift.h
similarity index 99%
rename from lib/cpp/src/Thrift.h
rename to lib/cpp/src/thrift/Thrift.h
index 60a66f4..5cdc37e 100644
--- a/lib/cpp/src/Thrift.h
+++ b/lib/cpp/src/thrift/Thrift.h
@@ -21,7 +21,7 @@
 #define _THRIFT_THRIFT_H_ 1
 
 #ifdef _WIN32
-#include "windows/config.h"
+#include <thrift/windows/config.h>
 #endif
 
 #ifdef HAVE_CONFIG_H
diff --git a/lib/cpp/src/VirtualProfiling.cpp b/lib/cpp/src/thrift/VirtualProfiling.cpp
similarity index 99%
rename from lib/cpp/src/VirtualProfiling.cpp
rename to lib/cpp/src/thrift/VirtualProfiling.cpp
index 0b023af..180cfb7 100644
--- a/lib/cpp/src/VirtualProfiling.cpp
+++ b/lib/cpp/src/thrift/VirtualProfiling.cpp
@@ -17,7 +17,7 @@
  * under the License.
  */
 
-#include <Thrift.h>
+#include <thrift/Thrift.h>
 
 // Do nothing if virtual call profiling is not enabled
 #if T_GLOBAL_DEBUG_VIRTUAL > 1
@@ -36,7 +36,7 @@
 #endif // !__GLIBC__
 
 
-#include <concurrency/Mutex.h>
+#include <thrift/concurrency/Mutex.h>
 
 #include <ext/hash_map>
 #include <execinfo.h>
diff --git a/lib/cpp/src/async/TAsyncBufferProcessor.h b/lib/cpp/src/thrift/async/TAsyncBufferProcessor.h
similarity index 96%
rename from lib/cpp/src/async/TAsyncBufferProcessor.h
rename to lib/cpp/src/thrift/async/TAsyncBufferProcessor.h
index bfaf323..a7f6435 100644
--- a/lib/cpp/src/async/TAsyncBufferProcessor.h
+++ b/lib/cpp/src/thrift/async/TAsyncBufferProcessor.h
@@ -23,7 +23,7 @@
 #include <tr1/functional>
 #include <boost/shared_ptr.hpp>
 
-#include "transport/TBufferTransports.h"
+#include <thrift/transport/TBufferTransports.h>
 
 namespace apache { namespace thrift { namespace async {
 
diff --git a/lib/cpp/src/async/TAsyncChannel.cpp b/lib/cpp/src/thrift/async/TAsyncChannel.cpp
similarity index 96%
rename from lib/cpp/src/async/TAsyncChannel.cpp
rename to lib/cpp/src/thrift/async/TAsyncChannel.cpp
index 9397017..bfde660 100644
--- a/lib/cpp/src/async/TAsyncChannel.cpp
+++ b/lib/cpp/src/thrift/async/TAsyncChannel.cpp
@@ -17,7 +17,7 @@
  * under the License.
  */
 
-#include <async/TAsyncChannel.h>
+#include <thrift/async/TAsyncChannel.h>
 #include <tr1/functional>
 
 namespace apache { namespace thrift { namespace async {
diff --git a/lib/cpp/src/async/TAsyncChannel.h b/lib/cpp/src/thrift/async/TAsyncChannel.h
similarity index 98%
rename from lib/cpp/src/async/TAsyncChannel.h
rename to lib/cpp/src/thrift/async/TAsyncChannel.h
index 856ab31..634b6a4 100644
--- a/lib/cpp/src/async/TAsyncChannel.h
+++ b/lib/cpp/src/thrift/async/TAsyncChannel.h
@@ -21,7 +21,7 @@
 #define _THRIFT_ASYNC_TASYNCCHANNEL_H_ 1
 
 #include <tr1/functional>
-#include <Thrift.h>
+#include <thrift/Thrift.h>
 
 namespace apache { namespace thrift { namespace transport {
 class TMemoryBuffer;
diff --git a/lib/cpp/src/async/TAsyncDispatchProcessor.h b/lib/cpp/src/thrift/async/TAsyncDispatchProcessor.h
similarity index 100%
rename from lib/cpp/src/async/TAsyncDispatchProcessor.h
rename to lib/cpp/src/thrift/async/TAsyncDispatchProcessor.h
diff --git a/lib/cpp/src/async/TAsyncProcessor.h b/lib/cpp/src/thrift/async/TAsyncProcessor.h
similarity index 98%
rename from lib/cpp/src/async/TAsyncProcessor.h
rename to lib/cpp/src/thrift/async/TAsyncProcessor.h
index c62f8b7..593ea69 100644
--- a/lib/cpp/src/async/TAsyncProcessor.h
+++ b/lib/cpp/src/thrift/async/TAsyncProcessor.h
@@ -22,7 +22,7 @@
 
 #include <tr1/functional>
 #include <boost/shared_ptr.hpp>
-#include <protocol/TProtocol.h>
+#include <thrift/protocol/TProtocol.h>
 #include <TProcessor.h>
 
 namespace apache { namespace thrift { namespace async {
diff --git a/lib/cpp/src/async/TAsyncProtocolProcessor.cpp b/lib/cpp/src/thrift/async/TAsyncProtocolProcessor.cpp
similarity index 100%
rename from lib/cpp/src/async/TAsyncProtocolProcessor.cpp
rename to lib/cpp/src/thrift/async/TAsyncProtocolProcessor.cpp
diff --git a/lib/cpp/src/async/TAsyncProtocolProcessor.h b/lib/cpp/src/thrift/async/TAsyncProtocolProcessor.h
similarity index 97%
rename from lib/cpp/src/async/TAsyncProtocolProcessor.h
rename to lib/cpp/src/thrift/async/TAsyncProtocolProcessor.h
index 647bbb6..139e394 100644
--- a/lib/cpp/src/async/TAsyncProtocolProcessor.h
+++ b/lib/cpp/src/thrift/async/TAsyncProtocolProcessor.h
@@ -22,7 +22,7 @@
 
 #include "TAsyncProcessor.h"
 #include "TAsyncBufferProcessor.h"
-#include "protocol/TProtocol.h"
+#include <thrift/protocol/TProtocol.h>
 
 namespace apache { namespace thrift { namespace async {
 
diff --git a/lib/cpp/src/async/TEvhttpClientChannel.cpp b/lib/cpp/src/thrift/async/TEvhttpClientChannel.cpp
similarity index 97%
rename from lib/cpp/src/async/TEvhttpClientChannel.cpp
rename to lib/cpp/src/thrift/async/TEvhttpClientChannel.cpp
index c0363fc..5871503 100755
--- a/lib/cpp/src/async/TEvhttpClientChannel.cpp
+++ b/lib/cpp/src/thrift/async/TEvhttpClientChannel.cpp
@@ -19,8 +19,8 @@
 
 #include "TEvhttpClientChannel.h"
 #include <evhttp.h>
-#include "transport/TBufferTransports.h"
-#include <protocol/TProtocolException.h>
+#include <thrift/transport/TBufferTransports.h>
+#include <thrift/protocol/TProtocolException.h>
 
 #include <iostream>
 #include <sstream>
diff --git a/lib/cpp/src/async/TEvhttpClientChannel.h b/lib/cpp/src/thrift/async/TEvhttpClientChannel.h
similarity index 100%
rename from lib/cpp/src/async/TEvhttpClientChannel.h
rename to lib/cpp/src/thrift/async/TEvhttpClientChannel.h
diff --git a/lib/cpp/src/async/TEvhttpServer.cpp b/lib/cpp/src/thrift/async/TEvhttpServer.cpp
similarity index 98%
rename from lib/cpp/src/async/TEvhttpServer.cpp
rename to lib/cpp/src/thrift/async/TEvhttpServer.cpp
index b92422c..73516db 100755
--- a/lib/cpp/src/async/TEvhttpServer.cpp
+++ b/lib/cpp/src/thrift/async/TEvhttpServer.cpp
@@ -19,7 +19,7 @@
 
 #include "TEvhttpServer.h"
 #include "TAsyncBufferProcessor.h"
-#include "transport/TBufferTransports.h"
+#include <thrift/transport/TBufferTransports.h>
 #include <evhttp.h>
 
 #include <iostream>
diff --git a/lib/cpp/src/async/TEvhttpServer.h b/lib/cpp/src/thrift/async/TEvhttpServer.h
similarity index 100%
rename from lib/cpp/src/async/TEvhttpServer.h
rename to lib/cpp/src/thrift/async/TEvhttpServer.h
diff --git a/lib/cpp/src/concurrency/BoostMonitor.cpp b/lib/cpp/src/thrift/concurrency/BoostMonitor.cpp
similarity index 100%
rename from lib/cpp/src/concurrency/BoostMonitor.cpp
rename to lib/cpp/src/thrift/concurrency/BoostMonitor.cpp
diff --git a/lib/cpp/src/concurrency/BoostMutex.cpp b/lib/cpp/src/thrift/concurrency/BoostMutex.cpp
similarity index 100%
rename from lib/cpp/src/concurrency/BoostMutex.cpp
rename to lib/cpp/src/thrift/concurrency/BoostMutex.cpp
diff --git a/lib/cpp/src/concurrency/BoostThreadFactory.cpp b/lib/cpp/src/thrift/concurrency/BoostThreadFactory.cpp
similarity index 100%
rename from lib/cpp/src/concurrency/BoostThreadFactory.cpp
rename to lib/cpp/src/thrift/concurrency/BoostThreadFactory.cpp
diff --git a/lib/cpp/src/concurrency/BoostThreadFactory.h b/lib/cpp/src/thrift/concurrency/BoostThreadFactory.h
similarity index 100%
rename from lib/cpp/src/concurrency/BoostThreadFactory.h
rename to lib/cpp/src/thrift/concurrency/BoostThreadFactory.h
diff --git a/lib/cpp/src/concurrency/Exception.h b/lib/cpp/src/thrift/concurrency/Exception.h
similarity index 98%
rename from lib/cpp/src/concurrency/Exception.h
rename to lib/cpp/src/thrift/concurrency/Exception.h
index 06ba0d3..c62f116 100644
--- a/lib/cpp/src/concurrency/Exception.h
+++ b/lib/cpp/src/thrift/concurrency/Exception.h
@@ -21,7 +21,7 @@
 #define _THRIFT_CONCURRENCY_EXCEPTION_H_ 1
 
 #include <exception>
-#include <Thrift.h>
+#include <thrift/Thrift.h>
 
 namespace apache { namespace thrift { namespace concurrency {
 
diff --git a/lib/cpp/src/concurrency/FunctionRunner.h b/lib/cpp/src/thrift/concurrency/FunctionRunner.h
similarity index 100%
rename from lib/cpp/src/concurrency/FunctionRunner.h
rename to lib/cpp/src/thrift/concurrency/FunctionRunner.h
diff --git a/lib/cpp/src/concurrency/Monitor.cpp b/lib/cpp/src/thrift/concurrency/Monitor.cpp
similarity index 100%
rename from lib/cpp/src/concurrency/Monitor.cpp
rename to lib/cpp/src/thrift/concurrency/Monitor.cpp
diff --git a/lib/cpp/src/concurrency/Monitor.h b/lib/cpp/src/thrift/concurrency/Monitor.h
similarity index 100%
rename from lib/cpp/src/concurrency/Monitor.h
rename to lib/cpp/src/thrift/concurrency/Monitor.h
diff --git a/lib/cpp/src/concurrency/Mutex.cpp b/lib/cpp/src/thrift/concurrency/Mutex.cpp
similarity index 100%
rename from lib/cpp/src/concurrency/Mutex.cpp
rename to lib/cpp/src/thrift/concurrency/Mutex.cpp
diff --git a/lib/cpp/src/concurrency/Mutex.h b/lib/cpp/src/thrift/concurrency/Mutex.h
similarity index 100%
rename from lib/cpp/src/concurrency/Mutex.h
rename to lib/cpp/src/thrift/concurrency/Mutex.h
diff --git a/lib/cpp/src/concurrency/PlatformThreadFactory.h b/lib/cpp/src/thrift/concurrency/PlatformThreadFactory.h
similarity index 91%
rename from lib/cpp/src/concurrency/PlatformThreadFactory.h
rename to lib/cpp/src/thrift/concurrency/PlatformThreadFactory.h
index 04fdc5b..04f6ee3 100644
--- a/lib/cpp/src/concurrency/PlatformThreadFactory.h
+++ b/lib/cpp/src/thrift/concurrency/PlatformThreadFactory.h
@@ -21,9 +21,9 @@
 #define _THRIFT_CONCURRENCY_PLATFORMTHREADFACTORY_H_ 1
 
 #ifndef USE_BOOST_THREAD
-#  include <concurrency/PosixThreadFactory.h>
+#  include <thrift/concurrency/PosixThreadFactory.h>
 #else
-#  include <concurrency/BoostThreadFactory.h>
+#  include <thrift/concurrency/BoostThreadFactory.h>
 #endif
 
 namespace apache { namespace thrift { namespace concurrency {
diff --git a/lib/cpp/src/concurrency/PosixThreadFactory.cpp b/lib/cpp/src/thrift/concurrency/PosixThreadFactory.cpp
similarity index 100%
rename from lib/cpp/src/concurrency/PosixThreadFactory.cpp
rename to lib/cpp/src/thrift/concurrency/PosixThreadFactory.cpp
diff --git a/lib/cpp/src/concurrency/PosixThreadFactory.h b/lib/cpp/src/thrift/concurrency/PosixThreadFactory.h
similarity index 100%
rename from lib/cpp/src/concurrency/PosixThreadFactory.h
rename to lib/cpp/src/thrift/concurrency/PosixThreadFactory.h
diff --git a/lib/cpp/src/concurrency/Thread.h b/lib/cpp/src/thrift/concurrency/Thread.h
similarity index 100%
rename from lib/cpp/src/concurrency/Thread.h
rename to lib/cpp/src/thrift/concurrency/Thread.h
diff --git a/lib/cpp/src/concurrency/ThreadManager.cpp b/lib/cpp/src/thrift/concurrency/ThreadManager.cpp
similarity index 100%
rename from lib/cpp/src/concurrency/ThreadManager.cpp
rename to lib/cpp/src/thrift/concurrency/ThreadManager.cpp
diff --git a/lib/cpp/src/concurrency/ThreadManager.h b/lib/cpp/src/thrift/concurrency/ThreadManager.h
similarity index 100%
rename from lib/cpp/src/concurrency/ThreadManager.h
rename to lib/cpp/src/thrift/concurrency/ThreadManager.h
diff --git a/lib/cpp/src/concurrency/TimerManager.cpp b/lib/cpp/src/thrift/concurrency/TimerManager.cpp
similarity index 100%
rename from lib/cpp/src/concurrency/TimerManager.cpp
rename to lib/cpp/src/thrift/concurrency/TimerManager.cpp
diff --git a/lib/cpp/src/concurrency/TimerManager.h b/lib/cpp/src/thrift/concurrency/TimerManager.h
similarity index 100%
rename from lib/cpp/src/concurrency/TimerManager.h
rename to lib/cpp/src/thrift/concurrency/TimerManager.h
diff --git a/lib/cpp/src/concurrency/Util.cpp b/lib/cpp/src/thrift/concurrency/Util.cpp
similarity index 100%
rename from lib/cpp/src/concurrency/Util.cpp
rename to lib/cpp/src/thrift/concurrency/Util.cpp
diff --git a/lib/cpp/src/concurrency/Util.h b/lib/cpp/src/thrift/concurrency/Util.h
similarity index 100%
rename from lib/cpp/src/concurrency/Util.h
rename to lib/cpp/src/thrift/concurrency/Util.h
diff --git a/lib/cpp/src/concurrency/test/Tests.cpp b/lib/cpp/src/thrift/concurrency/test/Tests.cpp
similarity index 100%
rename from lib/cpp/src/concurrency/test/Tests.cpp
rename to lib/cpp/src/thrift/concurrency/test/Tests.cpp
diff --git a/lib/cpp/src/concurrency/test/ThreadFactoryTests.h b/lib/cpp/src/thrift/concurrency/test/ThreadFactoryTests.h
similarity index 97%
rename from lib/cpp/src/concurrency/test/ThreadFactoryTests.h
rename to lib/cpp/src/thrift/concurrency/test/ThreadFactoryTests.h
index d9066b5..b7e873f 100644
--- a/lib/cpp/src/concurrency/test/ThreadFactoryTests.h
+++ b/lib/cpp/src/thrift/concurrency/test/ThreadFactoryTests.h
@@ -18,10 +18,10 @@
  */
 
 #include <config.h>
-#include <concurrency/Thread.h>
-#include <concurrency/PlatformThreadFactory.h>
-#include <concurrency/Monitor.h>
-#include <concurrency/Util.h>
+#include <thrift/concurrency/Thread.h>
+#include <thrift/concurrency/PlatformThreadFactory.h>
+#include <thrift/concurrency/Monitor.h>
+#include <thrift/concurrency/Util.h>
 
 #include <assert.h>
 #include <unistd.h>
diff --git a/lib/cpp/src/concurrency/test/ThreadManagerTests.h b/lib/cpp/src/thrift/concurrency/test/ThreadManagerTests.h
similarity index 97%
rename from lib/cpp/src/concurrency/test/ThreadManagerTests.h
rename to lib/cpp/src/thrift/concurrency/test/ThreadManagerTests.h
index e12201c..b734f7a 100644
--- a/lib/cpp/src/concurrency/test/ThreadManagerTests.h
+++ b/lib/cpp/src/thrift/concurrency/test/ThreadManagerTests.h
@@ -18,10 +18,10 @@
  */
 
 #include <config.h>
-#include <concurrency/ThreadManager.h>
-#include <concurrency/PlatformThreadFactory.h>
-#include <concurrency/Monitor.h>
-#include <concurrency/Util.h>
+#include <thrift/concurrency/ThreadManager.h>
+#include <thrift/concurrency/PlatformThreadFactory.h>
+#include <thrift/concurrency/Monitor.h>
+#include <thrift/concurrency/Util.h>
 
 #include <assert.h>
 #include <set>
diff --git a/lib/cpp/src/concurrency/test/TimerManagerTests.h b/lib/cpp/src/thrift/concurrency/test/TimerManagerTests.h
similarity index 95%
rename from lib/cpp/src/concurrency/test/TimerManagerTests.h
rename to lib/cpp/src/thrift/concurrency/test/TimerManagerTests.h
index 41f1674..4fe9667 100644
--- a/lib/cpp/src/concurrency/test/TimerManagerTests.h
+++ b/lib/cpp/src/thrift/concurrency/test/TimerManagerTests.h
@@ -17,10 +17,10 @@
  * under the License.
  */
 
-#include <concurrency/TimerManager.h>
-#include <concurrency/PlatformThreadFactory.h>
-#include <concurrency/Monitor.h>
-#include <concurrency/Util.h>
+#include <thrift/concurrency/TimerManager.h>
+#include <thrift/concurrency/PlatformThreadFactory.h>
+#include <thrift/concurrency/Monitor.h>
+#include <thrift/concurrency/Util.h>
 
 #include <assert.h>
 #include <iostream>
diff --git a/lib/cpp/src/processor/PeekProcessor.cpp b/lib/cpp/src/thrift/processor/PeekProcessor.cpp
similarity index 100%
rename from lib/cpp/src/processor/PeekProcessor.cpp
rename to lib/cpp/src/thrift/processor/PeekProcessor.cpp
diff --git a/lib/cpp/src/processor/PeekProcessor.h b/lib/cpp/src/thrift/processor/PeekProcessor.h
similarity index 95%
rename from lib/cpp/src/processor/PeekProcessor.h
rename to lib/cpp/src/thrift/processor/PeekProcessor.h
index cb703f6..60e1559 100644
--- a/lib/cpp/src/processor/PeekProcessor.h
+++ b/lib/cpp/src/thrift/processor/PeekProcessor.h
@@ -22,9 +22,9 @@
 
 #include <string>
 #include <TProcessor.h>
-#include <transport/TTransport.h>
-#include <transport/TTransportUtils.h>
-#include <transport/TBufferTransports.h>
+#include <thrift/transport/TTransport.h>
+#include <thrift/transport/TTransportUtils.h>
+#include <thrift/transport/TBufferTransports.h>
 #include <boost/shared_ptr.hpp>
 
 namespace apache { namespace thrift { namespace processor {
diff --git a/lib/cpp/src/processor/StatsProcessor.h b/lib/cpp/src/thrift/processor/StatsProcessor.h
similarity index 98%
rename from lib/cpp/src/processor/StatsProcessor.h
rename to lib/cpp/src/thrift/processor/StatsProcessor.h
index 8600c6b..58cd1dc 100644
--- a/lib/cpp/src/processor/StatsProcessor.h
+++ b/lib/cpp/src/thrift/processor/StatsProcessor.h
@@ -21,8 +21,8 @@
 #define STATSPROCESSOR_H
 
 #include <boost/shared_ptr.hpp>
-#include <transport/TTransport.h>
-#include <protocol/TProtocol.h>
+#include <thrift/transport/TTransport.h>
+#include <thrift/protocol/TProtocol.h>
 #include <TProcessor.h>
 
 namespace apache { namespace thrift { namespace processor {
diff --git a/lib/cpp/src/protocol/TBase64Utils.cpp b/lib/cpp/src/thrift/protocol/TBase64Utils.cpp
similarity index 100%
rename from lib/cpp/src/protocol/TBase64Utils.cpp
rename to lib/cpp/src/thrift/protocol/TBase64Utils.cpp
diff --git a/lib/cpp/src/protocol/TBase64Utils.h b/lib/cpp/src/thrift/protocol/TBase64Utils.h
similarity index 100%
rename from lib/cpp/src/protocol/TBase64Utils.h
rename to lib/cpp/src/thrift/protocol/TBase64Utils.h
diff --git a/lib/cpp/src/protocol/TBinaryProtocol.h b/lib/cpp/src/thrift/protocol/TBinaryProtocol.h
similarity index 100%
rename from lib/cpp/src/protocol/TBinaryProtocol.h
rename to lib/cpp/src/thrift/protocol/TBinaryProtocol.h
diff --git a/lib/cpp/src/protocol/TBinaryProtocol.tcc b/lib/cpp/src/thrift/protocol/TBinaryProtocol.tcc
similarity index 100%
rename from lib/cpp/src/protocol/TBinaryProtocol.tcc
rename to lib/cpp/src/thrift/protocol/TBinaryProtocol.tcc
diff --git a/lib/cpp/src/protocol/TCompactProtocol.h b/lib/cpp/src/thrift/protocol/TCompactProtocol.h
similarity index 100%
rename from lib/cpp/src/protocol/TCompactProtocol.h
rename to lib/cpp/src/thrift/protocol/TCompactProtocol.h
diff --git a/lib/cpp/src/protocol/TCompactProtocol.tcc b/lib/cpp/src/thrift/protocol/TCompactProtocol.tcc
similarity index 100%
rename from lib/cpp/src/protocol/TCompactProtocol.tcc
rename to lib/cpp/src/thrift/protocol/TCompactProtocol.tcc
diff --git a/lib/cpp/src/protocol/TDebugProtocol.cpp b/lib/cpp/src/thrift/protocol/TDebugProtocol.cpp
similarity index 100%
rename from lib/cpp/src/protocol/TDebugProtocol.cpp
rename to lib/cpp/src/thrift/protocol/TDebugProtocol.cpp
diff --git a/lib/cpp/src/protocol/TDebugProtocol.h b/lib/cpp/src/thrift/protocol/TDebugProtocol.h
similarity index 98%
rename from lib/cpp/src/protocol/TDebugProtocol.h
rename to lib/cpp/src/thrift/protocol/TDebugProtocol.h
index 3f7877c..f64928e 100644
--- a/lib/cpp/src/protocol/TDebugProtocol.h
+++ b/lib/cpp/src/thrift/protocol/TDebugProtocol.h
@@ -171,7 +171,7 @@
 
 
 // TODO(dreiss): Move (part of) ThriftDebugString into a .cpp file and remove this.
-#include <transport/TBufferTransports.h>
+#include <thrift/transport/TBufferTransports.h>
 
 namespace apache { namespace thrift {
 
diff --git a/lib/cpp/src/protocol/TDenseProtocol.cpp b/lib/cpp/src/thrift/protocol/TDenseProtocol.cpp
similarity index 100%
rename from lib/cpp/src/protocol/TDenseProtocol.cpp
rename to lib/cpp/src/thrift/protocol/TDenseProtocol.cpp
diff --git a/lib/cpp/src/protocol/TDenseProtocol.h b/lib/cpp/src/thrift/protocol/TDenseProtocol.h
similarity index 100%
rename from lib/cpp/src/protocol/TDenseProtocol.h
rename to lib/cpp/src/thrift/protocol/TDenseProtocol.h
diff --git a/lib/cpp/src/protocol/TJSONProtocol.cpp b/lib/cpp/src/thrift/protocol/TJSONProtocol.cpp
similarity index 99%
rename from lib/cpp/src/protocol/TJSONProtocol.cpp
rename to lib/cpp/src/thrift/protocol/TJSONProtocol.cpp
index d038df4..6f1612e 100644
--- a/lib/cpp/src/protocol/TJSONProtocol.cpp
+++ b/lib/cpp/src/thrift/protocol/TJSONProtocol.cpp
@@ -22,7 +22,7 @@
 #include <math.h>
 #include <boost/lexical_cast.hpp>
 #include "TBase64Utils.h"
-#include <transport/TTransportException.h>
+#include <thrift/transport/TTransportException.h>
 
 using namespace apache::thrift::transport;
 
diff --git a/lib/cpp/src/protocol/TJSONProtocol.h b/lib/cpp/src/thrift/protocol/TJSONProtocol.h
similarity index 99%
rename from lib/cpp/src/protocol/TJSONProtocol.h
rename to lib/cpp/src/thrift/protocol/TJSONProtocol.h
index 799c361..0a6f09c 100644
--- a/lib/cpp/src/protocol/TJSONProtocol.h
+++ b/lib/cpp/src/thrift/protocol/TJSONProtocol.h
@@ -314,7 +314,7 @@
 
 
 // TODO(dreiss): Move part of ThriftJSONString into a .cpp file and remove this.
-#include <transport/TBufferTransports.h>
+#include <thrift/transport/TBufferTransports.h>
 
 namespace apache { namespace thrift {
 
diff --git a/lib/cpp/src/protocol/TProtocol.h b/lib/cpp/src/thrift/protocol/TProtocol.h
similarity index 99%
rename from lib/cpp/src/protocol/TProtocol.h
rename to lib/cpp/src/thrift/protocol/TProtocol.h
index dfd5eb5..f6802e6 100644
--- a/lib/cpp/src/protocol/TProtocol.h
+++ b/lib/cpp/src/thrift/protocol/TProtocol.h
@@ -20,8 +20,8 @@
 #ifndef _THRIFT_PROTOCOL_TPROTOCOL_H_
 #define _THRIFT_PROTOCOL_TPROTOCOL_H_ 1
 
-#include <transport/TTransport.h>
-#include <protocol/TProtocolException.h>
+#include <thrift/transport/TTransport.h>
+#include <thrift/protocol/TProtocolException.h>
 
 #include <boost/shared_ptr.hpp>
 #include <boost/static_assert.hpp>
diff --git a/lib/cpp/src/protocol/TProtocolException.h b/lib/cpp/src/thrift/protocol/TProtocolException.h
similarity index 100%
rename from lib/cpp/src/protocol/TProtocolException.h
rename to lib/cpp/src/thrift/protocol/TProtocolException.h
diff --git a/lib/cpp/src/protocol/TProtocolTap.h b/lib/cpp/src/thrift/protocol/TProtocolTap.h
similarity index 98%
rename from lib/cpp/src/protocol/TProtocolTap.h
rename to lib/cpp/src/thrift/protocol/TProtocolTap.h
index 3772bff..f493f88 100644
--- a/lib/cpp/src/protocol/TProtocolTap.h
+++ b/lib/cpp/src/thrift/protocol/TProtocolTap.h
@@ -20,7 +20,7 @@
 #ifndef _THRIFT_PROTOCOL_TPROTOCOLTAP_H_
 #define _THRIFT_PROTOCOL_TPROTOCOLTAP_H_ 1
 
-#include <protocol/TVirtualProtocol.h>
+#include <thrift/protocol/TVirtualProtocol.h>
 
 namespace apache { namespace thrift { namespace protocol {
 
diff --git a/lib/cpp/src/protocol/TVirtualProtocol.h b/lib/cpp/src/thrift/protocol/TVirtualProtocol.h
similarity index 99%
rename from lib/cpp/src/protocol/TVirtualProtocol.h
rename to lib/cpp/src/thrift/protocol/TVirtualProtocol.h
index 6c7f519..e068725 100644
--- a/lib/cpp/src/protocol/TVirtualProtocol.h
+++ b/lib/cpp/src/thrift/protocol/TVirtualProtocol.h
@@ -20,7 +20,7 @@
 #ifndef _THRIFT_PROTOCOL_TVIRTUALPROTOCOL_H_
 #define _THRIFT_PROTOCOL_TVIRTUALPROTOCOL_H_ 1
 
-#include <protocol/TProtocol.h>
+#include <thrift/protocol/TProtocol.h>
 
 namespace apache { namespace thrift { namespace protocol {
 
diff --git a/lib/cpp/src/qt/TQIODeviceTransport.cpp b/lib/cpp/src/thrift/qt/TQIODeviceTransport.cpp
similarity index 97%
rename from lib/cpp/src/qt/TQIODeviceTransport.cpp
rename to lib/cpp/src/thrift/qt/TQIODeviceTransport.cpp
index c03894e..9344e40 100644
--- a/lib/cpp/src/qt/TQIODeviceTransport.cpp
+++ b/lib/cpp/src/thrift/qt/TQIODeviceTransport.cpp
@@ -19,10 +19,10 @@
 
 #include "TQIODeviceTransport.h"
 
-#include <QAbstractSocket>
+#include <thrift/QAbstractSocket>
 #include <QIODevice>
 
-#include <transport/TBufferTransports.h>
+#include <thrift/transport/TBufferTransports.h>
 
 using boost::shared_ptr;
   
diff --git a/lib/cpp/src/qt/TQIODeviceTransport.h b/lib/cpp/src/thrift/qt/TQIODeviceTransport.h
similarity index 97%
rename from lib/cpp/src/qt/TQIODeviceTransport.h
rename to lib/cpp/src/thrift/qt/TQIODeviceTransport.h
index 3d152f4..64faa12 100644
--- a/lib/cpp/src/qt/TQIODeviceTransport.h
+++ b/lib/cpp/src/thrift/qt/TQIODeviceTransport.h
@@ -22,7 +22,7 @@
 
 #include <boost/shared_ptr.hpp>
 
-#include <transport/TVirtualTransport.h>
+#include <thrift/transport/TVirtualTransport.h>
 
 class QIODevice;
 
diff --git a/lib/cpp/src/qt/TQTcpServer.cpp b/lib/cpp/src/thrift/qt/TQTcpServer.cpp
similarity index 98%
rename from lib/cpp/src/qt/TQTcpServer.cpp
rename to lib/cpp/src/thrift/qt/TQTcpServer.cpp
index f08ec3d..2af8fa3 100644
--- a/lib/cpp/src/qt/TQTcpServer.cpp
+++ b/lib/cpp/src/thrift/qt/TQTcpServer.cpp
@@ -24,8 +24,8 @@
 
 #include <tr1/functional>
 
-#include <protocol/TProtocol.h>
-#include <async/TAsyncProcessor.h>
+#include <thrift/protocol/TProtocol.h>
+#include <thrift/async/TAsyncProcessor.h>
 
 using boost::shared_ptr;
 using apache::thrift::protocol::TProtocol;
diff --git a/lib/cpp/src/qt/TQTcpServer.h b/lib/cpp/src/thrift/qt/TQTcpServer.h
similarity index 100%
rename from lib/cpp/src/qt/TQTcpServer.h
rename to lib/cpp/src/thrift/qt/TQTcpServer.h
diff --git a/lib/cpp/src/server/TNonblockingServer.cpp b/lib/cpp/src/thrift/server/TNonblockingServer.cpp
similarity index 99%
rename from lib/cpp/src/server/TNonblockingServer.cpp
rename to lib/cpp/src/thrift/server/TNonblockingServer.cpp
index bd76cfc..3e95508 100644
--- a/lib/cpp/src/server/TNonblockingServer.cpp
+++ b/lib/cpp/src/thrift/server/TNonblockingServer.cpp
@@ -24,9 +24,9 @@
 #endif
 
 #include "TNonblockingServer.h"
-#include <concurrency/Exception.h>
-#include <transport/TSocket.h>
-#include <concurrency/PlatformThreadFactory.h>
+#include <thrift/concurrency/Exception.h>
+#include <thrift/transport/TSocket.h>
+#include <thrift/concurrency/PlatformThreadFactory.h>
 
 #include <iostream>
 
diff --git a/lib/cpp/src/server/TNonblockingServer.h b/lib/cpp/src/thrift/server/TNonblockingServer.h
similarity index 98%
rename from lib/cpp/src/server/TNonblockingServer.h
rename to lib/cpp/src/thrift/server/TNonblockingServer.h
index 6b854b5..e995424 100644
--- a/lib/cpp/src/server/TNonblockingServer.h
+++ b/lib/cpp/src/thrift/server/TNonblockingServer.h
@@ -20,15 +20,15 @@
 #ifndef _THRIFT_SERVER_TNONBLOCKINGSERVER_H_
 #define _THRIFT_SERVER_TNONBLOCKINGSERVER_H_ 1
 
-#include <Thrift.h>
-#include <server/TServer.h>
-#include <transport/TBufferTransports.h>
-#include <transport/TSocket.h>
-#include <concurrency/ThreadManager.h>
+#include <thrift/Thrift.h>
+#include <thrift/server/TServer.h>
+#include <thrift/transport/TBufferTransports.h>
+#include <thrift/transport/TSocket.h>
+#include <thrift/concurrency/ThreadManager.h>
 #include <climits>
-#include <concurrency/Thread.h>
-#include <concurrency/PlatformThreadFactory.h>
-#include <concurrency/Mutex.h>
+#include <thrift/concurrency/Thread.h>
+#include <thrift/concurrency/PlatformThreadFactory.h>
+#include <thrift/concurrency/Mutex.h>
 #include <stack>
 #include <vector>
 #include <string>
diff --git a/lib/cpp/src/server/TServer.cpp b/lib/cpp/src/thrift/server/TServer.cpp
similarity index 100%
rename from lib/cpp/src/server/TServer.cpp
rename to lib/cpp/src/thrift/server/TServer.cpp
diff --git a/lib/cpp/src/server/TServer.h b/lib/cpp/src/thrift/server/TServer.h
similarity index 98%
rename from lib/cpp/src/server/TServer.h
rename to lib/cpp/src/thrift/server/TServer.h
index 42bfc9d..f172ad1 100644
--- a/lib/cpp/src/server/TServer.h
+++ b/lib/cpp/src/thrift/server/TServer.h
@@ -20,10 +20,10 @@
 #ifndef _THRIFT_SERVER_TSERVER_H_
 #define _THRIFT_SERVER_TSERVER_H_ 1
 
-#include <TProcessor.h>
-#include <transport/TServerTransport.h>
-#include <protocol/TBinaryProtocol.h>
-#include <concurrency/Thread.h>
+#include <thrift/TProcessor.h>
+#include <thrift/transport/TServerTransport.h>
+#include <thrift/protocol/TBinaryProtocol.h>
+#include <thrift/concurrency/Thread.h>
 
 #include <boost/shared_ptr.hpp>
 
diff --git a/lib/cpp/src/server/TSimpleServer.cpp b/lib/cpp/src/thrift/server/TSimpleServer.cpp
similarity index 97%
rename from lib/cpp/src/server/TSimpleServer.cpp
rename to lib/cpp/src/thrift/server/TSimpleServer.cpp
index 344945b..b132a66 100644
--- a/lib/cpp/src/server/TSimpleServer.cpp
+++ b/lib/cpp/src/thrift/server/TSimpleServer.cpp
@@ -17,8 +17,8 @@
  * under the License.
  */
 
-#include "server/TSimpleServer.h"
-#include "transport/TTransportException.h"
+#include <thrift/server/TSimpleServer.h>
+#include <thrift/transport/TTransportException.h>
 #include <string>
 #include <iostream>
 
diff --git a/lib/cpp/src/server/TSimpleServer.h b/lib/cpp/src/thrift/server/TSimpleServer.h
similarity index 97%
rename from lib/cpp/src/server/TSimpleServer.h
rename to lib/cpp/src/thrift/server/TSimpleServer.h
index ea40ab0..f9e0e2b 100644
--- a/lib/cpp/src/server/TSimpleServer.h
+++ b/lib/cpp/src/thrift/server/TSimpleServer.h
@@ -20,8 +20,8 @@
 #ifndef _THRIFT_SERVER_TSIMPLESERVER_H_
 #define _THRIFT_SERVER_TSIMPLESERVER_H_ 1
 
-#include "server/TServer.h"
-#include "transport/TServerTransport.h"
+#include <thrift/server/TServer.h>
+#include <thrift/transport/TServerTransport.h>
 
 namespace apache { namespace thrift { namespace server {
 
diff --git a/lib/cpp/src/server/TThreadPoolServer.cpp b/lib/cpp/src/thrift/server/TThreadPoolServer.cpp
similarity index 96%
rename from lib/cpp/src/server/TThreadPoolServer.cpp
rename to lib/cpp/src/thrift/server/TThreadPoolServer.cpp
index fe58ff3..db63951 100644
--- a/lib/cpp/src/server/TThreadPoolServer.cpp
+++ b/lib/cpp/src/thrift/server/TThreadPoolServer.cpp
@@ -21,10 +21,10 @@
 #include <config.h>
 #endif
 
-#include "server/TThreadPoolServer.h"
-#include "transport/TTransportException.h"
-#include "concurrency/Thread.h"
-#include "concurrency/ThreadManager.h"
+#include <thrift/server/TThreadPoolServer.h>
+#include <thrift/transport/TTransportException.h>
+#include <thrift/concurrency/Thread.h>
+#include <thrift/concurrency/ThreadManager.h>
 #include <string>
 #include <iostream>
 
diff --git a/lib/cpp/src/server/TThreadPoolServer.h b/lib/cpp/src/thrift/server/TThreadPoolServer.h
similarity index 96%
rename from lib/cpp/src/server/TThreadPoolServer.h
rename to lib/cpp/src/thrift/server/TThreadPoolServer.h
index b860ae2..48a11cb 100644
--- a/lib/cpp/src/server/TThreadPoolServer.h
+++ b/lib/cpp/src/thrift/server/TThreadPoolServer.h
@@ -20,9 +20,9 @@
 #ifndef _THRIFT_SERVER_TTHREADPOOLSERVER_H_
 #define _THRIFT_SERVER_TTHREADPOOLSERVER_H_ 1
 
-#include <concurrency/ThreadManager.h>
-#include <server/TServer.h>
-#include <transport/TServerTransport.h>
+#include <thrift/concurrency/ThreadManager.h>
+#include <thrift/server/TServer.h>
+#include <thrift/transport/TServerTransport.h>
 
 #include <boost/shared_ptr.hpp>
 
diff --git a/lib/cpp/src/server/TThreadedServer.cpp b/lib/cpp/src/thrift/server/TThreadedServer.cpp
similarity index 97%
rename from lib/cpp/src/server/TThreadedServer.cpp
rename to lib/cpp/src/thrift/server/TThreadedServer.cpp
index e99a909..6ed8fd8 100644
--- a/lib/cpp/src/server/TThreadedServer.cpp
+++ b/lib/cpp/src/thrift/server/TThreadedServer.cpp
@@ -17,9 +17,9 @@
  * under the License.
  */
 
-#include "server/TThreadedServer.h"
-#include "transport/TTransportException.h"
-#include <concurrency/PlatformThreadFactory.h>
+#include <thrift/server/TThreadedServer.h>
+#include <thrift/transport/TTransportException.h>
+#include <thrift/concurrency/PlatformThreadFactory.h>
 
 #include <string>
 #include <iostream>
diff --git a/lib/cpp/src/server/TThreadedServer.h b/lib/cpp/src/thrift/server/TThreadedServer.h
similarity index 96%
rename from lib/cpp/src/server/TThreadedServer.h
rename to lib/cpp/src/thrift/server/TThreadedServer.h
index 2db3fac..42faaf0 100644
--- a/lib/cpp/src/server/TThreadedServer.h
+++ b/lib/cpp/src/thrift/server/TThreadedServer.h
@@ -20,10 +20,10 @@
 #ifndef _THRIFT_SERVER_TTHREADEDSERVER_H_
 #define _THRIFT_SERVER_TTHREADEDSERVER_H_ 1
 
-#include <server/TServer.h>
-#include <transport/TServerTransport.h>
-#include <concurrency/Monitor.h>
-#include <concurrency/Thread.h>
+#include <thrift/server/TServer.h>
+#include <thrift/transport/TServerTransport.h>
+#include <thrift/concurrency/Monitor.h>
+#include <thrift/concurrency/Thread.h>
 
 #include <boost/shared_ptr.hpp>
 
diff --git a/lib/cpp/src/transport/TBufferTransports.cpp b/lib/cpp/src/thrift/transport/TBufferTransports.cpp
similarity index 99%
rename from lib/cpp/src/transport/TBufferTransports.cpp
rename to lib/cpp/src/thrift/transport/TBufferTransports.cpp
index b8a7ec3..a2cc066 100644
--- a/lib/cpp/src/transport/TBufferTransports.cpp
+++ b/lib/cpp/src/thrift/transport/TBufferTransports.cpp
@@ -20,7 +20,7 @@
 #include <cassert>
 #include <algorithm>
 
-#include <transport/TBufferTransports.h>
+#include <thrift/transport/TBufferTransports.h>
 
 using std::string;
 
diff --git a/lib/cpp/src/transport/TBufferTransports.h b/lib/cpp/src/thrift/transport/TBufferTransports.h
similarity index 99%
rename from lib/cpp/src/transport/TBufferTransports.h
rename to lib/cpp/src/thrift/transport/TBufferTransports.h
index 5f8257e..b5570f5 100644
--- a/lib/cpp/src/transport/TBufferTransports.h
+++ b/lib/cpp/src/thrift/transport/TBufferTransports.h
@@ -23,8 +23,8 @@
 #include <cstring>
 #include "boost/scoped_array.hpp"
 
-#include <transport/TTransport.h>
-#include <transport/TVirtualTransport.h>
+#include <thrift/transport/TTransport.h>
+#include <thrift/transport/TVirtualTransport.h>
 
 #ifdef __GNUC__
 #define TDB_LIKELY(val) (__builtin_expect((val), 1))
diff --git a/lib/cpp/src/transport/TFDTransport.cpp b/lib/cpp/src/thrift/transport/TFDTransport.cpp
similarity index 98%
rename from lib/cpp/src/transport/TFDTransport.cpp
rename to lib/cpp/src/thrift/transport/TFDTransport.cpp
index a47e2a4..fb9cc57 100644
--- a/lib/cpp/src/transport/TFDTransport.cpp
+++ b/lib/cpp/src/thrift/transport/TFDTransport.cpp
@@ -20,7 +20,7 @@
 #include <cerrno>
 #include <exception>
 
-#include <transport/TFDTransport.h>
+#include <thrift/transport/TFDTransport.h>
 
 #ifdef HAVE_UNISTD_H
 #include <unistd.h>
diff --git a/lib/cpp/src/transport/TFDTransport.h b/lib/cpp/src/thrift/transport/TFDTransport.h
similarity index 100%
rename from lib/cpp/src/transport/TFDTransport.h
rename to lib/cpp/src/thrift/transport/TFDTransport.h
diff --git a/lib/cpp/src/transport/TFileTransport.cpp b/lib/cpp/src/thrift/transport/TFileTransport.cpp
similarity index 100%
rename from lib/cpp/src/transport/TFileTransport.cpp
rename to lib/cpp/src/thrift/transport/TFileTransport.cpp
diff --git a/lib/cpp/src/transport/TFileTransport.h b/lib/cpp/src/thrift/transport/TFileTransport.h
similarity index 98%
rename from lib/cpp/src/transport/TFileTransport.h
rename to lib/cpp/src/thrift/transport/TFileTransport.h
index b0e48d1..e27f5a6 100644
--- a/lib/cpp/src/transport/TFileTransport.h
+++ b/lib/cpp/src/thrift/transport/TFileTransport.h
@@ -20,9 +20,9 @@
 #ifndef _THRIFT_TRANSPORT_TFILETRANSPORT_H_
 #define _THRIFT_TRANSPORT_TFILETRANSPORT_H_ 1
 
-#include "TTransport.h"
-#include "Thrift.h"
-#include "TProcessor.h"
+#include <thrift/transport/TTransport.h>
+#include <thrift/Thrift.h>
+#include <thrift/TProcessor.h>
 
 #include <string>
 #include <stdio.h>
@@ -38,8 +38,8 @@
 #include <boost/scoped_ptr.hpp>
 #include <boost/shared_ptr.hpp>
 
-#include "concurrency/Mutex.h"
-#include "concurrency/Monitor.h"
+#include <thrift/concurrency/Mutex.h>
+#include <thrift/concurrency/Monitor.h>
 
 namespace apache { namespace thrift { namespace transport {
 
diff --git a/lib/cpp/src/transport/THttpClient.cpp b/lib/cpp/src/thrift/transport/THttpClient.cpp
similarity index 97%
rename from lib/cpp/src/transport/THttpClient.cpp
rename to lib/cpp/src/thrift/transport/THttpClient.cpp
index 04864ce..adfc959 100644
--- a/lib/cpp/src/transport/THttpClient.cpp
+++ b/lib/cpp/src/thrift/transport/THttpClient.cpp
@@ -21,8 +21,8 @@
 #include <sstream>
 #include <boost/algorithm/string.hpp>
 
-#include <transport/THttpClient.h>
-#include <transport/TSocket.h>
+#include <thrift/transport/THttpClient.h>
+#include <thrift/transport/TSocket.h>
 
 namespace apache { namespace thrift { namespace transport {
 
diff --git a/lib/cpp/src/transport/THttpClient.h b/lib/cpp/src/thrift/transport/THttpClient.h
similarity index 96%
rename from lib/cpp/src/transport/THttpClient.h
rename to lib/cpp/src/thrift/transport/THttpClient.h
index 142063d..0898b11 100644
--- a/lib/cpp/src/transport/THttpClient.h
+++ b/lib/cpp/src/thrift/transport/THttpClient.h
@@ -20,7 +20,7 @@
 #ifndef _THRIFT_TRANSPORT_THTTPCLIENT_H_
 #define _THRIFT_TRANSPORT_THTTPCLIENT_H_ 1
 
-#include <transport/THttpTransport.h>
+#include <thrift/transport/THttpTransport.h>
 
 namespace apache { namespace thrift { namespace transport {
 
diff --git a/lib/cpp/src/transport/THttpServer.cpp b/lib/cpp/src/thrift/transport/THttpServer.cpp
similarity index 97%
rename from lib/cpp/src/transport/THttpServer.cpp
rename to lib/cpp/src/thrift/transport/THttpServer.cpp
index 166c0f6..b10e6da 100644
--- a/lib/cpp/src/transport/THttpServer.cpp
+++ b/lib/cpp/src/thrift/transport/THttpServer.cpp
@@ -21,8 +21,8 @@
 #include <sstream>
 #include <iostream>
 
-#include <transport/THttpServer.h>
-#include <transport/TSocket.h>
+#include <thrift/transport/THttpServer.h>
+#include <thrift/transport/TSocket.h>
 
 namespace apache { namespace thrift { namespace transport {
 
diff --git a/lib/cpp/src/transport/THttpServer.h b/lib/cpp/src/thrift/transport/THttpServer.h
similarity index 97%
rename from lib/cpp/src/transport/THttpServer.h
rename to lib/cpp/src/thrift/transport/THttpServer.h
index 6523408..bf69dbe 100644
--- a/lib/cpp/src/transport/THttpServer.h
+++ b/lib/cpp/src/thrift/transport/THttpServer.h
@@ -20,7 +20,7 @@
 #ifndef _THRIFT_TRANSPORT_THTTPSERVER_H_
 #define _THRIFT_TRANSPORT_THTTPSERVER_H_ 1
 
-#include <transport/THttpTransport.h>
+#include <thrift/transport/THttpTransport.h>
 
 namespace apache { namespace thrift { namespace transport {
 
diff --git a/lib/cpp/src/transport/THttpTransport.cpp b/lib/cpp/src/thrift/transport/THttpTransport.cpp
similarity index 98%
rename from lib/cpp/src/transport/THttpTransport.cpp
rename to lib/cpp/src/thrift/transport/THttpTransport.cpp
index 95fe207..3bda20e 100644
--- a/lib/cpp/src/transport/THttpTransport.cpp
+++ b/lib/cpp/src/thrift/transport/THttpTransport.cpp
@@ -17,7 +17,7 @@
  * under the License.
  */
 
-#include <transport/THttpTransport.h>
+#include <thrift/transport/THttpTransport.h>
 
 namespace apache { namespace thrift { namespace transport {
 
diff --git a/lib/cpp/src/transport/THttpTransport.h b/lib/cpp/src/thrift/transport/THttpTransport.h
similarity index 97%
rename from lib/cpp/src/transport/THttpTransport.h
rename to lib/cpp/src/thrift/transport/THttpTransport.h
index 977c65f..9997c93 100644
--- a/lib/cpp/src/transport/THttpTransport.h
+++ b/lib/cpp/src/thrift/transport/THttpTransport.h
@@ -20,7 +20,7 @@
 #ifndef _THRIFT_TRANSPORT_THTTPTRANSPORT_H_
 #define _THRIFT_TRANSPORT_THTTPTRANSPORT_H_ 1
 
-#include <transport/TBufferTransports.h>
+#include <thrift/transport/TBufferTransports.h>
 #include "TVirtualTransport.h"
 
 namespace apache { namespace thrift { namespace transport {
diff --git a/lib/cpp/src/transport/TSSLServerSocket.cpp b/lib/cpp/src/thrift/transport/TSSLServerSocket.cpp
similarity index 100%
rename from lib/cpp/src/transport/TSSLServerSocket.cpp
rename to lib/cpp/src/thrift/transport/TSSLServerSocket.cpp
diff --git a/lib/cpp/src/transport/TSSLServerSocket.h b/lib/cpp/src/thrift/transport/TSSLServerSocket.h
similarity index 100%
rename from lib/cpp/src/transport/TSSLServerSocket.h
rename to lib/cpp/src/thrift/transport/TSSLServerSocket.h
diff --git a/lib/cpp/src/transport/TSSLSocket.cpp b/lib/cpp/src/thrift/transport/TSSLSocket.cpp
similarity index 99%
rename from lib/cpp/src/transport/TSSLSocket.cpp
rename to lib/cpp/src/thrift/transport/TSSLSocket.cpp
index 522d293..14c13dc 100755
--- a/lib/cpp/src/transport/TSSLSocket.cpp
+++ b/lib/cpp/src/thrift/transport/TSSLSocket.cpp
@@ -35,7 +35,7 @@
 #include <openssl/rand.h>
 #include <openssl/ssl.h>
 #include <openssl/x509v3.h>
-#include "concurrency/Mutex.h"
+#include <thrift/concurrency/Mutex.h>
 #include "TSSLSocket.h"
 
 #define OPENSSL_VERSION_NO_THREAD_ID 0x10000000L
diff --git a/lib/cpp/src/transport/TSSLSocket.h b/lib/cpp/src/thrift/transport/TSSLSocket.h
similarity index 99%
rename from lib/cpp/src/transport/TSSLSocket.h
rename to lib/cpp/src/thrift/transport/TSSLSocket.h
index a0a1502..d77c2f5 100755
--- a/lib/cpp/src/transport/TSSLSocket.h
+++ b/lib/cpp/src/thrift/transport/TSSLSocket.h
@@ -23,7 +23,7 @@
 #include <string>
 #include <boost/shared_ptr.hpp>
 #include <openssl/ssl.h>
-#include "concurrency/Mutex.h"
+#include <thrift/concurrency/Mutex.h>
 #include "TSocket.h"
 
 namespace apache { namespace thrift { namespace transport {
diff --git a/lib/cpp/src/transport/TServerSocket.cpp b/lib/cpp/src/thrift/transport/TServerSocket.cpp
similarity index 100%
rename from lib/cpp/src/transport/TServerSocket.cpp
rename to lib/cpp/src/thrift/transport/TServerSocket.cpp
diff --git a/lib/cpp/src/transport/TServerSocket.h b/lib/cpp/src/thrift/transport/TServerSocket.h
similarity index 100%
rename from lib/cpp/src/transport/TServerSocket.h
rename to lib/cpp/src/thrift/transport/TServerSocket.h
diff --git a/lib/cpp/src/transport/TServerTransport.h b/lib/cpp/src/thrift/transport/TServerTransport.h
similarity index 100%
rename from lib/cpp/src/transport/TServerTransport.h
rename to lib/cpp/src/thrift/transport/TServerTransport.h
diff --git a/lib/cpp/src/transport/TShortReadTransport.h b/lib/cpp/src/thrift/transport/TShortReadTransport.h
similarity index 95%
rename from lib/cpp/src/transport/TShortReadTransport.h
rename to lib/cpp/src/thrift/transport/TShortReadTransport.h
index 0d0eb86..b5cdc7d 100644
--- a/lib/cpp/src/transport/TShortReadTransport.h
+++ b/lib/cpp/src/thrift/transport/TShortReadTransport.h
@@ -20,10 +20,10 @@
 #ifndef _THRIFT_TRANSPORT_TSHORTREADTRANSPORT_H_
 #define _THRIFT_TRANSPORT_TSHORTREADTRANSPORT_H_ 1
 
-#include <cstdlib>
+#include <thrift/cstdlib>
 
-#include <transport/TTransport.h>
-#include <transport/TVirtualTransport.h>
+#include <thrift/transport/TTransport.h>
+#include <thrift/transport/TVirtualTransport.h>
 
 namespace apache { namespace thrift { namespace transport { namespace test {
 
diff --git a/lib/cpp/src/transport/TSimpleFileTransport.cpp b/lib/cpp/src/thrift/transport/TSimpleFileTransport.cpp
similarity index 100%
rename from lib/cpp/src/transport/TSimpleFileTransport.cpp
rename to lib/cpp/src/thrift/transport/TSimpleFileTransport.cpp
diff --git a/lib/cpp/src/transport/TSimpleFileTransport.h b/lib/cpp/src/thrift/transport/TSimpleFileTransport.h
similarity index 100%
rename from lib/cpp/src/transport/TSimpleFileTransport.h
rename to lib/cpp/src/thrift/transport/TSimpleFileTransport.h
diff --git a/lib/cpp/src/transport/TSocket.cpp b/lib/cpp/src/thrift/transport/TSocket.cpp
similarity index 99%
rename from lib/cpp/src/transport/TSocket.cpp
rename to lib/cpp/src/thrift/transport/TSocket.cpp
index a0cc77a..3c235d2 100644
--- a/lib/cpp/src/transport/TSocket.cpp
+++ b/lib/cpp/src/thrift/transport/TSocket.cpp
@@ -45,7 +45,7 @@
 #include <errno.h>
 #include <fcntl.h>
 
-#include "concurrency/Monitor.h"
+#include <thrift/concurrency/Monitor.h>
 #include "TSocket.h"
 #include "TTransportException.h"
 
diff --git a/lib/cpp/src/transport/TSocket.h b/lib/cpp/src/thrift/transport/TSocket.h
similarity index 100%
rename from lib/cpp/src/transport/TSocket.h
rename to lib/cpp/src/thrift/transport/TSocket.h
diff --git a/lib/cpp/src/transport/TSocketPool.cpp b/lib/cpp/src/thrift/transport/TSocketPool.cpp
similarity index 100%
rename from lib/cpp/src/transport/TSocketPool.cpp
rename to lib/cpp/src/thrift/transport/TSocketPool.cpp
diff --git a/lib/cpp/src/transport/TSocketPool.h b/lib/cpp/src/thrift/transport/TSocketPool.h
similarity index 100%
rename from lib/cpp/src/transport/TSocketPool.h
rename to lib/cpp/src/thrift/transport/TSocketPool.h
diff --git a/lib/cpp/src/transport/TTransport.h b/lib/cpp/src/thrift/transport/TTransport.h
similarity index 98%
rename from lib/cpp/src/transport/TTransport.h
rename to lib/cpp/src/thrift/transport/TTransport.h
index fa0ed8a..3b552c4 100644
--- a/lib/cpp/src/transport/TTransport.h
+++ b/lib/cpp/src/thrift/transport/TTransport.h
@@ -20,9 +20,9 @@
 #ifndef _THRIFT_TRANSPORT_TTRANSPORT_H_
 #define _THRIFT_TRANSPORT_TTRANSPORT_H_ 1
 
-#include <Thrift.h>
+#include <thrift/Thrift.h>
 #include <boost/shared_ptr.hpp>
-#include <transport/TTransportException.h>
+#include <thrift/transport/TTransportException.h>
 #include <string>
 
 namespace apache { namespace thrift { namespace transport {
diff --git a/lib/cpp/src/transport/TTransportException.cpp b/lib/cpp/src/thrift/transport/TTransportException.cpp
similarity index 95%
rename from lib/cpp/src/transport/TTransportException.cpp
rename to lib/cpp/src/thrift/transport/TTransportException.cpp
index f0aaedc..e24198a 100644
--- a/lib/cpp/src/transport/TTransportException.cpp
+++ b/lib/cpp/src/thrift/transport/TTransportException.cpp
@@ -17,7 +17,7 @@
  * under the License.
  */
 
-#include <transport/TTransportException.h>
+#include <thrift/transport/TTransportException.h>
 #include <boost/lexical_cast.hpp>
 #include <cstring>
 #include <config.h>
diff --git a/lib/cpp/src/transport/TTransportException.h b/lib/cpp/src/thrift/transport/TTransportException.h
similarity index 98%
rename from lib/cpp/src/transport/TTransportException.h
rename to lib/cpp/src/thrift/transport/TTransportException.h
index e0630ef..028dbb8 100644
--- a/lib/cpp/src/transport/TTransportException.h
+++ b/lib/cpp/src/thrift/transport/TTransportException.h
@@ -21,7 +21,7 @@
 #define _THRIFT_TRANSPORT_TTRANSPORTEXCEPTION_H_ 1
 
 #include <string>
-#include <Thrift.h>
+#include <thrift/Thrift.h>
 
 namespace apache { namespace thrift { namespace transport {
 
diff --git a/lib/cpp/src/transport/TTransportUtils.cpp b/lib/cpp/src/thrift/transport/TTransportUtils.cpp
similarity index 98%
rename from lib/cpp/src/transport/TTransportUtils.cpp
rename to lib/cpp/src/thrift/transport/TTransportUtils.cpp
index 72289bc..44f6101 100644
--- a/lib/cpp/src/transport/TTransportUtils.cpp
+++ b/lib/cpp/src/thrift/transport/TTransportUtils.cpp
@@ -17,7 +17,7 @@
  * under the License.
  */
 
-#include <transport/TTransportUtils.h>
+#include <thrift/transport/TTransportUtils.h>
 
 using std::string;
 
diff --git a/lib/cpp/src/transport/TTransportUtils.h b/lib/cpp/src/thrift/transport/TTransportUtils.h
similarity index 98%
rename from lib/cpp/src/transport/TTransportUtils.h
rename to lib/cpp/src/thrift/transport/TTransportUtils.h
index d7cdaad..aa294b4 100644
--- a/lib/cpp/src/transport/TTransportUtils.h
+++ b/lib/cpp/src/thrift/transport/TTransportUtils.h
@@ -24,10 +24,10 @@
 #include <cstring>
 #include <string>
 #include <algorithm>
-#include <transport/TTransport.h>
+#include <thrift/transport/TTransport.h>
 // Include the buffered transports that used to be defined here.
-#include <transport/TBufferTransports.h>
-#include <transport/TFileTransport.h>
+#include <thrift/transport/TBufferTransports.h>
+#include <thrift/transport/TFileTransport.h>
 
 namespace apache { namespace thrift { namespace transport {
 
diff --git a/lib/cpp/src/transport/TVirtualTransport.h b/lib/cpp/src/thrift/transport/TVirtualTransport.h
similarity index 98%
rename from lib/cpp/src/transport/TVirtualTransport.h
rename to lib/cpp/src/thrift/transport/TVirtualTransport.h
index 1760681..575f547 100644
--- a/lib/cpp/src/transport/TVirtualTransport.h
+++ b/lib/cpp/src/thrift/transport/TVirtualTransport.h
@@ -20,7 +20,7 @@
 #ifndef _THRIFT_TRANSPORT_TVIRTUALTRANSPORT_H_
 #define _THRIFT_TRANSPORT_TVIRTUALTRANSPORT_H_ 1
 
-#include <transport/TTransport.h>
+#include <thrift/transport/TTransport.h>
 
 namespace apache { namespace thrift { namespace transport {
 
diff --git a/lib/cpp/src/transport/TZlibTransport.cpp b/lib/cpp/src/thrift/transport/TZlibTransport.cpp
similarity index 99%
rename from lib/cpp/src/transport/TZlibTransport.cpp
rename to lib/cpp/src/thrift/transport/TZlibTransport.cpp
index be65288..fc407cb 100644
--- a/lib/cpp/src/transport/TZlibTransport.cpp
+++ b/lib/cpp/src/thrift/transport/TZlibTransport.cpp
@@ -20,7 +20,7 @@
 #include <cassert>
 #include <cstring>
 #include <algorithm>
-#include <transport/TZlibTransport.h>
+#include <thrift/transport/TZlibTransport.h>
 #include <zlib.h>
 
 using std::string;
diff --git a/lib/cpp/src/transport/TZlibTransport.h b/lib/cpp/src/thrift/transport/TZlibTransport.h
similarity index 98%
rename from lib/cpp/src/transport/TZlibTransport.h
rename to lib/cpp/src/thrift/transport/TZlibTransport.h
index db76523..b365641 100644
--- a/lib/cpp/src/transport/TZlibTransport.h
+++ b/lib/cpp/src/thrift/transport/TZlibTransport.h
@@ -21,8 +21,8 @@
 #define _THRIFT_TRANSPORT_TZLIBTRANSPORT_H_ 1
 
 #include <boost/lexical_cast.hpp>
-#include <transport/TTransport.h>
-#include <transport/TVirtualTransport.h>
+#include <thrift/transport/TTransport.h>
+#include <thrift/transport/TVirtualTransport.h>
 
 struct z_stream_s;
 
diff --git a/lib/cpp/src/windows/GetTimeOfDay.cpp b/lib/cpp/src/thrift/windows/GetTimeOfDay.cpp
similarity index 100%
rename from lib/cpp/src/windows/GetTimeOfDay.cpp
rename to lib/cpp/src/thrift/windows/GetTimeOfDay.cpp
diff --git a/lib/cpp/src/windows/GetTimeOfDay.h b/lib/cpp/src/thrift/windows/GetTimeOfDay.h
similarity index 100%
rename from lib/cpp/src/windows/GetTimeOfDay.h
rename to lib/cpp/src/thrift/windows/GetTimeOfDay.h
diff --git a/lib/cpp/src/windows/Operators.h b/lib/cpp/src/thrift/windows/Operators.h
similarity index 100%
rename from lib/cpp/src/windows/Operators.h
rename to lib/cpp/src/thrift/windows/Operators.h
diff --git a/lib/cpp/src/windows/SocketPair.cpp b/lib/cpp/src/thrift/windows/SocketPair.cpp
similarity index 100%
rename from lib/cpp/src/windows/SocketPair.cpp
rename to lib/cpp/src/thrift/windows/SocketPair.cpp
diff --git a/lib/cpp/src/windows/SocketPair.h b/lib/cpp/src/thrift/windows/SocketPair.h
similarity index 100%
rename from lib/cpp/src/windows/SocketPair.h
rename to lib/cpp/src/thrift/windows/SocketPair.h
diff --git a/lib/cpp/src/windows/StdAfx.cpp b/lib/cpp/src/thrift/windows/StdAfx.cpp
similarity index 100%
rename from lib/cpp/src/windows/StdAfx.cpp
rename to lib/cpp/src/thrift/windows/StdAfx.cpp
diff --git a/lib/cpp/src/windows/StdAfx.h b/lib/cpp/src/thrift/windows/StdAfx.h
similarity index 100%
rename from lib/cpp/src/windows/StdAfx.h
rename to lib/cpp/src/thrift/windows/StdAfx.h
diff --git a/lib/cpp/src/windows/TWinsockSingleton.cpp b/lib/cpp/src/thrift/windows/TWinsockSingleton.cpp
similarity index 100%
rename from lib/cpp/src/windows/TWinsockSingleton.cpp
rename to lib/cpp/src/thrift/windows/TWinsockSingleton.cpp
diff --git a/lib/cpp/src/windows/TWinsockSingleton.h b/lib/cpp/src/thrift/windows/TWinsockSingleton.h
similarity index 100%
rename from lib/cpp/src/windows/TWinsockSingleton.h
rename to lib/cpp/src/thrift/windows/TWinsockSingleton.h
diff --git a/lib/cpp/src/windows/TargetVersion.h b/lib/cpp/src/thrift/windows/TargetVersion.h
similarity index 100%
rename from lib/cpp/src/windows/TargetVersion.h
rename to lib/cpp/src/thrift/windows/TargetVersion.h
diff --git a/lib/cpp/src/windows/WinFcntl.cpp b/lib/cpp/src/thrift/windows/WinFcntl.cpp
similarity index 100%
rename from lib/cpp/src/windows/WinFcntl.cpp
rename to lib/cpp/src/thrift/windows/WinFcntl.cpp
diff --git a/lib/cpp/src/windows/WinFcntl.h b/lib/cpp/src/thrift/windows/WinFcntl.h
similarity index 100%
rename from lib/cpp/src/windows/WinFcntl.h
rename to lib/cpp/src/thrift/windows/WinFcntl.h
diff --git a/lib/cpp/src/windows/config.h b/lib/cpp/src/thrift/windows/config.h
similarity index 100%
rename from lib/cpp/src/windows/config.h
rename to lib/cpp/src/thrift/windows/config.h
diff --git a/lib/cpp/src/windows/force_inc.h b/lib/cpp/src/thrift/windows/force_inc.h
similarity index 97%
rename from lib/cpp/src/windows/force_inc.h
rename to lib/cpp/src/thrift/windows/force_inc.h
index 803d132..f9af312 100644
--- a/lib/cpp/src/windows/force_inc.h
+++ b/lib/cpp/src/thrift/windows/force_inc.h
@@ -42,7 +42,7 @@
 #  define _WIN32_WINNT 0x0601
 #endif
 
-#include "windows/config.h"
+#include <thrift/windows/config.h>
 
 #undef gai_strerror
 #define gai_strerror gai_strerrorA
diff --git a/lib/cpp/src/windows/tr1/functional b/lib/cpp/src/thrift/windows/tr1/functional
similarity index 100%
rename from lib/cpp/src/windows/tr1/functional
rename to lib/cpp/src/thrift/windows/tr1/functional
diff --git a/lib/cpp/src/transport/TPipe.cpp b/lib/cpp/src/transport/TPipe.cpp
deleted file mode 100644
index 2c7cf56..0000000
--- a/lib/cpp/src/transport/TPipe.cpp
+++ /dev/null
@@ -1,209 +0,0 @@
-/*
-* Licensed to the Apache Software Foundation (ASF) under one
-* or more contributor license agreements. See the NOTICE file
-* distributed with this work for additional information
-* regarding copyright ownership. The ASF licenses this file
-* to you under the Apache License, Version 2.0 (the
-* "License"); you may not use this file except in compliance
-* with the License. You may obtain a copy of the License at
-*
-*   http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing,
-* software distributed under the License is distributed on an
-* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-* KIND, either express or implied. See the License for the
-* specific language governing permissions and limitations
-* under the License.
-*/
-
-#ifdef _WIN32
-
-#include "TTransportException.h"
-#include "TPipe.h"
-
-namespace apache { namespace thrift { namespace transport {
-
-using namespace std;
-
-/**
-* TPipe implementation.
-*/
-
-//---- Constructors ----
-TPipe::TPipe(HANDLE hpipe) :
-  pipename_(""),
-  hPipe_(hpipe),
-  TimeoutSeconds_(3),
-  isAnonymous(false)
-{}
-
-TPipe::TPipe(string pipename) :
-  pipename_(pipename),
-  hPipe_(INVALID_HANDLE_VALUE),
-  TimeoutSeconds_(3),
-  isAnonymous(false)
-{}
-
-TPipe::TPipe(HANDLE hPipeRd, HANDLE hPipeWrt) :
-  pipename_(""),
-  hPipe_(hPipeRd),
-  hPipeWrt_(hPipeWrt),
-  TimeoutSeconds_(3),
-  isAnonymous(true)
-{}
-
-  TPipe::TPipe() :
-  pipename_(""),
-  hPipe_(INVALID_HANDLE_VALUE),
-  TimeoutSeconds_(3)
-{}
-
-//---- Destructor ----
-TPipe::~TPipe() {
-  close();
-}
-
-
-bool TPipe::isOpen() {
-  return (hPipe_ != INVALID_HANDLE_VALUE);
-}
-
-//---------------------------------------------------------
-// Transport callbacks
-//---------------------------------------------------------
-
-bool TPipe::peek() {
-  if (!isOpen()) {
-    return false;
-  }
-  DWORD bytesavail = 0;
-  int  PeekRet = 0;
-  PeekRet = PeekNamedPipe(hPipe_, NULL, 0, NULL, &bytesavail, NULL); 
-  return (PeekRet != 0 && bytesavail > 0);
-}
-
-void TPipe::open() {
-  if (isOpen()) {
-    return;
-  }
-
-  int SleepInterval = 500; //ms
-  int retries = TimeoutSeconds_ * 1000 / SleepInterval;
-  for(int i=0; i<retries; i++)
-  {
-    hPipe_ = CreateFile( 
-              pipename_.c_str(),
-              GENERIC_READ | GENERIC_WRITE, 
-              0,              // no sharing 
-              NULL,           // default security attributes
-              OPEN_EXISTING,  // opens existing pipe 
-              0,              // default attributes 
-              NULL);          // no template file 
-
-    if (hPipe_ == INVALID_HANDLE_VALUE) 
-      sleep(SleepInterval);
-    else
-      break;
-  }
-  if (hPipe_ == INVALID_HANDLE_VALUE) 
-    throw TTransportException(TTransportException::NOT_OPEN, "Unable to open pipe");
-
-  // The pipe connected; change to message-read mode. 
-  DWORD dwMode = PIPE_READMODE_MESSAGE; 
-  int fSuccess = SetNamedPipeHandleState( 
-              hPipe_,   // pipe handle 
-              &dwMode,  // new pipe mode 
-              NULL,     // don't set maximum bytes 
-              NULL);    // don't set maximum time 
-  if (fSuccess == 0)
-  {
-    throw TTransportException(TTransportException::NOT_OPEN, "SetNamedPipeHandleState failed");
-    close();
-  }
-}
-
-
-void TPipe::close() {
-  if (isOpen())
-  {
-    CloseHandle(hPipe_);
-    hPipe_ = INVALID_HANDLE_VALUE;
-  }
-}
-
-uint32_t TPipe::read(uint8_t* buf, uint32_t len) {
-  if (!isOpen())
-    throw TTransportException(TTransportException::NOT_OPEN, "Called read on non-open pipe");
-
-  DWORD  cbRead; 
-  int fSuccess = ReadFile( 
-              hPipe_,   // pipe handle 
-              buf,      // buffer to receive reply 
-              len,      // size of buffer 
-              &cbRead,  // number of bytes read 
-              NULL);    // not overlapped 
-
-  if ( !fSuccess && GetLastError() != ERROR_MORE_DATA )
-    return 0; // No more data, possibly because client disconnected.
-
-  return cbRead;
-}
-
-void TPipe::write(const uint8_t* buf, uint32_t len) {
-  if (!isOpen())
-    throw TTransportException(TTransportException::NOT_OPEN, "Called write on non-open pipe");
-
-  HANDLE WritePipe = isAnonymous? hPipeWrt_: hPipe_;
-  DWORD  cbWritten; 
-  int fSuccess = WriteFile( 
-              WritePipe,     // pipe handle 
-              buf,        // message 
-              len,        // message length 
-              &cbWritten, // bytes written 
-              NULL);      // not overlapped 
-
-  if ( !fSuccess) 
-    throw TTransportException(TTransportException::NOT_OPEN, "Write to pipe failed");
-}
-
-
-//---------------------------------------------------------
-// Accessors
-//---------------------------------------------------------
-
-string TPipe::getPipename() {
-  return pipename_;
-}
-
-void TPipe::setPipename(std::string pipename) {
-  pipename_ = pipename;
-}
-
-HANDLE TPipe::getPipeHandle() {
-  return hPipe_;
-}
-
-void TPipe::setPipeHandle(HANDLE pipehandle) {
-  hPipe_ = pipehandle;
-}
-
-HANDLE TPipe::getWrtPipeHandle() {
-  return hPipeWrt_;
-}
-
-void TPipe::setWrtPipeHandle(HANDLE pipehandle) {
-  hPipeWrt_ = pipehandle;
-}
-
-long TPipe::getConnectTimeout() {
-  return TimeoutSeconds_;
-}
-
-void TPipe::setConnectTimeout(long seconds) {
-  TimeoutSeconds_ = seconds;
-}
-
-}}} // apache::thrift::transport
-
-#endif //_WIN32
diff --git a/lib/cpp/src/transport/TPipe.h b/lib/cpp/src/transport/TPipe.h
deleted file mode 100644
index bca3e27..0000000
--- a/lib/cpp/src/transport/TPipe.h
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#ifndef _THRIFT_TRANSPORT_TPIPE_H_
-#define _THRIFT_TRANSPORT_TPIPE_H_ 1
-#ifdef _WIN32
-
-#include "TTransport.h"
-#include "TVirtualTransport.h"
-
-namespace apache { namespace thrift { namespace transport {
-
-/**
- * Windows Pipes implementation of the TTransport interface.
- *
- */
-class TPipe : public TVirtualTransport<TPipe> {
- public:
-
-  // Constructs a new pipe object.
-  TPipe();
-  // Named pipe constructors -
-  TPipe(HANDLE hPipe);
-  TPipe(std::string path);
-  // Anonymous pipe -
-  TPipe(HANDLE hPipeRd, HANDLE hPipeWrt);
-
-  // Destroys the pipe object, closing it if necessary.
-  virtual ~TPipe();
-
-  // Returns whether the pipe is open & valid.
-  virtual bool isOpen();
-
-  // Checks whether more data is available in the pipe.
-  virtual bool peek();
-
-  // Creates and opens the named/anonymous pipe.
-  virtual void open();
-
-  // Shuts down communications on the pipe.
-  virtual void close();
-
-  // Reads from the pipe.
-  virtual uint32_t read(uint8_t* buf, uint32_t len);
-
-  // Writes to the pipe.
-  virtual void write(const uint8_t* buf, uint32_t len);
-
-
-  //Accessors
-  std::string getPipename();
-  void setPipename(std::string pipename);
-  HANDLE getPipeHandle(); //doubles as the read handle for anon pipe
-  void setPipeHandle(HANDLE pipehandle);
-  HANDLE getWrtPipeHandle();
-  void setWrtPipeHandle(HANDLE pipehandle);
-  long getConnectTimeout();
-  void setConnectTimeout(long seconds);
-
- private:
-  std::string pipename_;
-  //Named pipe handles are R/W, while anonymous pipes are one or the other (half duplex).
-  HANDLE hPipe_, hPipeWrt_;
-  long TimeoutSeconds_;
-  bool isAnonymous;
-
-};
-
-}}} // apache::thrift::transport
-
-#endif //_WIN32
-#endif // #ifndef _THRIFT_TRANSPORT_TPIPE_H_
-
diff --git a/lib/cpp/src/transport/TPipeServer.cpp b/lib/cpp/src/transport/TPipeServer.cpp
deleted file mode 100644
index 6f2f73d..0000000
--- a/lib/cpp/src/transport/TPipeServer.cpp
+++ /dev/null
@@ -1,313 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#ifdef _WIN32
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-#include <cstring>
-
-#include "TPipe.h"
-#include "TPipeServer.h"
-#include <boost/shared_ptr.hpp>
-#include <AccCtrl.h>
-#include <Aclapi.h>
-
-namespace apache { namespace thrift { namespace transport {
-
-using namespace std;
-using boost::shared_ptr;
-
-//---- Constructors ----
-TPipeServer::TPipeServer(string pipename, uint32_t bufsize) :
-  pipename_(pipename),
-  bufsize_(bufsize),
-  hPipe_(INVALID_HANDLE_VALUE),
-  isAnonymous(false),
-  maxconns_(TPIPE_SERVER_MAX_CONNS_DEFAULT)
- {}
-
-TPipeServer::TPipeServer(string pipename, uint32_t bufsize, uint32_t maxconnections) :
-  pipename_(pipename),
-  bufsize_(bufsize),
-  hPipe_(INVALID_HANDLE_VALUE),
-  isAnonymous(false)
- {  //Restrict maxconns_ to 1-255
-    if(maxconnections == 0)
-      maxconns_ = 1;
-    else if (maxconnections > 255)
-      maxconns_ = 255;
-	else
-      maxconns_ = maxconnections;
- }
-
-TPipeServer::TPipeServer(string pipename) :
-  pipename_(pipename),
-  bufsize_(1024),
-  hPipe_(INVALID_HANDLE_VALUE),
-  isAnonymous(false),
-  maxconns_(TPIPE_SERVER_MAX_CONNS_DEFAULT)
- {}
-
-TPipeServer::TPipeServer(int bufsize) : 
-  pipename_(""),
-  bufsize_(bufsize),
-  hPipe_(INVALID_HANDLE_VALUE),
-  isAnonymous(true),
-  maxconns_(1)
- {
-  //The anonymous pipe needs to be created first so that the server can
-  //pass the handles on to the client before the serve (acceptImpl)
-  //blocking call.
-  if (!TCreateAnonPipe()) {
-    GlobalOutput.perror("TPipeServer Create(Anon)Pipe failed, GLE=", GetLastError());
-    throw TTransportException(TTransportException::NOT_OPEN, " TPipeServer Create(Anon)Pipe failed");
-  }
-}
-
-TPipeServer::TPipeServer() : 
-  pipename_(""),
-  bufsize_(1024),
-  hPipe_(INVALID_HANDLE_VALUE),
-  isAnonymous(true),
-  maxconns_(1)
-{
-  if (!TCreateAnonPipe()) {
-    GlobalOutput.perror("TPipeServer Create(Anon)Pipe failed, GLE=", GetLastError());
-    throw TTransportException(TTransportException::NOT_OPEN, " TPipeServer Create(Anon)Pipe failed");
-  }
-}
-
-//---- Destructor ----
-TPipeServer::~TPipeServer() {
-  close();
-}
-
-//---------------------------------------------------------
-// Transport callbacks
-//---------------------------------------------------------
-
-shared_ptr<TTransport> TPipeServer::acceptImpl() {
-  shared_ptr<TPipe> client;
-
-  if(isAnonymous)
-  { //Anonymous Pipe
-    //This 0-byte read serves merely as a blocking call.
-    byte buf;
-    DWORD br;
-    int fSuccess = ReadFile( 
-          hPipe_, // pipe handle 
-          &buf,   // buffer to receive reply 
-          0,      // size of buffer 
-          &br,    // number of bytes read 
-          NULL);  // not overlapped
-
-    if ( !fSuccess && GetLastError() != ERROR_MORE_DATA ) {
-      GlobalOutput.perror("TPipeServer unable to initiate pipe comms, GLE=", GetLastError());
-      throw TTransportException(TTransportException::NOT_OPEN, " TPipeServer unable to initiate pipe comms");
-    }
-	client.reset(new TPipe(hPipe_, hPipeW_));
-  }
-  else
-  { //Named Pipe
-    int ConnectRet;
-    while (true)
-    {
-      if (!TCreateNamedPipe()) {
-        GlobalOutput.perror("TPipeServer CreateNamedPipe failed, GLE=", GetLastError());
-        throw TTransportException(TTransportException::NOT_OPEN, " TPipeServer CreateNamedPipe failed");
-      }
-
-      // Wait for the client to connect; if it succeeds, the
-      // function returns a nonzero value. If the function returns 
-      // zero, GetLastError should return ERROR_PIPE_CONNECTED. 
-      ConnectRet = ConnectNamedPipe(hPipe_, NULL) ? 
-                    TRUE : (GetLastError() == ERROR_PIPE_CONNECTED);
-
-      if (ConnectRet == TRUE)
-      {
-        GlobalOutput.printf("Client connected.");
-        break;
-      }
-      else
-      {
-        close();
-        GlobalOutput.perror("TPipeServer ConnectNamedPipe GLE=", GetLastError());
-        throw TTransportException(TTransportException::NOT_OPEN, "TPipeServer: client connection failed");
-      }
-    }
-	client.reset(new TPipe(hPipe_));
-  }
-
-  return client;
-}
-
-void TPipeServer::interrupt() {
-  if(hPipe_ != INVALID_HANDLE_VALUE) {
-    CancelIo(hPipe_);
-  }
-}
-
-void TPipeServer::close() {
-  if(!isAnonymous)
-  {
-    if(hPipe_ != INVALID_HANDLE_VALUE) {
-      DisconnectNamedPipe(hPipe_);
-      CloseHandle(hPipe_);
-      hPipe_ = INVALID_HANDLE_VALUE;
-    }
-  }
-  else
-  {
-    try {
-      CloseHandle(hPipe_);
-      CloseHandle(hPipeW_);
-      CloseHandle(ClientAnonRead);
-      CloseHandle(ClientAnonWrite);
-    }
-    catch(...) {
-        GlobalOutput.perror("TPipeServer anon close GLE=", GetLastError());
-    }
-  }
-}
-
-
-bool TPipeServer::TCreateNamedPipe() {
-
-  //Windows - set security to allow non-elevated apps
-  //to access pipes created by elevated apps.
-  SID_IDENTIFIER_AUTHORITY SIDAuthWorld = SECURITY_WORLD_SID_AUTHORITY;
-  PSID everyone_sid = NULL;
-  AllocateAndInitializeSid(&SIDAuthWorld, 1, SECURITY_WORLD_RID, 0, 0, 0, 0, 0, 0, 0, &everyone_sid);
-
-  EXPLICIT_ACCESS ea;
-  ZeroMemory(&ea, sizeof(EXPLICIT_ACCESS));
-  ea.grfAccessPermissions = SPECIFIC_RIGHTS_ALL | STANDARD_RIGHTS_ALL;
-  ea.grfAccessMode = SET_ACCESS;
-  ea.grfInheritance = NO_INHERITANCE;
-  ea.Trustee.TrusteeForm = TRUSTEE_IS_SID;
-  ea.Trustee.TrusteeType = TRUSTEE_IS_WELL_KNOWN_GROUP;
-  ea.Trustee.ptstrName  = (LPSTR)everyone_sid;
-
-  PACL acl = NULL;
-  SetEntriesInAcl(1, &ea, NULL, &acl);
-
-  PSECURITY_DESCRIPTOR sd = (PSECURITY_DESCRIPTOR)LocalAlloc(LPTR,SECURITY_DESCRIPTOR_MIN_LENGTH);
-  InitializeSecurityDescriptor(sd, SECURITY_DESCRIPTOR_REVISION);
-  SetSecurityDescriptorDacl(sd, TRUE, acl, FALSE);
-
-  SECURITY_ATTRIBUTES sa;
-  sa.nLength = sizeof(SECURITY_ATTRIBUTES);
-  sa.lpSecurityDescriptor = sd;
-  sa.bInheritHandle = FALSE;
-
-  // Create an instance of the named pipe
-  hPipe_ = CreateNamedPipe( 
-        pipename_.c_str(),        // pipe name 
-        PIPE_ACCESS_DUPLEX,       // read/write access 
-        PIPE_TYPE_MESSAGE |       // message type pipe 
-        PIPE_READMODE_MESSAGE,    // message-read mode 
-        maxconns_,                // max. instances  
-        bufsize_,                 // output buffer size 
-        bufsize_,                 // input buffer size 
-        0,                        // client time-out 
-        &sa);                     // default security attribute 
-
-  return (hPipe_ != INVALID_HANDLE_VALUE);
-}
-
-bool TPipeServer::TCreateAnonPipe() {
-  SECURITY_ATTRIBUTES sa;
-  SECURITY_DESCRIPTOR sd; //security information for pipes
-
-  InitializeSecurityDescriptor(&sd,SECURITY_DESCRIPTOR_REVISION);
-  SetSecurityDescriptorDacl(&sd, true, NULL, false);
-  sa.lpSecurityDescriptor = &sd;
-  sa.lpSecurityDescriptor = NULL;
-  sa.nLength = sizeof(SECURITY_ATTRIBUTES);
-  sa.bInheritHandle = true; //allow passing handle to child
-
-  if (!CreatePipe(&ClientAnonRead,&hPipeW_,&sa,0))   //create stdin pipe
-  {
-    GlobalOutput.perror("TPipeServer CreatePipe (anon) failed, GLE=", GetLastError());
-    return false;
-  }
-  if (!CreatePipe(&hPipe_,&ClientAnonWrite,&sa,0))  //create stdout pipe
-  {
-    GlobalOutput.perror("TPipeServer CreatePipe (anon) failed, GLE=", GetLastError());
-    CloseHandle(ClientAnonRead);
-    CloseHandle(hPipeW_);
-    return false;
-  }
-
-  return true;
-}
-
-
-//---------------------------------------------------------
-// Accessors
-//---------------------------------------------------------
-
-string TPipeServer::getPipename() {
-  return pipename_;
-}
-
-void TPipeServer::setPipename(std::string pipename) {
-  pipename_ = pipename;
-}
-
-int  TPipeServer::getBufferSize() {
-  return bufsize_;
-}
-
-void TPipeServer::setBufferSize(int bufsize) {
-  bufsize_ = bufsize;
-}
-
-HANDLE TPipeServer::getPipeHandle() {
-  return hPipe_;
-}
-
-HANDLE TPipeServer::getWrtPipeHandle()
-{
-  return hPipeW_;
-}
-
-HANDLE TPipeServer::getClientRdPipeHandle()
-{
-  return ClientAnonRead;
-}
-
-HANDLE TPipeServer::getClientWrtPipeHandle()
-{
-  return ClientAnonWrite;
-}
-
-bool TPipeServer::getAnonymous() {
-  return isAnonymous;
-}
-
-void TPipeServer::setAnonymous(bool anon) {
-  isAnonymous = anon;
-}
-
-}}} // apache::thrift::transport
-
-#endif //_WIN32
diff --git a/lib/cpp/src/transport/TPipeServer.h b/lib/cpp/src/transport/TPipeServer.h
deleted file mode 100644
index 1732546..0000000
--- a/lib/cpp/src/transport/TPipeServer.h
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#ifndef _THRIFT_TRANSPORT_TSERVERWINPIPES_H_
-#define _THRIFT_TRANSPORT_TSERVERWINPIPES_H_ 1
-#ifdef _WIN32
-
-#include "TServerTransport.h"
-#include <boost/shared_ptr.hpp>
-
-#define TPIPE_SERVER_MAX_CONNS_DEFAULT 10
-
-namespace apache { namespace thrift { namespace transport {
-
-/**
- * Windows Pipes implementation of TServerTransport.
- */
-class TPipeServer : public TServerTransport {
- public:
-  //Constructors
-  // Named Pipe -
-  TPipeServer(std::string pipename, uint32_t bufsize);
-  TPipeServer(std::string pipename, uint32_t bufsize, uint32_t maxconnections);
-  TPipeServer(std::string pipename);
-  // Anonymous pipe -
-  TPipeServer(int bufsize);
-  TPipeServer();
-
-  //Destructor
-  ~TPipeServer();
-
-  //Standard transport callbacks
-  //void listen(); //Unnecessary for Windows pipes
-  void interrupt();
-  void close();
- protected:
-  boost::shared_ptr<TTransport> acceptImpl();
-
-  bool TCreateNamedPipe();
-  bool TCreateAnonPipe();
-
- public:
-  //Accessors
-  std::string getPipename();
-  void setPipename(std::string pipename);
-  int  getBufferSize();
-  void setBufferSize(int bufsize);
-  HANDLE getPipeHandle();  //Named Pipe R/W -or- Anonymous pipe Read handle
-  HANDLE getWrtPipeHandle();
-  HANDLE getClientRdPipeHandle();
-  HANDLE getClientWrtPipeHandle();
-  bool getAnonymous();
-  void setAnonymous(bool anon);
-
- private:
-  std::string pipename_;
-  uint32_t bufsize_;
-  uint32_t maxconns_;
-  HANDLE hPipe_;  //Named Pipe (R/W) or Anonymous Pipe (R)
-  HANDLE hPipeW_; //Anonymous Pipe (W)
-  HANDLE ClientAnonRead, ClientAnonWrite; //Client side anonymous pipe handles
-  //? Do we need duplicates to send to client?
-  bool isAnonymous;
-};
-
-}}} // apache::thrift::transport
-
-#endif //_WIN32
-#endif // #ifndef _THRIFT_TRANSPORT_TSERVERWINPIPES_H_
diff --git a/lib/cpp/test/AllProtocolTests.cpp b/lib/cpp/test/AllProtocolTests.cpp
index 8fec7f5..65d1927 100644
--- a/lib/cpp/test/AllProtocolTests.cpp
+++ b/lib/cpp/test/AllProtocolTests.cpp
@@ -19,9 +19,9 @@
 
 #include <stdio.h>
 
-#include <protocol/TBinaryProtocol.h>
-#include <protocol/TCompactProtocol.h>
-#include <transport/TBufferTransports.h>
+#include <thrift/protocol/TBinaryProtocol.h>
+#include <thrift/protocol/TCompactProtocol.h>
+#include <thrift/transport/TBufferTransports.h>
 #include "AllProtocolTests.tcc"
 
 using namespace apache::thrift;
diff --git a/lib/cpp/test/AllProtocolTests.tcc b/lib/cpp/test/AllProtocolTests.tcc
index a5a3115..82f8738 100644
--- a/lib/cpp/test/AllProtocolTests.tcc
+++ b/lib/cpp/test/AllProtocolTests.tcc
@@ -20,11 +20,11 @@
 #ifndef _THRIFT_TEST_GENERICPROTOCOLTEST_TCC_
 #define _THRIFT_TEST_GENERICPROTOCOLTEST_TCC_ 1
 
-#include <limits>
+#include <thrift/limits>
 
-#include <protocol/TBinaryProtocol.h>
-#include <transport/TBufferTransports.h>
-#include <Thrift.h>
+#include <thrift/protocol/TBinaryProtocol.h>
+#include <thrift/transport/TBufferTransports.h>
+#include <thrift/Thrift.h>
 
 #include "GenericHelpers.h"
 
diff --git a/lib/cpp/test/Benchmark.cpp b/lib/cpp/test/Benchmark.cpp
index 413802d..9ee2586 100755
--- a/lib/cpp/test/Benchmark.cpp
+++ b/lib/cpp/test/Benchmark.cpp
@@ -22,8 +22,8 @@
 #endif
 #include <iostream>
 #include <cmath>
-#include "transport/TBufferTransports.h"
-#include "protocol/TBinaryProtocol.h"
+#include "thrift/transport/TBufferTransports.h"
+#include "thrift/protocol/TBinaryProtocol.h"
 #include "gen-cpp/DebugProtoTest_types.h"
 #include <time.h>
 #ifdef HAVE_SYS_TIME_H
diff --git a/lib/cpp/test/DebugProtoTest.cpp b/lib/cpp/test/DebugProtoTest.cpp
index 4f456f3..26cc1ea 100644
--- a/lib/cpp/test/DebugProtoTest.cpp
+++ b/lib/cpp/test/DebugProtoTest.cpp
@@ -20,7 +20,7 @@
 #include <iostream>
 #include <cmath>
 #include "gen-cpp/DebugProtoTest_types.h"
-#include <protocol/TDebugProtocol.h>
+#include <thrift/protocol/TDebugProtocol.h>
 
 int main() {
   using std::cout;
diff --git a/lib/cpp/test/DenseProtoTest.cpp b/lib/cpp/test/DenseProtoTest.cpp
index 99f7865..f73579f 100644
--- a/lib/cpp/test/DenseProtoTest.cpp
+++ b/lib/cpp/test/DenseProtoTest.cpp
@@ -39,8 +39,8 @@
 #include <string>
 #include "gen-cpp/DebugProtoTest_types.h"
 #include "gen-cpp/OptionalRequiredTest_types.h"
-#include <protocol/TDenseProtocol.h>
-#include <transport/TBufferTransports.h>
+#include <thrift/protocol/TDenseProtocol.h>
+#include <thrift/transport/TBufferTransports.h>
 
 
 // Can't use memcmp here.  GCC is too smart.
diff --git a/lib/cpp/test/GenericHelpers.h b/lib/cpp/test/GenericHelpers.h
index d661d8b..1853a37 100644
--- a/lib/cpp/test/GenericHelpers.h
+++ b/lib/cpp/test/GenericHelpers.h
@@ -20,9 +20,9 @@
 #ifndef _THRIFT_TEST_GENERICHELPERS_H_
 #define _THRIFT_TEST_GENERICHELPERS_H_ 1
 
-#include <protocol/TBinaryProtocol.h>
-#include <transport/TBufferTransports.h>
-#include <Thrift.h>
+#include <thrift/protocol/TBinaryProtocol.h>
+#include <thrift/transport/TBufferTransports.h>
+#include <thrift/Thrift.h>
 
 using boost::shared_ptr;
 using namespace apache::thrift::protocol;
diff --git a/lib/cpp/test/JSONProtoTest.cpp b/lib/cpp/test/JSONProtoTest.cpp
index a9268a2..dcb34d1 100644
--- a/lib/cpp/test/JSONProtoTest.cpp
+++ b/lib/cpp/test/JSONProtoTest.cpp
@@ -19,8 +19,8 @@
 
 #include <iostream>
 #include <cmath>
-#include <transport/TBufferTransports.h>
-#include <protocol/TJSONProtocol.h>
+#include <thrift/transport/TBufferTransports.h>
+#include <thrift/protocol/TJSONProtocol.h>
 #include "gen-cpp/DebugProtoTest_types.h"
 
 int main() {
diff --git a/lib/cpp/test/OptionalRequiredTest.cpp b/lib/cpp/test/OptionalRequiredTest.cpp
index 5d58f09..ddafa81 100644
--- a/lib/cpp/test/OptionalRequiredTest.cpp
+++ b/lib/cpp/test/OptionalRequiredTest.cpp
@@ -24,9 +24,9 @@
 #include <cassert>
 #include <map>
 #include <iostream>
-#include <protocol/TDebugProtocol.h>
-#include <protocol/TBinaryProtocol.h>
-#include <transport/TBufferTransports.h>
+#include <thrift/protocol/TDebugProtocol.h>
+#include <thrift/protocol/TBinaryProtocol.h>
+#include <thrift/transport/TBufferTransports.h>
 #include "gen-cpp/OptionalRequiredTest_types.h"
 
 using std::cout;
diff --git a/lib/cpp/test/RWMutexStarveTest.cpp b/lib/cpp/test/RWMutexStarveTest.cpp
index 8042d49..e6cccf2 100644
--- a/lib/cpp/test/RWMutexStarveTest.cpp
+++ b/lib/cpp/test/RWMutexStarveTest.cpp
@@ -23,8 +23,8 @@
 #include <boost/shared_ptr.hpp>
 #include <boost/test/unit_test.hpp>
 
-#include "concurrency/Mutex.h"
-#include "concurrency/PosixThreadFactory.h"
+#include "thrift/concurrency/Mutex.h"
+#include "thrift/concurrency/PosixThreadFactory.h"
 
 using boost::shared_ptr;
 using boost::unit_test::test_suite;
diff --git a/lib/cpp/test/SpecializationTest.cpp b/lib/cpp/test/SpecializationTest.cpp
index fae1d32..7a3d347 100644
--- a/lib/cpp/test/SpecializationTest.cpp
+++ b/lib/cpp/test/SpecializationTest.cpp
@@ -1,7 +1,7 @@
 #include <iostream>
 #include <cmath>
-#include <transport/TTransportUtils.h>
-#include <protocol/TBinaryProtocol.h>
+#include <thrift/transport/TTransportUtils.h>
+#include <thrift/protocol/TBinaryProtocol.h>
 #include <gen-cpp/DebugProtoTest_types.h>
 
 using std::cout;
diff --git a/lib/cpp/test/TBufferBaseTest.cpp b/lib/cpp/test/TBufferBaseTest.cpp
index 1a0552a..f88a019 100644
--- a/lib/cpp/test/TBufferBaseTest.cpp
+++ b/lib/cpp/test/TBufferBaseTest.cpp
@@ -19,8 +19,8 @@
 
 #include <algorithm>
 #include <boost/test/auto_unit_test.hpp>
-#include <transport/TBufferTransports.h>
-#include <transport/TShortReadTransport.h>
+#include <thrift/transport/TBufferTransports.h>
+#include <thrift/transport/TShortReadTransport.h>
 
 using std::string;
 using boost::shared_ptr;
diff --git a/lib/cpp/test/TFDTransportTest.cpp b/lib/cpp/test/TFDTransportTest.cpp
index 1ec538e..7ffca71 100644
--- a/lib/cpp/test/TFDTransportTest.cpp
+++ b/lib/cpp/test/TFDTransportTest.cpp
@@ -19,8 +19,8 @@
 
 #include <cstdlib>
 #include <stdexcept>
-#include <Thrift.h>
-#include <transport/TFDTransport.h>
+#include <thrift/Thrift.h>
+#include <thrift/transport/TFDTransport.h>
 using apache::thrift::transport::TTransportException;
 using apache::thrift::transport::TFDTransport;
 
diff --git a/lib/cpp/test/TFileTransportTest.cpp b/lib/cpp/test/TFileTransportTest.cpp
index 6ba71f3..984deda 100644
--- a/lib/cpp/test/TFileTransportTest.cpp
+++ b/lib/cpp/test/TFileTransportTest.cpp
@@ -29,7 +29,7 @@
 #include <getopt.h>
 #include <boost/test/unit_test.hpp>
 
-#include <transport/TFileTransport.h>
+#include <thrift/transport/TFileTransport.h>
 
 using namespace apache::thrift::transport;
 
diff --git a/lib/cpp/test/TMemoryBufferTest.cpp b/lib/cpp/test/TMemoryBufferTest.cpp
index 3711970..10b53f4 100644
--- a/lib/cpp/test/TMemoryBufferTest.cpp
+++ b/lib/cpp/test/TMemoryBufferTest.cpp
@@ -21,8 +21,8 @@
 #include <iostream>
 #include <climits>
 #include <cassert>
-#include <transport/TBufferTransports.h>
-#include <protocol/TBinaryProtocol.h>
+#include <thrift/transport/TBufferTransports.h>
+#include <thrift/protocol/TBinaryProtocol.h>
 #include "gen-cpp/ThriftTest_types.h"
 
 BOOST_AUTO_TEST_SUITE( TMemoryBufferTest )
diff --git a/lib/cpp/test/TPipedTransportTest.cpp b/lib/cpp/test/TPipedTransportTest.cpp
index e1e372c..7762f05 100644
--- a/lib/cpp/test/TPipedTransportTest.cpp
+++ b/lib/cpp/test/TPipedTransportTest.cpp
@@ -19,9 +19,9 @@
 
 #include <cstdlib>
 #include <stdexcept>
-#include <Thrift.h>
-#include <transport/TTransportUtils.h>
-#include <transport/TBufferTransports.h>
+#include <thrift/Thrift.h>
+#include <thrift/transport/TTransportUtils.h>
+#include <thrift/transport/TBufferTransports.h>
 using namespace std;
 using apache::thrift::transport::TTransportException;
 using apache::thrift::transport::TPipedTransport;
diff --git a/lib/cpp/test/ThriftTest_extras.cpp b/lib/cpp/test/ThriftTest_extras.cpp
index b78f276..33f681f 100644
--- a/lib/cpp/test/ThriftTest_extras.cpp
+++ b/lib/cpp/test/ThriftTest_extras.cpp
@@ -19,7 +19,7 @@
 
 // Extra functions required for ThriftTest_types to work
 
-#include <protocol/TDebugProtocol.h>
+#include <thrift/protocol/TDebugProtocol.h>
 #include "gen-cpp/ThriftTest_types.h"
 
 
diff --git a/lib/cpp/test/TransportTest.cpp b/lib/cpp/test/TransportTest.cpp
index bc0529d..508d3e3 100644
--- a/lib/cpp/test/TransportTest.cpp
+++ b/lib/cpp/test/TransportTest.cpp
@@ -34,11 +34,11 @@
 #include <boost/type_traits.hpp>
 #include <boost/test/unit_test.hpp>
 
-#include <transport/TBufferTransports.h>
-#include <transport/TFDTransport.h>
-#include <transport/TFileTransport.h>
-#include <transport/TZlibTransport.h>
-#include <transport/TSocket.h>
+#include <thrift/transport/TBufferTransports.h>
+#include <thrift/transport/TFDTransport.h>
+#include <thrift/transport/TFileTransport.h>
+#include <thrift/transport/TZlibTransport.h>
+#include <thrift/transport/TSocket.h>
 
 using namespace apache::thrift::transport;
 
diff --git a/lib/cpp/test/ZlibTest.cpp b/lib/cpp/test/ZlibTest.cpp
index 605e9db..4d7966e 100644
--- a/lib/cpp/test/ZlibTest.cpp
+++ b/lib/cpp/test/ZlibTest.cpp
@@ -36,8 +36,8 @@
 #include <boost/shared_array.hpp>
 #include <boost/test/unit_test.hpp>
 
-#include <transport/TBufferTransports.h>
-#include <transport/TZlibTransport.h>
+#include <thrift/transport/TBufferTransports.h>
+#include <thrift/transport/TZlibTransport.h>
 
 using namespace std;
 using namespace boost;
diff --git a/test/cpp/src/StressTest.cpp b/test/cpp/src/StressTest.cpp
index a668fdf..5b0b359 100755
--- a/test/cpp/src/StressTest.cpp
+++ b/test/cpp/src/StressTest.cpp
@@ -17,19 +17,19 @@
  * under the License.
  */
 
-#include <concurrency/ThreadManager.h>
-#include <concurrency/PlatformThreadFactory.h>
-#include <concurrency/Monitor.h>
-#include <concurrency/Util.h>
-#include <concurrency/Mutex.h>
-#include <protocol/TBinaryProtocol.h>
-#include <server/TSimpleServer.h>
-#include <server/TThreadPoolServer.h>
-#include <server/TThreadedServer.h>
-#include <transport/TServerSocket.h>
-#include <transport/TSocket.h>
-#include <transport/TTransportUtils.h>
-#include <transport/TFileTransport.h>
+#include <thrift/concurrency/ThreadManager.h>
+#include <thrift/concurrency/PlatformThreadFactory.h>
+#include <thrift/concurrency/Monitor.h>
+#include <thrift/concurrency/Util.h>
+#include <thrift/concurrency/Mutex.h>
+#include <thrift/protocol/TBinaryProtocol.h>
+#include <thrift/server/TSimpleServer.h>
+#include <thrift/server/TThreadPoolServer.h>
+#include <thrift/server/TThreadedServer.h>
+#include <thrift/transport/TServerSocket.h>
+#include <thrift/transport/TSocket.h>
+#include <thrift/transport/TTransportUtils.h>
+#include <thrift/transport/TFileTransport.h>
 #include <TLogging.h>
 
 #include "Service.h"
diff --git a/test/cpp/src/StressTestNonBlocking.cpp b/test/cpp/src/StressTestNonBlocking.cpp
index 4826a50..4b9e29e 100755
--- a/test/cpp/src/StressTestNonBlocking.cpp
+++ b/test/cpp/src/StressTestNonBlocking.cpp
@@ -17,20 +17,20 @@
  * under the License.
  */
 
-#include <concurrency/ThreadManager.h>
-#include <concurrency/PlatformThreadFactory.h>
-#include <concurrency/Monitor.h>
-#include <concurrency/Util.h>
-#include <concurrency/Mutex.h>
-#include <protocol/TBinaryProtocol.h>
-#include <server/TSimpleServer.h>
-#include <server/TThreadPoolServer.h>
-#include <server/TThreadedServer.h>
-#include <server/TNonblockingServer.h>
-#include <transport/TServerSocket.h>
-#include <transport/TSocket.h>
-#include <transport/TTransportUtils.h>
-#include <transport/TFileTransport.h>
+#include <thrift/concurrency/ThreadManager.h>
+#include <thrift/concurrency/PlatformThreadFactory.h>
+#include <thrift/concurrency/Monitor.h>
+#include <thrift/concurrency/Util.h>
+#include <thrift/concurrency/Mutex.h>
+#include <thrift/protocol/TBinaryProtocol.h>
+#include <thrift/server/TSimpleServer.h>
+#include <thrift/server/TThreadPoolServer.h>
+#include <thrift/server/TThreadedServer.h>
+#include <thrift/server/TNonblockingServer.h>
+#include <thrift/transport/TServerSocket.h>
+#include <thrift/transport/TSocket.h>
+#include <thrift/transport/TTransportUtils.h>
+#include <thrift/transport/TFileTransport.h>
 #include <TLogging.h>
 
 #include "Service.h"
diff --git a/test/cpp/src/TestClient.cpp b/test/cpp/src/TestClient.cpp
index e752f1c..d8618d5 100755
--- a/test/cpp/src/TestClient.cpp
+++ b/test/cpp/src/TestClient.cpp
@@ -23,14 +23,14 @@
 #include <iostream>
 #include <unistd.h>
 #include <sys/time.h>
-#include <protocol/TBinaryProtocol.h>
-#include <protocol/TJSONProtocol.h>
-#include <transport/THttpClient.h>
-#include <transport/TTransportUtils.h>
-#include <transport/TSocket.h>
-#include <transport/TSSLSocket.h>
-#include <async/TEvhttpClientChannel.h>
-#include <server/TNonblockingServer.h> // <event.h>
+#include <thrift/protocol/TBinaryProtocol.h>
+#include <thrift/protocol/TJSONProtocol.h>
+#include <thrift/transport/THttpClient.h>
+#include <thrift/transport/TTransportUtils.h>
+#include <thrift/transport/TSocket.h>
+#include <thrift/transport/TSSLSocket.h>
+#include <thrift/async/TEvhttpClientChannel.h>
+#include <thrift/server/TNonblockingServer.h> // <event.h>
 
 #include <boost/shared_ptr.hpp>
 #include <boost/program_options.hpp>
diff --git a/test/cpp/src/TestServer.cpp b/test/cpp/src/TestServer.cpp
index b8cb880..f90bde8 100755
--- a/test/cpp/src/TestServer.cpp
+++ b/test/cpp/src/TestServer.cpp
@@ -20,23 +20,23 @@
 #define __STDC_FORMAT_MACROS
 #include <inttypes.h>
 
-#include <concurrency/ThreadManager.h>
-#include <concurrency/PlatformThreadFactory.h>
-#include <protocol/TBinaryProtocol.h>
-#include <protocol/TJSONProtocol.h>
-#include <server/TSimpleServer.h>
-#include <server/TThreadedServer.h>
-#include <server/TThreadPoolServer.h>
-#include <async/TEvhttpServer.h>
-#include <async/TAsyncBufferProcessor.h>
-#include <async/TAsyncProtocolProcessor.h>
-#include <server/TNonblockingServer.h>
-#include <transport/TServerSocket.h>
-#include <transport/TSSLServerSocket.h>
-#include <transport/TSSLSocket.h>
-#include <transport/THttpServer.h>
-#include <transport/THttpTransport.h>
-#include <transport/TTransportUtils.h>
+#include <thrift/concurrency/ThreadManager.h>
+#include <thrift/concurrency/PlatformThreadFactory.h>
+#include <thrift/protocol/TBinaryProtocol.h>
+#include <thrift/protocol/TJSONProtocol.h>
+#include <thrift/server/TSimpleServer.h>
+#include <thrift/server/TThreadedServer.h>
+#include <thrift/server/TThreadPoolServer.h>
+#include <thrift/async/TEvhttpServer.h>
+#include <thrift/async/TAsyncBufferProcessor.h>
+#include <thrift/async/TAsyncProtocolProcessor.h>
+#include <thrift/server/TNonblockingServer.h>
+#include <thrift/transport/TServerSocket.h>
+#include <thrift/transport/TSSLServerSocket.h>
+#include <thrift/transport/TSSLSocket.h>
+#include <thrift/transport/THttpServer.h>
+#include <thrift/transport/THttpTransport.h>
+#include <thrift/transport/TTransportUtils.h>
 #include "ThriftTest.h"
 
 #include <iostream>
diff --git a/test/threads/ThreadsClient.cpp b/test/threads/ThreadsClient.cpp
index f5c076f..70b08ad 100644
--- a/test/threads/ThreadsClient.cpp
+++ b/test/threads/ThreadsClient.cpp
@@ -21,13 +21,13 @@
 // You should copy it to another filename to avoid overwriting it.
 
 #include "ThreadsTest.h"
-#include <protocol/TBinaryProtocol.h>
-#include <server/TThreadPoolServer.h>
-#include <transport/TSocket.h>
-#include <transport/TTransportUtils.h>
-#include <concurrency/Monitor.h>
-#include <concurrency/ThreadManager.h>
-#include <concurrency/PlatformThreadFactory.h>
+#include <thrift/protocol/TBinaryProtocol.h>
+#include <thrift/server/TThreadPoolServer.h>
+#include <thrift/transport/TSocket.h>
+#include <thrift/transport/TTransportUtils.h>
+#include <thrift/concurrency/Monitor.h>
+#include <thrift/concurrency/ThreadManager.h>
+#include <thrift/concurrency/PlatformThreadFactory.h>
 
 using boost::shared_ptr;
 using namespace apache::thrift;
diff --git a/test/threads/ThreadsServer.cpp b/test/threads/ThreadsServer.cpp
index 8420c2f..9c1a7d9 100644
--- a/test/threads/ThreadsServer.cpp
+++ b/test/threads/ThreadsServer.cpp
@@ -21,14 +21,14 @@
 // You should copy it to another filename to avoid overwriting it.
 
 #include "ThreadsTest.h"
-#include <protocol/TBinaryProtocol.h>
-#include <server/TThreadPoolServer.h>
-#include <server/TThreadedServer.h>
-#include <transport/TServerSocket.h>
-#include <transport/TTransportUtils.h>
-#include <concurrency/Monitor.h>
-#include <concurrency/ThreadManager.h>
-#include <concurrency/PlatformThreadFactory.h>
+#include <thrift/protocol/TBinaryProtocol.h>
+#include <thrift/server/TThreadPoolServer.h>
+#include <thrift/server/TThreadedServer.h>
+#include <thrift/transport/TServerSocket.h>
+#include <thrift/transport/TTransportUtils.h>
+#include <thrift/concurrency/Monitor.h>
+#include <thrift/concurrency/ThreadManager.h>
+#include <thrift/concurrency/PlatformThreadFactory.h>
 
 using boost::shared_ptr;
 using namespace apache::thrift;
diff --git a/tutorial/cpp/CppClient.cpp b/tutorial/cpp/CppClient.cpp
index 4dac90c..6b7e974 100644
--- a/tutorial/cpp/CppClient.cpp
+++ b/tutorial/cpp/CppClient.cpp
@@ -21,9 +21,9 @@
 #include <unistd.h>
 #include <sys/time.h>
 
-#include <protocol/TBinaryProtocol.h>
-#include <transport/TSocket.h>
-#include <transport/TTransportUtils.h>
+#include <thrift/protocol/TBinaryProtocol.h>
+#include <thrift/transport/TSocket.h>
+#include <thrift/transport/TTransportUtils.h>
 
 #include "../gen-cpp/Calculator.h"
 
diff --git a/tutorial/cpp/CppServer.cpp b/tutorial/cpp/CppServer.cpp
index 860381e..d0dbad9 100644
--- a/tutorial/cpp/CppServer.cpp
+++ b/tutorial/cpp/CppServer.cpp
@@ -17,14 +17,14 @@
  * under the License.
  */
 
-#include <concurrency/ThreadManager.h>
-#include <concurrency/PosixThreadFactory.h>
-#include <protocol/TBinaryProtocol.h>
-#include <server/TSimpleServer.h>
-#include <server/TThreadPoolServer.h>
-#include <server/TThreadedServer.h>
-#include <transport/TServerSocket.h>
-#include <transport/TTransportUtils.h>
+#include <thrift/concurrency/ThreadManager.h>
+#include <thrift/concurrency/PosixThreadFactory.h>
+#include <thrift/protocol/TBinaryProtocol.h>
+#include <thrift/server/TSimpleServer.h>
+#include <thrift/server/TThreadPoolServer.h>
+#include <thrift/server/TThreadedServer.h>
+#include <thrift/transport/TServerSocket.h>
+#include <thrift/transport/TTransportUtils.h>
 
 #include <iostream>
 #include <stdexcept>