hashkit_md5.pop
hashkit_murmur.pop
hashkit_value.pop
+libhashkit/configure.h
libmemcached-*.tar.gz
libmemcached-0.30-1.src.rpm
libmemcached-0.30-1.x86_64.rpm
ENABLE_DEPRECATED
PANDORA_HAVE_LIBINNODB
PANDORA_PRINT_CALLSTACK
+DETECT_BITFIELD
AC_CHECK_HEADERS([atomic.h])
AS_IF([test "x$ac_cv_header_atomic_h" = "xyes"],[
AC_CONFIG_FILES([
Makefile
docs/Makefile
+ libhashkit/configure.h
libmemcached/configure.h
support/libmemcached.pc
support/libmemcached.spec
--- /dev/null
+/* HashKit
+ * Copyright (C) 2009-2010 Brian Aker
+ * All rights reserved.
+ *
+ * Use and distribution licensed under the BSD license. See
+ * the COPYING file in the parent directory for full text.
+ */
+#ifndef LIBHASHKIT_CONFIGURE_H
+#define LIBHASHKIT_CONFIGURE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+@HASHKIT_BITFIELD@
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* LIBHASHKIT_CONFIGURE_H */
#include <inttypes.h>
#include <sys/types.h>
#include <libhashkit/visibility.h>
+#include <libhashkit/configure.h>
#include <libhashkit/types.h>
#include <libhashkit/algorithm.h>
#include <libhashkit/behavior.h>
} base_hash, distribution_hash;
struct {
- bool is_base_same_distributed:1;
+ bool is_base_same_distributed HASHKIT_BITFIELD;
} flags;
struct {
- bool is_allocated:1;
+ bool is_allocated HASHKIT_BITFIELD;
} options;
};
}
Hashkit& operator=(const Hashkit& source)
- {
+ {
hashkit_free(this);
hashkit_clone(this, &source);
lib_LTLIBRARIES+= libhashkit/libhashkit.la
+EXTRA_DIST+= \
+ libhashkit/configure.h.in
+
+
nobase_include_HEADERS+= \
libhashkit/algorithm.h \
libhashkit/behavior.h \
+ libhashkit/configure.h \
libhashkit/digest.h \
libhashkit/function.h \
libhashkit/hashkit.h \
extern "C" {
#endif
+@MEMCACHED_BITFIELD@
@DEPRECATED@
#define LIBMEMCACHED_VERSION_STRING "@VERSION@"
@note these are static and should not change without a call to behavior.
*/
struct {
- bool is_purging:1;
- bool is_processing_input:1;
+ bool is_purging MEMCACHED_BITFIELD;
+ bool is_processing_input MEMCACHED_BITFIELD;
} state;
struct {
// Everything below here is pretty static.
- 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;
+ 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;
} flags;
memcached_server_distribution_t distribution;
hashkit_st hashkit;
memcached_callback_st *callbacks;
char prefix_key[MEMCACHED_PREFIX_KEY_MAX_SIZE];
struct {
- bool is_allocated:1;
+ bool is_allocated MEMCACHED_BITFIELD;
} options;
};
}
Memcached& operator=(const Memcached& source)
- {
+ {
memcached_free(this);
memcached_clone(this, &source);
memcached_string_st value;
char item_key[MEMCACHED_MAX_KEY];
struct {
- bool is_allocated:1;
- bool is_initialized:1;
+ bool is_allocated MEMCACHED_BITFIELD;
+ bool is_initialized MEMCACHED_BITFIELD;
} options;
/* Add result callback function */
};
struct memcached_server_st {
struct {
- bool is_allocated:1;
- bool is_initialized:1;
- bool sockaddr_inited:1;
+ bool is_allocated MEMCACHED_BITFIELD;
+ bool is_initialized MEMCACHED_BITFIELD;
+ bool sockaddr_inited MEMCACHED_BITFIELD;
} options;
uint32_t number_of_hosts;
uint32_t cursor_active;
about them.
1) is_initialized is always valid.
- 2) A string once intialized will always be, until free where we
+ 2) A string once intialized will always be, until free where we
unset this flag.
3) A string always has a root.
*/
size_t current_size;
const memcached_st *root;
struct {
- bool is_allocated:1;
- bool is_initialized:1;
+ bool is_allocated MEMCACHED_BITFIELD;
+ bool is_initialized MEMCACHED_BITFIELD;
} 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()
+])