diff --git a/lib/c_glib/test/testthrifttestclient.cpp b/lib/c_glib/test/testthrifttestclient.cpp
index 77daf3d..5e0c894 100644
--- a/lib/c_glib/test/testthrifttestclient.cpp
+++ b/lib/c_glib/test/testthrifttestclient.cpp
@@ -51,7 +51,6 @@
 using namespace thrift::test;
 
 using std::cout;
-using std::endl;
 using std::fixed;
 using std::make_pair;
 using std::map;
@@ -76,51 +75,51 @@
   TestHandler() = default;
 
   void testVoid() override {
-    cout << "[C -> C++] testVoid()" << endl;
+    cout << "[C -> C++] testVoid()" << '\n';
   }
 
   void testString(string& out, const string &thing) override {
-    cout << "[C -> C++] testString(\"" << thing << "\")" << endl;
+    cout << "[C -> C++] testString(\"" << thing << "\")" << '\n';
     out = thing;
   }
 
   bool testBool(const bool thing) override {
-    cout << "[C -> C++] testBool(" << (thing ? "true" : "false") << ")" << endl;
+    cout << "[C -> C++] testBool(" << (thing ? "true" : "false") << ")" << '\n';
     return thing;
   }
   int8_t testByte(const int8_t thing) override {
-    cout << "[C -> C++] testByte(" << (int)thing << ")" << endl;
+    cout << "[C -> C++] testByte(" << (int)thing << ")" << '\n';
     return thing;
   }
   int32_t testI32(const int32_t thing) override {
-    cout << "[C -> C++] testI32(" << thing << ")" << endl;
+    cout << "[C -> C++] testI32(" << thing << ")" << '\n';
     return thing;
   }
 
   int64_t testI64(const int64_t thing) override {
-    cout << "[C -> C++] testI64(" << thing << ")" << endl;
+    cout << "[C -> C++] testI64(" << thing << ")" << '\n';
     return thing;
   }
 
   double testDouble(const double thing) override {
     cout.precision(6);
-    cout << "[C -> C++] testDouble(" << fixed << thing << ")" << endl;
+    cout << "[C -> C++] testDouble(" << fixed << thing << ")" << '\n';
     return thing;
   }
 
   void testBinary(string& out, const string &thing) override {
-    cout << "[C -> C++] testBinary(\"" << thing << "\")" << endl;
+    cout << "[C -> C++] testBinary(\"" << thing << "\")" << '\n';
     out = thing;
   }
 
   void testStruct(Xtruct& out, const Xtruct &thing) override {
-    cout << "[C -> C++] testStruct({\"" << thing.string_thing << "\", " << (int)thing.byte_thing << ", " << thing.i32_thing << ", " << thing.i64_thing << "})" << endl;
+    cout << "[C -> C++] testStruct({\"" << thing.string_thing << "\", " << (int)thing.byte_thing << ", " << thing.i32_thing << ", " << thing.i64_thing << "})" << '\n';
     out = thing;
   }
 
   void testNest(Xtruct2& out, const Xtruct2& nest) override {
     const Xtruct &thing = nest.struct_thing;
-    cout << "[C -> C++] testNest({" << (int)nest.byte_thing << ", {\"" << thing.string_thing << "\", " << (int)thing.byte_thing << ", " << thing.i32_thing << ", " << thing.i64_thing << "}, " << nest.i32_thing << "})" << endl;
+    cout << "[C -> C++] testNest({" << (int)nest.byte_thing << ", {\"" << thing.string_thing << "\", " << (int)thing.byte_thing << ", " << thing.i32_thing << ", " << thing.i64_thing << "}, " << nest.i32_thing << "})" << '\n';
     out = nest;
   }
 
@@ -136,7 +135,7 @@
       }
       cout << m_iter->first << " => " << m_iter->second;
     }
-    cout << "})" << endl;
+    cout << "})" << '\n';
     out = thing;
   }
 
@@ -152,7 +151,7 @@
       }
       cout << "\"" << m_iter->first << "\" => \"" << m_iter->second << "\"";
     }
-    cout << "})" << endl;
+    cout << "})" << '\n';
     out = thing;
   }
 
@@ -169,7 +168,7 @@
       }
       cout << *s_iter;
     }
-    cout << "})" << endl;
+    cout << "})" << '\n';
     out = thing;
   }
 
@@ -185,21 +184,21 @@
       }
       cout << *l_iter;
     }
