X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=tests%2Fkeys.hpp;h=1034a672b0798b522e9c4baee5210e8e41c9a48e;hb=770d4f6b4cc99bff87d27f4cbe52b2c6a2f2fbd2;hp=342346fc4d19217715530f7891f2215747932aa5;hpb=9e4ae978d7d40c4f1c7d221c61a07a31a5e270d5;p=awesomized%2Flibmemcached diff --git a/tests/keys.hpp b/tests/keys.hpp index 342346fc..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));