From: Brian Aker Date: Thu, 10 Feb 2011 19:14:07 +0000 (-0800) Subject: Fix for ancient solaris platforms. ie bug 695726 X-Git-Tag: 0.51~45^2~9 X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=6a53d3699eb2b69773f0ed1e78a99ed93a1349ab;p=m6w6%2Flibmemcached Fix for ancient solaris platforms. ie bug 695726 --- diff --git a/libmemcached/storage.c b/libmemcached/storage.c index 782a3766..deb4aed4 100644 --- a/libmemcached/storage.c +++ b/libmemcached/storage.c @@ -106,12 +106,12 @@ static inline memcached_return_t memcached_send(memcached_st *ptr, { int check_length; check_length= snprintf(buffer, MEMCACHED_DEFAULT_COMMAND_SIZE, - "%s %.*s%.*s %u %llu %zu %llu%s\r\n", + "%s %.*s%.*s %u %llu %lu %llu%s\r\n", storage_op_string(verb), (int)ptr->prefix_key_length, ptr->prefix_key, (int)key_length, key, flags, - (unsigned long long)expiration, value_length, + (unsigned long long)expiration, (unsigned long)value_length, (unsigned long long)cas, (ptr->flags.no_reply) ? " noreply" : ""); if (check_length >= MEMCACHED_DEFAULT_COMMAND_SIZE || check_length < 0) @@ -144,9 +144,9 @@ static inline memcached_return_t memcached_send(memcached_st *ptr, write_length= (size_t)(buffer_ptr - buffer); int check_length; check_length= snprintf(buffer_ptr, MEMCACHED_DEFAULT_COMMAND_SIZE -(size_t)(buffer_ptr - buffer), - "%u %llu %zu%s\r\n", + "%u %llu %lu%s\r\n", flags, - (unsigned long long)expiration, value_length, + (unsigned long long)expiration, (unsigned long)value_length, ptr->flags.no_reply ? " noreply" : ""); if ((size_t)check_length >= MEMCACHED_DEFAULT_COMMAND_SIZE -(size_t)(buffer_ptr - buffer) || check_length < 0) { diff --git a/libmemcached/watchpoint.h b/libmemcached/watchpoint.h index fc25eb5c..341f4fe2 100644 --- a/libmemcached/watchpoint.h +++ b/libmemcached/watchpoint.h @@ -58,9 +58,9 @@ static inline void libmemcached_stack_dump(void) #define WATCHPOINT_IFERROR(A) do { if(A != MEMCACHED_SUCCESS)fprintf(stderr, "\nWATCHPOINT %s:%d %s\n", __FILE__, __LINE__, memcached_strerror(NULL, A));fflush(stdout); } while (0) #define WATCHPOINT_STRING(A) do { fprintf(stderr, "\nWATCHPOINT %s:%d (%s) %s\n", __FILE__, __LINE__,__func__,A);fflush(stdout); } while (0) #define WATCHPOINT_STRING_LENGTH(A,B) do { fprintf(stderr, "\nWATCHPOINT %s:%d (%s) %.*s\n", __FILE__, __LINE__,__func__,(int)B,A);fflush(stdout); } while (0) -#define WATCHPOINT_NUMBER(A) do { fprintf(stderr, "\nWATCHPOINT %s:%d (%s) %zu\n", __FILE__, __LINE__,__func__,(size_t)(A));fflush(stdout); } while (0) -#define WATCHPOINT_LABELED_NUMBER(A,B) do { fprintf(stderr, "\nWATCHPOINT %s:%d (%s) %s:%zu\n", __FILE__, __LINE__,__func__,(A),(size_t)(B));fflush(stdout); } while (0) -#define WATCHPOINT_IF_LABELED_NUMBER(A,B,C) do { if(A) {fprintf(stderr, "\nWATCHPOINT %s:%d (%s) %s:%zu\n", __FILE__, __LINE__,__func__,(B),(size_t)(C));fflush(stdout);} } while (0) +#define WATCHPOINT_NUMBER(A) do { fprintf(stderr, "\nWATCHPOINT %s:%d (%s) %lu\n", __FILE__, __LINE__,__func__,(unsigned long)(A));fflush(stdout); } while (0) +#define WATCHPOINT_LABELED_NUMBER(A,B) do { fprintf(stderr, "\nWATCHPOINT %s:%d (%s) %s:%lu\n", __FILE__, __LINE__,__func__,(A),(unsigned long)(B));fflush(stdout); } while (0) +#define WATCHPOINT_IF_LABELED_NUMBER(A,B,C) do { if(A) {fprintf(stderr, "\nWATCHPOINT %s:%d (%s) %s:%lu\n", __FILE__, __LINE__,__func__,(B),(unsigned long)(C));fflush(stdout);} } while (0) #define WATCHPOINT_ERRNO(A) do { fprintf(stderr, "\nWATCHPOINT %s:%d (%s) %s\n", __FILE__, __LINE__,__func__, strerror(A));fflush(stdout); } while (0) #define WATCHPOINT_ASSERT_PRINT(A,B,C) do { if(!(A)){fprintf(stderr, "\nWATCHPOINT ASSERT %s:%d (%s) ", __FILE__, __LINE__,__func__);fprintf(stderr, (B),(C));fprintf(stderr,"\n");fflush(stdout); libmemcached_stack_dump(); } assert((A)); } while (0) #define WATCHPOINT_ASSERT(A) do { if (! (A)) {libmemcached_stack_dump();} assert((A)); } while (0)