extern "C" {
#endif
-@HASHKIT_BITFIELD@
-
#ifdef __cplusplus
}
#endif
} base_hash, distribution_hash;
struct {
- bool is_base_same_distributed HASHKIT_BITFIELD;
+ bool is_base_same_distributed:1;
} flags;
struct {
- bool is_allocated HASHKIT_BITFIELD;
+ bool is_allocated:1;
} options;
};
extern "C" {
#endif
-@MEMCACHED_BITFIELD@
@DEPRECATED@
@LIBMEMCACHED_WITH_SASL_SUPPORT@
@note these are static and should not change without a call to behavior.
*/
struct {
- bool is_purging MEMCACHED_BITFIELD;
- bool is_processing_input MEMCACHED_BITFIELD;
+ bool is_purging:1;
+ bool is_processing_input:1;
} state;
struct {
// Everything below here is pretty static.
- bool auto_eject_hosts MEMCACHED_BITFIELD;
- bool binary_protocol MEMCACHED_BITFIELD;
- bool buffer_requests MEMCACHED_BITFIELD;
- bool cork MEMCACHED_BITFIELD;
- bool hash_with_prefix_key MEMCACHED_BITFIELD;
- bool ketama_weighted MEMCACHED_BITFIELD;
- bool no_block MEMCACHED_BITFIELD;
- bool no_reply MEMCACHED_BITFIELD;
- bool randomize_replica_read MEMCACHED_BITFIELD;
- bool reuse_memory MEMCACHED_BITFIELD;
- bool support_cas MEMCACHED_BITFIELD;
- bool tcp_nodelay MEMCACHED_BITFIELD;
- bool use_cache_lookups MEMCACHED_BITFIELD;
- bool use_sort_hosts MEMCACHED_BITFIELD;
- bool use_udp MEMCACHED_BITFIELD;
- bool verify_key MEMCACHED_BITFIELD;
+ bool auto_eject_hosts:1;
+ bool binary_protocol:1;
+ bool buffer_requests:1;
+ bool cork:1;
+ bool hash_with_prefix_key:1;
+ bool ketama_weighted:1;
+ bool no_block:1;
+ bool no_reply:1;
+ bool randomize_replica_read:1;
+ bool reuse_memory:1;
+ bool support_cas:1;
+ bool tcp_nodelay:1;
+ bool use_cache_lookups:1;
+ bool use_sort_hosts:1;
+ bool use_udp:1;
+ bool verify_key:1;
} flags;
memcached_server_distribution_t distribution;
hashkit_st hashkit;
** Did we allocate data inside the callbacks, or did the user
** supply that.
*/
- bool is_allocated MEMCACHED_BITFIELD;
+ bool is_allocated:1;
} sasl;
#endif
char prefix_key[MEMCACHED_PREFIX_KEY_MAX_SIZE];
struct {
- bool is_allocated MEMCACHED_BITFIELD;
+ bool is_allocated:1;
} options;
};
memcached_string_st value;
char item_key[MEMCACHED_MAX_KEY];
struct {
- bool is_allocated MEMCACHED_BITFIELD;
- bool is_initialized MEMCACHED_BITFIELD;
+ bool is_allocated:1;
+ bool is_initialized:1;
} options;
/* Add result callback function */
};
struct memcached_server_st {
struct {
- bool is_allocated MEMCACHED_BITFIELD;
- bool is_initialized MEMCACHED_BITFIELD;
- bool sockaddr_inited MEMCACHED_BITFIELD;
- bool is_shutting_down MEMCACHED_BITFIELD;
+ bool is_allocated:1;
+ bool is_initialized:1;
+ bool sockaddr_inited:1;
+ bool is_shutting_down:1;
} options;
uint32_t number_of_hosts;
uint32_t cursor_active;
size_t current_size;
const memcached_st *root;
struct {
- bool is_allocated MEMCACHED_BITFIELD;
- bool is_initialized MEMCACHED_BITFIELD;
+ bool is_allocated:1;
+ bool is_initialized:1;
} options;
};
+++ /dev/null
-AC_DEFUN([DETECT_BITFIELD],
-[
- AC_CACHE_CHECK([for working bitfield],[ac_cv_have_bitfield],[
- AC_LANG_PUSH([C])
- save_CFLAGS="${CFLAGS}"
- CFLAGS="${AM_CFLAGS} ${NO_WERROR}"
-
- AC_RUN_IFELSE([
- AC_LANG_PROGRAM([[
-#include <stdbool.h>
- ]],[[
- struct flags { bool b0:1; bool b1:1; bool b2:1; bool b3:1;
- bool b4:1; bool b5:1; bool b6:1; bool b7:1;
- } f = { .b0 = false, .b1 = false, .b2 = false, .b3 = false,
- .b4 = false, .b5 = false, .b6 = false, .b7 = false };
-
- f.b0 = true;
- f.b1 = false;
- f.b2 = true;
- f.b3 = false;
- f.b4 = true;
- f.b5 = false;
- f.b6 = true;
- f.b7 = false;
-
- if (f.b0 && !f.b1 && f.b2 && !f.b3 && f.b4 && !f.b5 && f.b6 && !f.b7) {
- return 0;
- }
-
- return 1;
- ]])
- ], [
- ac_cv_have_bitfield=yes
- ],[
- ac_cv_have_bitfield=no
- ])])
-
- CFLAGS=${save_CFLAGS}
- AS_IF([test "x$ac_cv_have_bitfield" = "xyes"],
- [
- MEMCACHED_BITFIELD="#define MEMCACHED_BITFIELD :1"
- HASHKIT_BITFIELD="#define HASHKIT_BITFIELD :1"
- ],
- [
- MEMCACHED_BITFIELD="#define MEMCACHED_BITFIELD"
- HASHKIT_BITFIELD="#define HASHKIT_BITFIELD"
- ])
- AC_SUBST([MEMCACHED_BITFIELD])
- AC_SUBST([HASHKIT_BITFIELD])
- AC_LANG_POP()
-])