Merge in simple extrace for strings, style issues in io
[awesomized/libmemcached] / libmemcached / common.h
index f30589ca8be21382c9a76daedec406149ff54af5..49d309c8759ed0a2a8e7f2f788bb2b03eda02203 100644 (file)
@@ -92,7 +92,11 @@ memcached_return_t memcached_server_execute(memcached_st *ptr,
 #include <libmemcached/error.hpp>
 #include <libmemcached/memory.h>
 #include <libmemcached/io.h>
+#ifdef __cplusplus
+#include <libmemcached/string.hpp>
+#include <libmemcached/io.hpp>
 #include <libmemcached/do.hpp>
+#endif
 #include <libmemcached/internal.h>
 #include <libmemcached/array.h>
 #include <libmemcached/libmemcached_probes.h>
@@ -103,6 +107,7 @@ memcached_return_t memcached_server_execute(memcached_st *ptr,
 #include <libmemcached/namespace.h>
 
 #ifdef __cplusplus
+#include <libmemcached/backtrace.hpp>
 #include <libmemcached/assert.hpp>
 #endif
 
@@ -168,20 +173,24 @@ LIBMEMCACHED_LOCAL
 
 static inline memcached_return_t memcached_validate_key_length(size_t key_length, bool binary)
 {
-  unlikely (key_length == 0)
+  if (key_length == 0)
   {
     return MEMCACHED_BAD_KEY_PROVIDED;
   }
 
   if (binary)
   {
-    unlikely (key_length > 0xffff)
+    if (key_length > 0xffff)
+    {
       return MEMCACHED_BAD_KEY_PROVIDED;
+    }
   }
   else
   {
-    unlikely (key_length >= MEMCACHED_MAX_KEY)
+    if (key_length >= MEMCACHED_MAX_KEY)
+    {
       return MEMCACHED_BAD_KEY_PROVIDED;
+    }
   }
 
   return MEMCACHED_SUCCESS;