[llvm] Fix more memory leaks.
[mono.git] / mono / utils / mono-compiler.h
index 3ed8a8fbcb5ac80fe64be634c860f3ac630c4522..a533a9f01e33867044ce77558d92992f1bfac588 100644 (file)
 #  define MONO_THREAD_VAR_OFFSET(var,offset) do { guint64 foo;                                 \
                                                __asm__ ("basr  %%r1,0\n\t"                     \
                                                         "j     0f\n\t"                         \
-                                                        ".quad " #var "@INDNTPOFF\n\t"         \
+                                                        ".quad " #var "@TLSGD\n\t"             \
                                                         "0:\n\t"                               \
                                                         "lg    %%r2,4(%%r1)\n\t"               \
-                                                        "brasl %%r14,__tls_get_offset@PLT\n\t" \
+                                                        "brasl %%r14,__tls_get_offset@PLT:tls_gdcall:"#var"\n\t" \
                                                         "lgr   %0,%%r2\n\t"                    \
                                                        : "=r" (foo) :                          \
                                                        : "1", "2", "14", "cc");                \
 /* Deal with Microsoft C compiler differences */
 #ifdef _MSC_VER
 
+#include <math.h>
+
+#if _MSC_VER < 1800 /* VS 2013 */
+#define strtoull _strtoui64
+#endif
+
 #include <float.h>
 #define isnan(x)       _isnan(x)
 #define trunc(x)       (((x) < 0) ? ceil((x)) : floor((x)))
 
 #endif /* _MSC_VER */
 
-#if !defined(_MSC_VER) && !defined(PLATFORM_SOLARIS) && !defined(_WIN32) && !defined(__CYGWIN__) && HAVE_VISIBILITY_HIDDEN
+#if !defined(_MSC_VER) && !defined(PLATFORM_SOLARIS) && !defined(_WIN32) && !defined(__CYGWIN__) && !defined(MONOTOUCH) && HAVE_VISIBILITY_HIDDEN
 #define MONO_INTERNAL __attribute__ ((visibility ("hidden")))
 #if MONO_LLVM_LOADED
 #define MONO_LLVM_INTERNAL 
 #define MONO_DEPRECATED 
 #endif
 
+#ifdef __GNUC__
+#define MONO_ALWAYS_INLINE __attribute__((always_inline))
+#elif defined(_MSC_VER)
+#define MONO_ALWAYS_INLINE __forceinline
+#else
+#define MONO_ALWAYS_INLINE
+#endif
+
 #endif /* __UTILS_MONO_COMPILER_H__*/