-    cout << "})" << endl;
+    cout << "})" << '\n';
     out = thing;
   }
 
   Numberz::type testEnum(const Numberz::type thing) override {
-    cout << "[C -> C++] testEnum(" << thing << ")" << endl;
+    cout << "[C -> C++] testEnum(" << thing << ")" << '\n';
     return thing;
   }
 
   UserId testTypedef(const UserId thing) override {
-    cout << "[C -> C++] testTypedef(" << thing << ")" << endl;
+    cout << "[C -> C++] testTypedef(" << thing << ")" << '\n';
     return thing;  }
 
   void testMapMap(map<int32_t, map<int32_t,int32_t> > &mapmap, const int32_t hello) override {
-    cout << "[C -> C++] testMapMap(" << hello << ")" << endl;
+    cout << "[C -> C++] testMapMap(" << hello << ")" << '\n';
 
     map<int32_t,int32_t> pos;
     map<int32_t,int32_t> neg;
@@ -216,7 +215,7 @@
   void testInsanity(map<UserId, map<Numberz::type,Insanity> > &insane, const Insanity &argument) override {
     THRIFT_UNUSED_VARIABLE (argument);
 
-    cout << "[C -> C++] testInsanity()" << endl;
+    cout << "[C -> C++] testInsanity()" << '\n';
 
     Xtruct hello;
     hello.string_thing = "Hello2";
@@ -278,7 +277,7 @@
       }
       cout << "}, ";
     }
-    cout << "}" << endl;
+    cout << "}" << '\n';
 
 
   }
@@ -288,7 +287,7 @@
     THRIFT_UNUSED_VARIABLE (arg4);
     THRIFT_UNUSED_VARIABLE (arg5);
 
-    cout << "[C -> C++] testMulti()" << endl;
+    cout << "[C -> C++] testMulti()" << '\n';
 
     hello.string_thing = "Hello2";
     hello.byte_thing = arg0;
@@ -299,7 +298,7 @@
   void testException(const std::string &arg)
     noexcept(false)  override
   {
-    cout << "[C -> C++] testException(" << arg << ")" << endl;
+    cout << "[C -> C++] testException(" << arg << ")" << '\n';
     if (arg.compare("Xception") == 0) {
       Xception e;
       e.errorCode = 1001;
@@ -317,7 +316,7 @@
 
   void testMultiException(Xtruct &result, const std::string &arg0, const std::string &arg1) noexcept(false) override {
 
-    cout << "[C -> C++] testMultiException(" << arg0 << ", " << arg1 << ")" << endl;
+    cout << "[C -> C++] testMultiException(" << arg0 << ", " << arg1 << ")" << '\n';
 
     if (arg0.compare("Xception") == 0) {
       Xception e;
@@ -336,9 +335,9 @@
   }
 
   void testOneway(int sleepFor) override {
-    cout << "testOneway(" << sleepFor << "): Sleeping..." << endl;
+    cout << "testOneway(" << sleepFor << "): Sleeping..." << '\n';
     sleep(sleepFor);
-    cout << "testOneway(" << sleepFor << "): done sleeping!" << endl;
+    cout << "testOneway(" << sleepFor << "): done sleeping!" << '\n';
   }
 };
 
diff --git a/lib/c_glib/test/testthrifttestzlibclient.cpp b/lib/c_glib/test/testthrifttestzlibclient.cpp
index 5c4b931..307fd4f 100644
--- a/lib/c_glib/test/testthrifttestzlibclient.cpp
+++ b/lib/c_glib/test/testthrifttestzlibclient.cpp
@@ -46,7 +46,6 @@
 using namespace thrift::test;
 
 using std::cout;
-using std::endl;
 using std::fixed;
 using std::make_pair;
 using std::map;
@@ -71,51 +70,51 @@
   TestHandler() = default;
 
   void testVoid() override {
-    cout << "[C -> C++] testVoid()" << endl;
+    cout << "[C -> C++] testVoid()" << '\n';
   }
 
   void testString(string& out, const string &thing) override {
-    cout << "[C -> C++] testString(\"" << thing << "\")" << endl;
+    cout << "[C -> C++] testString(\"" << thing << "\")" << '\n';
     out = thing;
   }
 
   bool testBool(const bool thing) override {
-    cout << "[C -> C++] testBool(" << (thing ? "true" : "false") << ")" << endl;
+    cout << "[C -> C++] testBool(" << (thing ? "true" : "false") << ")" << '\n';
     return thing;
   }
   int8_t testByte(const int8_t thing) override {
-    cout << "[C -> C++] testByte(" << (int)thing << ")" << endl;
+    cout << "[C -> C++] testByte(" << (int)thing << ")" << '\n';
     return thing;
   }
   int32_t testI32(const int32_t thing) override {
-    cout << "[C -> C++] testI32(" << thing << ")" << endl;
+    cout << "[C -> C++] testI32(" << thing << ")" << '\n';
     return thing;
   }
 
   int64_t testI64(const int64_t thing) override {
-    cout << "[C -> C++] testI64(" << thing << ")" << endl;
+    cout << "[C -> C++] testI64(" << thing << ")" << '\n';
     return thing;
   }
 
   double testDouble(const double thing) override {
     cout.precision(6);
-    cout << "[C -> C++] testDouble(" << fixed << thing << ")" << endl;
+    cout << "[C -> C++] testDouble(" << fixed << thing << ")" << '\n';
     return thing;
   }
 
   void testBinary(string& out, const string &thing) override {
-    cout << "[C -> C++] testBinary(\"" << thing << "\")" << endl;
+    cout << "[C -> C++] testBinary(\"" << thing << "\")" << '\n';
     out = thing;
   }
 
   void testStruct(Xtruct& out, const Xtruct &thing) override {
-    cout << "[C -> C++] testStruct({\"" << thing.string_thing << "\", " << (int)thing.byte_thing << ", " << thing.i32_thing << ", " << thing.i64_thing << "})" << endl;
+    cout << "[C -> C++] testStruct({\"" << thing.string_thing << "\", " << (int)thing.byte_thing << ", " << thing.i32_thing << ", " << thing.i64_thing << "})" << '\n';
     out = thing;
   }
 
   void testNest(Xtruct2& out, const Xtruct2& nest) override {
     const Xtruct &thing = nest.struct_thing;
-    cout << "[C -> C++] testNest({" << (int)nest.byte_thing << ", {\"" << thing.string_thing << "\", " << (int)thing.byte_thing << ", " << thing.i32_thing << ", " << thing.i64_thing << "}, " << nest.i32_thing << "})" << endl;
+    cout << "[C -> C++] testNest({" << (int)nest.byte_thing << ", {\"" << thing.string_thing << "\", " << (int)thing.byte_thing << ", " << thing.i32_thing << ", " << thing.i64_thing << "}, " << nest.i32_thing << "})" << '\n';
     out = nest;
   }
 
@@ -131,7 +130,7 @@
       }
       cout << m_iter->first << " => " << m_iter->second;
     }
