From: Brian Aker Date: Sun, 12 Feb 2012 19:30:02 +0000 (-0800) Subject: Fixes around m4 from trunk X-Git-Tag: 1.0.7~17^2~21 X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=228bf943e5469e09f437a0a71bd3b0863e3c4590;hp=c7cf10015c179608f1b6e3d1614ae744b21d0f98;p=awesomized%2Flibmemcached Fixes around m4 from trunk --- diff --git a/configure.ac b/configure.ac index d54a7d96..6b95e25e 100644 --- a/configure.ac +++ b/configure.ac @@ -168,6 +168,7 @@ AX_CXX_GCC_ABI_DEMANGLE AX_CHECK_LIBRARY([LIBUUID], [uuid/uuid.h], [uuid], [ LIBUUID_LDFLAGS="-luuid" + AC_DEFINE([HAVE_LIBUUID], [ 1 ], [Have libuuid]) ], [ AC_DEFINE([HAVE_LIBUUID], [ 0 ], [Have libuuid]) diff --git a/m4/pandora_have_libuuid.m4 b/m4/pandora_have_libuuid.m4 deleted file mode 100644 index 0bd28b9a..00000000 --- a/m4/pandora_have_libuuid.m4 +++ /dev/null @@ -1,55 +0,0 @@ -dnl Copyright (C) 2009 Sun Microsystems, Inc. -dnl This file is free software; Sun Microsystems, Inc. -dnl gives unlimited permission to copy and/or distribute it, -dnl with or without modifications, as long as this notice is preserved. - -#-------------------------------------------------------------------- -# Check for libuuid -#-------------------------------------------------------------------- - - -AC_DEFUN([_PANDORA_SEARCH_LIBUUID],[ - AC_REQUIRE([AC_LIB_PREFIX]) - - dnl Do this by hand. Need to check for uuid/uuid.h, but uuid may or may - dnl not be a lib is weird. - AC_CHECK_HEADERS(uuid/uuid.h) - AC_LIB_HAVE_LINKFLAGS(uuid,, - [ - #include - ], - [ - uuid_t uout; - uuid_generate(uout); - ]) - - AM_CONDITIONAL(HAVE_LIBUUID, [test "x${ac_cv_libuuid}" = "xyes"]) -]) - -AC_DEFUN([_PANDORA_HAVE_LIBUUID],[ - - AC_ARG_ENABLE([libuuid], - [AS_HELP_STRING([--disable-libuuid], - [Build with libuuid support @<:@default=on@:>@])], - [ac_enable_libuuid="$enableval"], - [ac_enable_libuuid="yes"]) - - _PANDORA_SEARCH_LIBUUID -]) - - -AC_DEFUN([PANDORA_HAVE_LIBUUID],[ - AC_REQUIRE([_PANDORA_HAVE_LIBUUID]) -]) - -AC_DEFUN([_PANDORA_REQUIRE_LIBUUID],[ - ac_enable_libuuid="yes" - _PANDORA_SEARCH_LIBUUID - AS_IF([test "x$ac_cv_header_uuid_uuid_h" = "xno"],[ - AC_MSG_ERROR([Couldn't find uuid/uuid.h. On Debian this can be found in uuid-dev. On RHEL 4 this can be found in e2fsprogs-devel and Fedora/RHEL 6 in libuuid-devel.]) - ]) -]) - -AC_DEFUN([PANDORA_REQUIRE_LIBUUID],[ - AC_REQUIRE([_PANDORA_REQUIRE_LIBUUID]) -]) diff --git a/m4/pandora_warnings.m4 b/m4/pandora_warnings.m4 index 0f6d47af..42cee56b 100644 --- a/m4/pandora_warnings.m4 +++ b/m4/pandora_warnings.m4 @@ -27,7 +27,6 @@ AC_DEFUN([PANDORA_WARNINGS],[ ]) ]) - AC_REQUIRE([PANDORA_BUILDING_FROM_VC]) m4_if(PW_WARN_ALWAYS_ON, [yes], [ac_cv_warnings_as_errors=yes], AS_IF([test "$pandora_building_from_vc" = "yes"], diff --git a/m4/protocol_binary.m4 b/m4/protocol_binary.m4 index 5c00b556..9568f0de 100644 --- a/m4/protocol_binary.m4 +++ b/m4/protocol_binary.m4 @@ -2,34 +2,28 @@ dnl --------------------------------------------------------------------------- dnl Macro: PROTOCOL_BINARY_TEST dnl --------------------------------------------------------------------------- -AC_DEFUN([PROTOCOL_BINARY_TEST], -[ - AC_CACHE_CHECK([for supported struct padding], [ac_cv_supported_struct_padding], [ - AC_LANG_PUSH([C]) - save_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS -I${srcdir}" - AC_TRY_COMPILE([ -#include +AC_DEFUN([PROTOCOL_BINARY_TEST], [ + AC_LANG_PUSH([C++]) + AC_CACHE_CHECK([for supported struct padding], [ac_cv_supported_struct_padding], [ + AC_COMPILE_IFELSE([AC_LANG_PROGRAM( + [ #include #include "libmemcached/memcached/protocol_binary.h" - ], [ - protocol_binary_request_set request; - int a = 1; - switch (a) { - case sizeof(request): - case sizeof(request.bytes): + ], [ protocol_binary_request_set request; + int a = 1; + switch (a) { + case sizeof(request): + case sizeof(request.bytes): break; - default: + default: a = 2; - } - ], - [ ac_cv_supported_struct_padding=no ], - [ ac_cv_supported_struct_padding=yes ]) - CFLAGS="$save_CFLAGS" - AC_LANG_POP - ]) - AS_IF([test "x$ac_cv_supported_struct_padding" = "xno"],[ - AC_MSG_ERROR([Unsupported struct padding done by compiler.])]) -]) + } + ])], + [ ac_cv_supported_struct_padding=no ], + [ ac_cv_supported_struct_padding=yes ]) + ]) + AC_LANG_POP + AS_IF([test "x$ac_cv_supported_struct_padding" = "xno"],[ AC_MSG_ERROR([Unsupported struct padding done by compiler.])]) + ]) dnl --------------------------------------------------------------------------- dnl End Macro: PROTOCOL_BINARY_TEST diff --git a/tests/libmemcached-1.0/mem_functions.cc b/tests/libmemcached-1.0/mem_functions.cc index 1f48aa13..837888ed 100644 --- a/tests/libmemcached-1.0/mem_functions.cc +++ b/tests/libmemcached-1.0/mem_functions.cc @@ -4215,7 +4215,7 @@ test_return_t regression_bug_442914(memcached_st *memc) { len= (size_t)snprintf(k, sizeof(k), "%0250u", x); memcached_return_t rc= memcached_delete(memc, k, len, 0); - test_true(rc == MEMCACHED_SUCCESS || rc == MEMCACHED_BUFFERED); + test_true_got(rc == MEMCACHED_SUCCESS or rc == MEMCACHED_BUFFERED, memcached_last_error_message(memc)); } len= snprintf(k, sizeof(k), "%037u", 251U); @@ -4237,7 +4237,9 @@ test_return_t regression_bug_447342(memcached_st *memc) memcached_server_instance_st instance_two; if (memcached_server_count(memc) < 3 or pre_replication(memc) != TEST_SUCCESS) + { return TEST_SKIPPED; + } test_compare(MEMCACHED_SUCCESS, memcached_behavior_set(memc, MEMCACHED_BEHAVIOR_NUMBER_OF_REPLICAS, 2));