-/*
- * trace.c: Tracing facilities for the Mono Runtime.
+/**
+ * \file
+ * Tracing facilities for the Mono Runtime.
*
* Author:
* Paolo Molaro (lupus@ximian.com)
#include <mono/utils/mono-memory-model.h>
#include "trace.h"
-#if defined (PLATFORM_ANDROID) || (defined (TARGET_IOS) && defined (TARGET_IOS))
+#if defined (HOST_ANDROID) || (defined (TARGET_IOS) && defined (TARGET_IOS))
# undef printf
# define printf(...) g_log("mono", G_LOG_LEVEL_MESSAGE, __VA_ARGS__)
# undef fprintf
# define fprintf(__ignore, ...) g_log ("mono-gc", G_LOG_LEVEL_MESSAGE, __VA_ARGS__)
#endif
-#ifdef __GNUC__
-
-#define RETURN_ADDRESS_N(N) (__builtin_extract_return_addr (__builtin_return_address (N)))
-#define RETURN_ADDRESS() RETURN_ADDRESS_N(0)
-
-#elif defined(_MSC_VER)
-
-#include <intrin.h>
-#pragma intrinsic(_ReturnAddress)
-
-#define RETURN_ADDRESS() _ReturnAddress()
-#define RETURN_ADDRESS_N(N) NULL
-
-#else
-
-#error "Missing return address intrinsics implementation"
-
-#endif
-
static MonoTraceSpec trace_spec;
static volatile gint32 output_lock = 0;
}
if (value != NULL)
g_free (value);
- value = (char *)g_malloc (input - start + 1);
- strncpy (value, start, input-start);
- value [input-start] = 0;
+ size_t len = input - start;
+ value = (char *)g_malloc (len + 1);
+ memcpy (value, start, len);
+ value [len] = 0;
}
enum Token {