-    cout << "})" << endl;
+    cout << "})" << '\n';
     out = thing;
   }
 
@@ -147,7 +146,7 @@
       }
       cout << "\"" << m_iter->first << "\" => \"" << m_iter->second << "\"";
     }
-    cout << "})" << endl;
+    cout << "})" << '\n';
     out = thing;
   }
 
@@ -164,7 +163,7 @@
       }
       cout << *s_iter;
     }
-    cout << "})" << endl;
+    cout << "})" << '\n';
     out = thing;
   }
 
@@ -180,21 +179,21 @@
       }
       cout << *l_iter;
     }
-    cout << "})" << endl;
+    cout << "})" << '\n';
     out = thing;
   }
 
   Numberz::type testEnum(const Numberz::type thing) override {
-    cout << "[C -> C++] testEnum(" << thing << ")" << endl;
+    cout << "[C -> C++] testEnum(" << thing << ")" << '\n';
     return thing;
   }
 
   UserId testTypedef(const UserId thing) override {
-    cout << "[C -> C++] testTypedef(" << thing << ")" << endl;
+    cout << "[C -> C++] testTypedef(" << thing << ")" << '\n';
     return thing;  }
 
   void testMapMap(map<int32_t, map<int32_t,int32_t> > &mapmap, const int32_t hello) override {
-    cout << "[C -> C++] testMapMap(" << hello << ")" << endl;
+    cout << "[C -> C++] testMapMap(" << hello << ")" << '\n';
 
     map<int32_t,int32_t> pos;
     map<int32_t,int32_t> neg;
@@ -211,7 +210,7 @@
   void testInsanity(map<UserId, map<Numberz::type,Insanity> > &insane, const Insanity &argument) override {
     THRIFT_UNUSED_VARIABLE (argument);
 
-    cout << "[C -> C++] testInsanity()" << endl;
+    cout << "[C -> C++] testInsanity()" << '\n';
 
     Xtruct hello;
     hello.string_thing = "Hello2";
@@ -273,7 +272,7 @@
       }
       cout << "}, ";
     }
-    cout << "}" << endl;
+    cout << "}" << '\n';
 
 
   }
@@ -283,7 +282,7 @@
     THRIFT_UNUSED_VARIABLE (arg4);
     THRIFT_UNUSED_VARIABLE (arg5);
 
-    cout << "[C -> C++] testMulti()" << endl;
+    cout << "[C -> C++] testMulti()" << '\n';
 
     hello.string_thing = "Hello2";
     hello.byte_thing = arg0;
@@ -294,7 +293,7 @@
   void testException(const std::string &arg)
     throw(Xception, apache::thrift::TException) override
   {
-    cout << "[C -> C++] testException(" << arg << ")" << endl;
+    cout << "[C -> C++] testException(" << arg << ")" << '\n';
     if (arg.compare("Xception") == 0) {
       Xception e;
       e.errorCode = 1001;
@@ -312,7 +311,7 @@
 
   void testMultiException(Xtruct &result, const std::string &arg0, const std::string &arg1) throw(Xception, Xception2) override {
 
-    cout << "[C -> C++] testMultiException(" << arg0 << ", " << arg1 << ")" << endl;
+    cout << "[C -> C++] testMultiException(" << arg0 << ", " << arg1 << ")" << '\n';
 
     if (arg0.compare("Xception") == 0) {
       Xception e;
@@ -331,9 +330,9 @@
   }
 
   void testOneway(int sleepFor) override {
-    cout << "testOneway(" << sleepFor << "): Sleeping..." << endl;
+    cout << "testOneway(" << sleepFor << "): Sleeping..." << '\n';
     sleep(sleepFor);
-    cout << "testOneway(" << sleepFor << "): done sleeping!" << endl;
+    cout << "testOneway(" << sleepFor << "): done sleeping!" << '\n';
   }
 };
 
