X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=tests%2Fkeys.hpp;h=1034a672b0798b522e9c4baee5210e8e41c9a48e;hb=d169e8c62f8ca4fe7d058d8e2254426105032b7e;hp=54d6e4f5eb0923f454e5a36660d55a1c5b94e785;hpb=f065750cfe2a57587f372b80006c6a3399825cff;p=awesomized%2Flibmemcached diff --git a/tests/keys.hpp b/tests/keys.hpp index 54d6e4f5..1034a672 100644 --- a/tests/keys.hpp +++ b/tests/keys.hpp @@ -2,7 +2,7 @@ * * Libmemcached library * - * Copyright (C) 2012 Data Differential, http://datadifferential.com/ + * Copyright (C) 2012-2013 Data Differential, http://datadifferential.com/ * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are @@ -35,6 +35,9 @@ */ +#if defined(HAVE_UUID_UUID_H) && HAVE_UUID_UUID_H +#include +#endif struct keys_st { public: @@ -59,18 +62,18 @@ public: key_buffer.resize(padding +1); memset(&key_buffer[0], 'x', padding); - if (HAVE_LIBUUID) +#if defined(HAVE_UUID_UUID_H) && HAVE_UUID_UUID_H + if (HAVE_UUID_UUID_H) { -#if defined(HAVE_LIBUUID) && HAVE_LIBUUID uuid_t out; uuid_generate(out); uuid_unparse(out, &key_buffer[0]); _keys[x]= strdup(&key_buffer[0]); (_keys[x])[UUID_STRING_MAXLENGTH]= 'x'; -#endif } else // We just use a number and pad the string if UUID is not available +#endif { char int_buffer[MEMCACHED_MAXIMUM_INTEGER_DISPLAY_LENGTH +1]; int key_length= snprintf(int_buffer, sizeof(int_buffer), "%u", uint32_t(x)); @@ -85,7 +88,7 @@ public: { for (libtest::vchar_ptr_t::iterator iter= _keys.begin(); iter != _keys.end(); - iter++) + ++iter) { ::free(*iter); }