noinst_LTLIBRARIES = libcompat.la
-libcompat_la_SOURCES = dummy.c
+libcompat_la_SOURCES = compat_uuid.c
libcompat_la_LDFLAGS = \
$(LD_NO_AS_NEEDED)
-
-if BABELTRACE_BUILD_WITH_MINGW
-libcompat_la_SOURCES += compat_uuid.c
-endif
* SOFTWARE.
*/
-/* This file is only built under MINGW32 */
+#ifdef __MINGW32__
-#include <windows.h>
+#include <rpc.h>
#include <stdlib.h>
#include <babeltrace/compat/uuid-internal.h>
static
void fix_uuid_endian(unsigned char * ptr)
{
- swap(ptr, 0, 3)
- swap(ptr, 1, 2)
- swap(ptr, 4, 5)
- swap(ptr, 6, 7)
+ swap(ptr, 0, 3);
+ swap(ptr, 1, 2);
+ swap(ptr, 4, 5);
+ swap(ptr, 6, 7);
}
int bt_uuid_generate(unsigned char *uuid_out)
{
RPC_STATUS status;
- status = UuidCreate((struct UUID *)uuid_out);
+ status = UuidCreate((UUID *) uuid_out);
if (status == RPC_S_OK)
return 0;
else
memcpy(copy_of_uuid_in, uuid_in, BABELTRACE_UUID_LEN);
fix_uuid_endian(copy_of_uuid_in);
- status = UuidToString((struct UUID *) copy_of_uuid_in, &alloc_str);
+ status = UuidToString((UUID *) copy_of_uuid_in, &alloc_str);
if (status == RPC_S_OK) {
strncpy(str_out, (char *) alloc_str, BABELTRACE_UUID_STR_LEN);
RPC_STATUS status;
status = UuidFromString((unsigned char *) str_in,
- (struct UUID *) uuid_out);
+ (UUID *) uuid_out);
fix_uuid_endian(uuid_out);
if (status == RPC_S_OK)
{
RPC_STATUS status;
- if (!UuidCompare((struct UUID *) uuid_a, (struct UUID *) uuid_b,
- &status)) {
- return 0;
- } else {
- return -1;
- }
+ return !UuidCompare((UUID *) uuid_a, (UUID *) uuid_b, &status) ? 0 : -1;
}
+
+#endif
+++ /dev/null
-/* BSD versions of ar won't accept an empty file list */
-int bt_looks_like_iso_requires_this = 23;
uint64_t precision;
int64_t offset_s; /* Offset in seconds */
int64_t offset; /* Offset in ticks */
- uuid_t uuid;
+ unsigned char uuid[BABELTRACE_UUID_LEN];
int uuid_set;
int absolute;
#include <babeltrace/types.h>
#include <glib.h>
#include <sys/types.h>
-#include <uuid/uuid.h>
+#include <babeltrace/compat/uuid-internal.h>
enum field_type_alias {
FIELD_TYPE_ALIAS_UINT5_T = 0,
struct bt_object base;
GString *name;
int frozen;
- uuid_t uuid;
+ unsigned char uuid[BABELTRACE_UUID_LEN];
bt_bool uuid_set;
enum bt_ctf_byte_order native_byte_order;
struct bt_value *environment;
goto end;
}
- memcpy(clock_class->uuid, uuid, sizeof(uuid_t));
+ memcpy(clock_class->uuid, uuid, BABELTRACE_UUID_LEN);
clock_class->uuid_set = 1;
BT_LOGV("Set clock class's UUID: addr=%p, name=\"%s\", "
"uuid=\"%02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x-%02x%02x%02x%02x%02x%02x\"",
goto end;
}
- memcpy(trace->uuid, uuid, sizeof(uuid_t));
+ memcpy(trace->uuid, uuid, BABELTRACE_UUID_LEN);
trace->uuid_set = BT_TRUE;
BT_LOGV("Set trace's UUID: addr=%p, name=\"%s\", "
"uuid=\"%02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x-%02x%02x%02x%02x%02x%02x\"",
* SOFTWARE.
*/
+#define BT_LOG_TAG "WRITER"
+#include <babeltrace/lib-logging-internal.h>
+
#include <babeltrace/ctf-writer/clock-internal.h>
#include <babeltrace/ctf-writer/writer-internal.h>
#include <babeltrace/ctf-ir/field-types-internal.h>
}
/* Generate a UUID for this writer's trace */
- uuid_generate(uuid);
+ ret = bt_uuid_generate(uuid);
+ if (ret) {
+ BT_LOGE_STR("Cannot generate UUID for CTF writer's trace.");
+ goto error_destroy;
+ }
+
ret = bt_ctf_trace_set_uuid(writer->trace, uuid);
if (ret) {
goto error_destroy;