From: Mathieu Desnoyers Date: Tue, 21 Feb 2012 15:01:15 +0000 (-0500) Subject: Rename uuid.h wrapper to lttng-ust-uuid.h X-Git-Tag: v2.0.0-rc2~62 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=f194f3b00d042154c35f1f9ec262e25f2cd83b8a;p=lttng-ust.git Rename uuid.h wrapper to lttng-ust-uuid.h So it does not clash with BSD system's uuid.h Signed-off-by: Mathieu Desnoyers --- diff --git a/liblttng-ust/Makefile.am b/liblttng-ust/Makefile.am index 628e56fb..75a2ba8a 100644 --- a/liblttng-ust/Makefile.am +++ b/liblttng-ust/Makefile.am @@ -34,7 +34,7 @@ liblttng_ust_runtime_la_SOURCES = \ wait.h \ jhash.h \ error.h \ - uuid.h + lttng-ust-uuid.h liblttng_ust_support_la_SOURCES = \ ltt-tracer.h \ diff --git a/liblttng-ust/clock.h b/liblttng-ust/clock.h index b4d17e78..1523be09 100644 --- a/liblttng-ust/clock.h +++ b/liblttng-ust/clock.h @@ -25,7 +25,7 @@ #include #include #include -#include "uuid.h" +#include "lttng-ust-uuid.h" /* TRACE CLOCK */ diff --git a/liblttng-ust/ltt-events.c b/liblttng-ust/ltt-events.c index b0f4a50f..4a0981b6 100644 --- a/liblttng-ust/ltt-events.c +++ b/liblttng-ust/ltt-events.c @@ -35,7 +35,7 @@ #include #include "error.h" #include "compat.h" -#include "uuid.h" +#include "lttng-ust-uuid.h" #include "tracepoint-internal.h" #include "ltt-tracer.h" diff --git a/liblttng-ust/ltt-ring-buffer-client.h b/liblttng-ust/ltt-ring-buffer-client.h index 825db712..cedbc31d 100644 --- a/liblttng-ust/ltt-ring-buffer-client.h +++ b/liblttng-ust/ltt-ring-buffer-client.h @@ -12,7 +12,7 @@ #include #include "lttng/bitfield.h" #include "clock.h" -#include "uuid.h" +#include "lttng-ust-uuid.h" #include "ltt-tracer.h" #include "../libringbuffer/frontend_types.h" diff --git a/liblttng-ust/lttng-ust-uuid.h b/liblttng-ust/lttng-ust-uuid.h new file mode 100644 index 00000000..1027acbe --- /dev/null +++ b/liblttng-ust/lttng-ust-uuid.h @@ -0,0 +1,54 @@ +#ifndef _LTTNG_UST_UUID_H +#define _LTTNG_UST_UUID_H + +/* + * Copyright (C) 2011 Mathieu Desnoyers + * + * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED + * OR IMPLIED. ANY USE IS AT YOUR OWN RISK. + * + * Permission is hereby granted to use or copy this program + * for any purpose, provided the above notices are retained on all copies. + * Permission to modify the code and to distribute modified code is granted, + * provided the above notices are retained, and a notice that the code was + * modified is included with the above copyright notice. + */ + +#include +#include /* For LTTNG_UST_UUID_LEN */ +/* + * Includes final \0. + */ +#define LTTNG_UST_UUID_STR_LEN 37 + +#include + +#ifdef LTTNG_UST_HAVE_LIBUUID +static inline +int lttng_ust_uuid_generate(unsigned char *uuid_out) +{ + uuid_generate(uuid_out); + return 0; +} + +#elif defined(LTTNG_UST_HAVE_LIBC_UUID) +#include +#include + +static inline +int lttng_ust_uuid_generate(unsigned char *uuid_out) +{ + uint32_t status; + + uuid_create(uuid_out, &status); + if (status == uuid_s_ok) + return 0; + else + return -1; +} + +#else +#error "LTTng-UST needs to have a UUID generator configured." +#endif + +#endif /* _LTTNG_UST_UUID_H */ diff --git a/liblttng-ust/uuid.h b/liblttng-ust/uuid.h deleted file mode 100644 index 1027acbe..00000000 --- a/liblttng-ust/uuid.h +++ /dev/null @@ -1,54 +0,0 @@ -#ifndef _LTTNG_UST_UUID_H -#define _LTTNG_UST_UUID_H - -/* - * Copyright (C) 2011 Mathieu Desnoyers - * - * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED - * OR IMPLIED. ANY USE IS AT YOUR OWN RISK. - * - * Permission is hereby granted to use or copy this program - * for any purpose, provided the above notices are retained on all copies. - * Permission to modify the code and to distribute modified code is granted, - * provided the above notices are retained, and a notice that the code was - * modified is included with the above copyright notice. - */ - -#include -#include /* For LTTNG_UST_UUID_LEN */ -/* - * Includes final \0. - */ -#define LTTNG_UST_UUID_STR_LEN 37 - -#include - -#ifdef LTTNG_UST_HAVE_LIBUUID -static inline -int lttng_ust_uuid_generate(unsigned char *uuid_out) -{ - uuid_generate(uuid_out); - return 0; -} - -#elif defined(LTTNG_UST_HAVE_LIBC_UUID) -#include -#include - -static inline -int lttng_ust_uuid_generate(unsigned char *uuid_out) -{ - uint32_t status; - - uuid_create(uuid_out, &status); - if (status == uuid_s_ok) - return 0; - else - return -1; -} - -#else -#error "LTTng-UST needs to have a UUID generator configured." -#endif - -#endif /* _LTTNG_UST_UUID_H */