Fix for interface issues (Bug 571909 <571909@bugs.launchpad.net>)
[m6w6/libmemcached] / libmemcached / protocol / common.h
index 20fa16e554f7f7b157445ae7475e9c744b720da5..1d29798c98d5c5b87a7b1861f3e094d2ab6ce43d 100644 (file)
@@ -3,7 +3,9 @@
 #define LIBMEMCACHED_PROTOCOL_COMMON_H
 
 #include "config.h"
-#include <stdbool.h>
+#if !defined(__cplusplus)
+# include <stdbool.h>
+#endif
 #include <assert.h>
 #include <netinet/in.h>
 
@@ -23,8 +25,8 @@
  * but some people still do). If it ever shows up as a performance thing
  * I'll look into optimizing this ;-)
  */
-typedef bool (*drain_func)(struct memcached_protocol_client_st *client);
-typedef protocol_binary_response_status (*spool_func)(struct memcached_protocol_client_st *client,
+typedef bool (*drain_func)(memcached_protocol_client_st *client);
+typedef protocol_binary_response_status (*spool_func)(memcached_protocol_client_st *client,
                                                       const void *data,
                                                       size_t length);
 
@@ -32,7 +34,7 @@ typedef protocol_binary_response_status (*spool_func)(struct memcached_protocol_
  * Definition of the per instance structure.
  */
 struct memcached_protocol_st {
-  struct memcached_binary_protocol_callback_st *callback;
+  memcached_binary_protocol_callback_st *callback;
   memcached_protocol_recv_func recv;
   memcached_protocol_send_func send;
 
@@ -73,7 +75,7 @@ struct chunk_st {
 
 #define CHUNK_BUFFERSIZE 2048
 
-typedef enum MEMCACHED_PROTOCOL_EVENT (*process_data)(struct memcached_protocol_client_st *client, ssize_t *length, void **endptr);
+typedef memcached_protocol_event_t (*process_data)(struct memcached_protocol_client_st *client, ssize_t *length, void **endptr);
 
 enum ascii_cmd {
   GET_CMD,
@@ -96,7 +98,7 @@ enum ascii_cmd {
 };
 
 struct memcached_protocol_client_st {
-  struct memcached_protocol_st *root;
+  memcached_protocol_st *root;
   int sock;
   int error;