EXTRA_DIST = libmemcached_probes.d memcached/README.txt libmemcached.ver \
memcached_configure.h.in
-EXTRA_HEADERS =
-BUILT_SOURCES=
+EXTRA_HEADERS =
+BUILT_SOURCES=
noinst_HEADERS = libmemcached_probes.h \
memcached_io.h \
libmemcached_la_SOURCES += hsieh_hash.c
endif
-if BUILD_BYTEORDER
-libmemcached_la_SOURCES += byteorder.c
-endif
-
libmemcached_la_DEPENDENCIES= libmemcachedcallbacks.la
libmemcached_la_LIBADD= $(LIBM) libmemcachedcallbacks.la
libmemcached_la_LDFLAGS = -version-info $(MEMCACHED_LIBRARY_VERSION) $(LD_VERSION_SCRIPT) $(LIBM)
+if BUILD_BYTEORDER
+noinst_LTLIBRARIES += libbyteorder.la
+libbyteorder_la_SOURCES= byteorder.c byteorder.h
+libmemcached_la_LIBADD += libbyteorder.la
+libmemcached_la_DEPENDENCIES+= libbyteorder.la
+endif
+
if HAVE_DTRACE
BUILT_SOURCES+= dtrace_probes.h
libmemcached_la_SOURCES += libmemcached_probes.d
-#include "common.h"
+#include "byteorder.h"
/* Byte swap a 64-bit number. */
-static inline uint64_t swap64(uint64_t in)
+static inline uint64_t swap64(uint64_t in)
{
#ifndef BYTEORDER_BIG_ENDIAN
/* Little endian, flip the bytes around until someone makes a faster/better
* way to do this. */
uint64_t rv= 0;
uint8_t x= 0;
- for(x= 0; x < 8; x++)
+ for(x= 0; x < 8; x++)
{
rv= (rv << 8) | (in & 0xff);
in >>= 8;
--- /dev/null
+#ifndef LIBMEMCACHED_BYTEORDER_H
+#define LIBMEMCACHED_BYTEORDER_H
+
+#include "config.h"
+
+/* Define this here, which will turn on the visibilty controls while we're
+ * building libmemcached.
+ */
+#define BUILDING_LIBMEMCACHED 1
+
+#include "libmemcached/memcached.h"
+
+#ifndef HAVE_HTONLL
+LIBMEMCACHED_LOCAL
+extern uint64_t ntohll(uint64_t);
+LIBMEMCACHED_LOCAL
+extern uint64_t htonll(uint64_t);
+#endif
+
+#endif /* LIBMEMCACHED_BYTEORDER_H */
#include "libmemcached/memcached_internal.h"
#include "libmemcached/libmemcached_probes.h"
#include "libmemcached/memcached/protocol_binary.h"
+#include "libmemcached/byteorder.h"
/* string value */
struct memcached_continuum_item_st {
LIBMEMCACHED_LOCAL
uint32_t generate_hash(memcached_st *ptr, const char *key, size_t key_length);
-#ifndef HAVE_HTONLL
-LIBMEMCACHED_LOCAL
-extern uint64_t ntohll(uint64_t);
-LIBMEMCACHED_LOCAL
-extern uint64_t htonll(uint64_t);
-#endif
-
LIBMEMCACHED_LOCAL
memcached_return memcached_purge(memcached_server_st *ptr);
-static inline memcached_return memcached_validate_key_length(size_t key_length,
+static inline memcached_return memcached_validate_key_length(size_t key_length,
bool binary) {
unlikely (key_length == 0)
return MEMCACHED_BAD_KEY_PROVIDED;
-
+
if (binary)
{
unlikely (key_length > 0xffff)
}
else
{
- unlikely (key_length >= MEMCACHED_MAX_KEY)
+ unlikely (key_length >= MEMCACHED_MAX_KEY)
return MEMCACHED_BAD_KEY_PROVIDED;
}