testing: tsan
[m6w6/libmemcached] / tests / keys.hpp
index 342346fc4d19217715530f7891f2215747932aa5..1034a672b0798b522e9c4baee5210e8e41c9a48e 100644 (file)
@@ -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 <uuid/uuid.h>
+#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));