[reflection] Use coop handles for MonoMethod icalls (#4272)
[mono.git] / mono / io-layer / io-portability.c
index fbfff02febfea0f468169cdb37f539c2efa54902..282cbe93a29b8e6f60923db0fafba329529ac924 100644 (file)
@@ -6,6 +6,7 @@
  *     Dick Porter (dick@ximian.com)
  *
  * Copyright (c) 2006 Novell, Inc.
+ * Licensed under the MIT license. See LICENSE file in the project root for full license information.
  */
 
 #include <config.h>
 #include <unistd.h>
 #include <stdlib.h>
 #include <sys/types.h>
-#include <dirent.h>
+#include <sys/time.h>
+#ifdef HAVE_DIRENT_H
+# include <dirent.h>
+#endif
 #include <utime.h>
 #include <sys/stat.h>
 
-#include <mono/io-layer/mono-mutex.h>
 #include <mono/io-layer/error.h>
 #include <mono/io-layer/wapi_glob.h>
 #include <mono/io-layer/io-portability.h>
@@ -302,7 +305,9 @@ gchar *_wapi_basename (const gchar *filename)
 {
        gchar *new_filename = g_strdup (filename), *ret;
 
-       g_strdelimit (new_filename, "\\", '/');
+       if (IS_PORTABILITY_SET) {
+               g_strdelimit (new_filename, "\\", '/');
+       }
 
        if (IS_PORTABILITY_DRIVE &&
            g_ascii_isalpha (new_filename[0]) &&
@@ -323,7 +328,9 @@ gchar *_wapi_dirname (const gchar *filename)
 {
        gchar *new_filename = g_strdup (filename), *ret;
 
-       g_strdelimit (new_filename, "\\", '/');
+       if (IS_PORTABILITY_SET) {
+               g_strdelimit (new_filename, "\\", '/');
+       }
 
        if (IS_PORTABILITY_DRIVE &&
            g_ascii_isalpha (new_filename[0]) &&