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-Url: http://git.lttng.org/?p=lttng-ust.git;a=commitdiff_plain;h=f259c81b5a19f56b0d90bdcb26d8ea8b4b5a1476 Rename uuid.h wrapper to lttng-ust-uuid.h commit eda498b8b8e095ff45eb4906413994987ead66ec upstream. So it does not clash with BSD system's uuid.h Signed-off-by: Mathieu Desnoyers Signed-off-by: Christian Babeux --- diff --git a/liblttng-ust/Makefile.am b/liblttng-ust/Makefile.am index 16070d59..e68953a3 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 627acfec..2b9037ef 100644 --- a/liblttng-ust/ltt-events.c +++ b/liblttng-ust/ltt-events.c @@ -47,7 +47,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 7b6827ff..f18b4ed3 100644 --- a/liblttng-ust/ltt-ring-buffer-client.h +++ b/liblttng-ust/ltt-ring-buffer-client.h @@ -24,7 +24,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 */