Fix for interface issues (Bug 571909 <571909@bugs.launchpad.net>)
[m6w6/libmemcached] / libmemcached / protocol_handler.h
index 5a820d4f1d9a77609581cd65c34fd6db4cf5fc97..78eda07745a4d86a55b214d8d49c905bfe1b3b56 100644 (file)
@@ -1,5 +1,5 @@
 /* LibMemcached
- * Copyright (C) 2006-2009 Brian Aker 
+ * Copyright (C) 2006-2009 Brian Aker
  * All rights reserved.
  *
  * Use and distribution licensed under the BSD license.  See
  *
  */
 
-#ifndef MEMCACHED_PROTOCOL_H
-#define MEMCACHED_PROTOCOL_H
+#ifndef __LIBMEMCACHED_PROTOCOL_H__
+#define __LIBMEMCACHED_PROTOCOL_H__
 
 #include <sys/types.h>
-#include <stdbool.h>
+#if !defined(__cplusplus)
+# include <stdbool.h>
+#endif
 
 #include <libmemcached/memcached/protocol_binary.h>
 #include <libmemcached/visibility.h>
 typedef struct memcached_protocol_st memcached_protocol_st;
 typedef struct memcached_protocol_client_st memcached_protocol_client_st;
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 /**
  * Function the protocol handler should call to receive data.
  * This function should behave exactly like read(2)
@@ -203,4 +209,9 @@ int memcached_protocol_client_get_errno(memcached_protocol_client_st *client);
  */
 LIBMEMCACHED_API
 memcached_binary_protocol_raw_response_handler memcached_binary_protocol_get_raw_response_handler(const void *cookie);
+
+#ifdef __cplusplus
+}
+#endif
+
 #endif