[xbuild] Fix assembly name comparison when resolving references.
[mono.git] / mono / metadata / environment.c
index 0313affe16eb997b30512d1bbb203ea011733183..00ec7dc24b0308a7ff51c9bb3a03aca3df202a65 100644 (file)
@@ -5,8 +5,8 @@
  *     Dick Porter (dick@ximian.com)
  *     Sebastien Pouliot (sebastien@ximian.com)
  *
- * (C) 2002 Ximian, Inc.
- * (C) 2004 Novell (http://www.novell.com)
+ * Copyright 2002-2003 Ximian, Inc (http://www.ximian.com)
+ * Copyright 2004-2009 Novell, Inc (http://www.novell.com)
  */
 
 #include <config.h>
 #include <mono/metadata/appdomain.h>
 #include <mono/metadata/environment.h>
 #include <mono/metadata/exception.h>
+#include <mono/utils/mono-compiler.h>
 #include <mono/io-layer/io-layer.h>
 
-#ifndef PLATFORM_WIN32
+extern MonoString* ves_icall_System_Environment_GetOSVersionString (void) MONO_INTERNAL;
+
+#if !defined(HOST_WIN32) && defined(HAVE_SYS_UTSNAME_H)
 #include <sys/utsname.h>
 #endif
 
@@ -37,7 +40,7 @@ void mono_environment_exitcode_set (gint32 value)
 MonoString*
 ves_icall_System_Environment_GetOSVersionString (void)
 {
-#ifdef PLATFORM_WIN32
+#ifdef HOST_WIN32
        OSVERSIONINFO verinfo;
 
        MONO_ARCH_SAVE_REGS;
@@ -53,21 +56,15 @@ ves_icall_System_Environment_GetOSVersionString (void)
                        verinfo.dwBuildNumber);
                return mono_string_new (mono_domain_get (), version);
        }
-#else
+#elif defined(HAVE_SYS_UTSNAME_H)
        struct utsname name;
 
        MONO_ARCH_SAVE_REGS;
 
-       if (uname (&name) == 0) {
+       if (uname (&name) >= 0) {
                return mono_string_new (mono_domain_get (), name.release);
        }
 #endif
        return mono_string_new (mono_domain_get (), "0.0.0.0");
 }
 
-gint32 ves_icall_System_Environment_get_ProcessorCount(void)
-{
-       SYSTEM_INFO sys_info;
-       GetSystemInfo(&sys_info);
-       return sys_info.dwNumberOfProcessors;
-}