[arm64] Allow v8..v15 in unwind info on arm64. Fixes part of #21615.
[mono.git] / mono / metadata / mono-config.c
index 34f0326148b37bac7e44c8bef371c2db6bf98931..5d7d9429b1ddaa16f4a5c96ae3e5206d17e5d0f4 100644 (file)
@@ -33,7 +33,7 @@
 #define CONFIG_OS "netbsd"
 #elif defined(__OpenBSD__)
 #define CONFIG_OS "openbsd"
-#elif defined(__WIN32__)
+#elif defined(__WIN32__) || defined(TARGET_WIN32)
 #define CONFIG_OS "windows"
 #elif defined(_IBMR2)
 #define CONFIG_OS "aix"
 #endif
 
 #ifndef CONFIG_CPU
-#if defined(__i386__)
+#if defined(__i386__) || defined(TARGET_X86)
 #define CONFIG_CPU "x86"
 #define CONFIG_WORDSIZE "32"
-#elif defined(__x86_64__)
+#elif defined(__x86_64__) || defined(TARGET_AMD64)
 #define CONFIG_CPU "x86-64"
 #define CONFIG_WORDSIZE "64"
 #elif defined(sparc) || defined(__sparc__)
 #elif defined(__arm__)
 #define CONFIG_CPU "arm"
 #define CONFIG_WORDSIZE "32"
+#elif defined(__aarch64__)
+#define CONFIG_CPU "armv8"
+#define CONFIG_WORDSIZE "64"
 #elif defined(__ia64__)
 #define CONFIG_CPU "ia64"
 #define CONFIG_WORDSIZE "64"
-#elif defined(__alpha__)
-#define CONFIG_CPU "alpha"
-#define CONFIG_WORDSIZE "64"
-#elif defined(hppa) || defined(__hppa__)
-#define CONFIG_CPU "hppa"
-#define CONFIG_WORDSIZE "32"
 #elif defined(mips) || defined(__mips) || defined(_mips)
 #define CONFIG_CPU "mips"
 #define CONFIG_WORDSIZE "32"
@@ -374,7 +371,8 @@ mono_config_init (void)
 void
 mono_config_cleanup (void)
 {
-       g_hash_table_destroy (config_handlers);
+       if (config_handlers)
+               g_hash_table_destroy (config_handlers);
        g_free (mono_cfg_dir_allocated);
 }
 
@@ -569,7 +567,7 @@ mono_config_parse (const char *filename) {
        mono_config_parse_file (mono_cfg);
        g_free (mono_cfg);
 
-#ifndef TARGET_WIN32
+#if !defined(TARGET_WIN32) && !defined(__native_client__)
        home = g_get_home_dir ();
        user_cfg = g_strconcat (home, G_DIR_SEPARATOR_S, ".mono/config", NULL);
        mono_config_parse_file (user_cfg);
@@ -795,3 +793,17 @@ mono_config_parse_assembly_bindings (const char *filename, int amajor, int amino
        mono_config_parse_file_with_context (&state, filename);
 }
 
+static mono_bool mono_server_mode = FALSE;
+
+void
+mono_config_set_server_mode (mono_bool server_mode)
+{
+       mono_server_mode = server_mode;
+}
+
+mono_bool
+mono_config_is_server_mode (void)
+{
+       return mono_server_mode;
+}
+