[io-layer] Remove io-layer.h include from as many headers as possible (#4088)
authorLudovic Henry <ludovic@xamarin.com>
Tue, 6 Dec 2016 14:50:26 +0000 (09:50 -0500)
committerGitHub <noreply@github.com>
Tue, 6 Dec 2016 14:50:26 +0000 (09:50 -0500)
25 files changed:
mono/metadata/appdomain.c
mono/metadata/attach.c
mono/metadata/class-internals.h
mono/metadata/cominterop.c
mono/metadata/console-io.h
mono/metadata/console-unix.c
mono/metadata/domain-internals.h
mono/metadata/domain.c
mono/metadata/file-io.h
mono/metadata/file-mmap.h
mono/metadata/filewatcher.c
mono/metadata/filewatcher.h
mono/metadata/monitor.h
mono/metadata/object-internals.h
mono/metadata/object.c
mono/metadata/sre-save.c
mono/metadata/sre.c
mono/metadata/threadpool-ms.c
mono/metadata/threads-types.h
mono/metadata/w32handle.c
mono/metadata/w32process.c
mono/mini/aot-compiler.c
mono/mini/debugger-agent.c
mono/utils/mono-threads.c
mono/utils/mono-threads.h

index 6c4b09fb6e0984177ac4a419261d73ce7b855634..a571f676b455dd25ba9710505e52c5ae822651db 100644 (file)
@@ -70,6 +70,7 @@
 #include <mono/utils/mono-memory-model.h>
 #include <mono/utils/mono-threads.h>
 #include <mono/metadata/w32handle.h>
+#include <mono/io-layer/io-layer.h>
 #ifdef HOST_WIN32
 #include <direct.h>
 #endif
index 2c4372ba4b493fed8b441d6704c31c88a713da4c..6fc81e0898495bc1f2d608290859ea3daa4d1a2e 100644 (file)
@@ -42,6 +42,8 @@
 #include <mono/utils/mono-threads.h>
 #include "attach.h"
 
+#include <mono/io-layer/io-layer.h>
+
 /*
  * This module enables other processes to attach to a running mono process and
  * load agent assemblies. 
index 04a8d54fbd26cace199de9b41246540ae72a265b..dab2cc743c9011ef0e6d2ce4828da1f9c4b6e6be 100644 (file)
@@ -10,7 +10,6 @@
 #include <mono/metadata/mempool.h>
 #include <mono/metadata/metadata-internals.h>
 #include <mono/metadata/property-bag.h>
-#include <mono/io-layer/io-layer.h>
 #include "mono/utils/mono-compiler.h"
 #include "mono/utils/mono-error.h"
 #include "mono/sgen/gc-internal-agnostic.h"
index e3ba400a2c4a59162f573dd7d1c6fa46f9959074..f3beb972401bc99e6190c69ff1f5ee9b3835799b 100644 (file)
@@ -38,6 +38,7 @@
 #include "mono/utils/atomic.h"
 #include "mono/utils/mono-error.h"
 #include "mono/utils/mono-error-internals.h"
+#include "mono/io-layer/io-layer.h"
 #include <string.h>
 #include <errno.h>
 
index 54ee88204637c491d83ec9e7207404bba1aab863..9ec32ddd0e6931289dcfba14bf381ce7e0ceedf7 100644 (file)
 #include <glib.h>
 
 #include <mono/metadata/object.h>
-#include <mono/io-layer/io-layer.h>
 #include <mono/utils/mono-compiler.h>
 
 G_BEGIN_DECLS
 
 void mono_console_init (void);
 void mono_console_handle_async_ops (void);
-MonoBoolean ves_icall_System_ConsoleDriver_Isatty (HANDLE handle);
+MonoBoolean ves_icall_System_ConsoleDriver_Isatty (gpointer handle);
 gint32 ves_icall_System_ConsoleDriver_InternalKeyAvailable (gint32 timeout);
 MonoBoolean ves_icall_System_ConsoleDriver_SetEcho (MonoBoolean echo);
 MonoBoolean ves_icall_System_ConsoleDriver_SetBreak (MonoBoolean want_break);
index 38a82c92e957f3cb76cde6f66bd2031f6009c881..102723229665b2475b77ec304ac0724a7039766e 100644 (file)
@@ -37,6 +37,7 @@
 #include <mono/metadata/threadpool-ms.h>
 #include <mono/utils/mono-signal-handler.h>
 #include <mono/utils/mono-proclib.h>
+#include <mono/io-layer/io-layer.h>
 
 /* On solaris, curses.h must come before both termios.h and term.h */
 #ifdef HAVE_CURSES_H
index ecf2012d62ac744ee9f63f74cbe6224fd9f516c4..a083d1ccc88ce2614c34f77c3e3967aa0d25d274 100644 (file)
@@ -13,7 +13,6 @@
 #include <mono/metadata/mono-hash.h>
 #include <mono/utils/mono-compiler.h>
 #include <mono/utils/mono-internal-hash.h>
-#include <mono/io-layer/io-layer.h>
 #include <mono/metadata/mempool-internals.h>
 
 /*
index 020b0dd00c4406bc0d482714b2af17e65836b0d6..c48c6d0811c5b47a3f8b5fb53aa3b9495dea3a0b 100644 (file)
@@ -47,6 +47,7 @@
 #include <metadata/threads.h>
 #include <metadata/profiler-private.h>
 #include <mono/metadata/coree.h>
+#include <mono/io-layer/io-layer.h>
 
 //#define DEBUG_DOMAIN_UNLOAD 1
 
index 2e8e8b9f7463625ffd23716e6b56fab3c69fa3e5..b7b7320debbf641c1f9946a9bd3ec2b0e00025a0 100644 (file)
@@ -17,7 +17,6 @@
 #include <glib.h>
 
 #include <mono/metadata/object-internals.h>
-#include <mono/io-layer/io-layer.h>
 #include <mono/utils/mono-compiler.h>
 
 G_BEGIN_DECLS
@@ -126,20 +125,20 @@ ves_icall_System_IO_MonoIO_GetFileSystemEntries (MonoString *path,
                                                 gint mask, gint attrs,
                                                 gint32 *error);
 
-extern HANDLE
+extern gpointer
 ves_icall_System_IO_MonoIO_FindFirstFile (MonoString *path_with_pattern,
                                                MonoString **file_name,
                                                gint32 *file_attr,
                                                gint32 *ioerror);
 
 extern MonoBoolean
-ves_icall_System_IO_MonoIO_FindNextFile (HANDLE hnd,
+ves_icall_System_IO_MonoIO_FindNextFile (gpointer hnd,
                                                MonoString **file_name,
                                                gint32 *file_attr,
                                                gint32 *ioerror);
 
 extern MonoBoolean
-ves_icall_System_IO_MonoIO_FindCloseFile (HANDLE hnd);
+ves_icall_System_IO_MonoIO_FindCloseFile (gpointer hnd);
 
 extern MonoString *
 ves_icall_System_IO_MonoIO_FindFirst (MonoString *path,
@@ -179,64 +178,64 @@ ves_icall_System_IO_MonoIO_SetFileAttributes (MonoString *path, gint32 attrs,
                                              gint32 *error);
 
 extern gint32
-ves_icall_System_IO_MonoIO_GetFileType (HANDLE handle, gint32 *error);
+ves_icall_System_IO_MonoIO_GetFileType (gpointer handle, gint32 *error);
 
 extern MonoBoolean
 ves_icall_System_IO_MonoIO_GetFileStat (MonoString *path, MonoIOStat *stat,
                                        gint32 *error);
 
-extern HANDLE 
+extern gpointer 
 ves_icall_System_IO_MonoIO_Open (MonoString *filename, gint32 mode,
                                 gint32 access_mode, gint32 share, gint32 options,
                                 gint32 *error);
 
 extern MonoBoolean
-ves_icall_System_IO_MonoIO_Close (HANDLE handle, gint32 *error);
+ves_icall_System_IO_MonoIO_Close (gpointer handle, gint32 *error);
 
 extern gint32 
-ves_icall_System_IO_MonoIO_Read (HANDLE handle, MonoArray *dest,
+ves_icall_System_IO_MonoIO_Read (gpointer handle, MonoArray *dest,
                                 gint32 dest_offset, gint32 count,
                                 gint32 *error);
 
 extern gint32 
-ves_icall_System_IO_MonoIO_Write (HANDLE handle, MonoArray *src,
+ves_icall_System_IO_MonoIO_Write (gpointer handle, MonoArray *src,
                                  gint32 src_offset, gint32 count,
                                  gint32 *error);
 
 extern gint64 
-ves_icall_System_IO_MonoIO_Seek (HANDLE handle, gint64 offset, gint32 origin,
+ves_icall_System_IO_MonoIO_Seek (gpointer handle, gint64 offset, gint32 origin,
                                 gint32 *error);
 
 extern MonoBoolean
-ves_icall_System_IO_MonoIO_Flush (HANDLE handle, gint32 *error);
+ves_icall_System_IO_MonoIO_Flush (gpointer handle, gint32 *error);
 
 extern gint64 
-ves_icall_System_IO_MonoIO_GetLength (HANDLE handle, gint32 *error);
+ves_icall_System_IO_MonoIO_GetLength (gpointer handle, gint32 *error);
 
 extern MonoBoolean
-ves_icall_System_IO_MonoIO_SetLength (HANDLE handle, gint64 length,
+ves_icall_System_IO_MonoIO_SetLength (gpointer handle, gint64 length,
                                      gint32 *error);
 
 extern MonoBoolean
-ves_icall_System_IO_MonoIO_SetFileTime (HANDLE handle, gint64 creation_time,
+ves_icall_System_IO_MonoIO_SetFileTime (gpointer handle, gint64 creation_time,
                                        gint64 last_access_time,
                                        gint64 last_write_time, gint32 *error);
 
-extern HANDLE 
+extern gpointer 
 ves_icall_System_IO_MonoIO_get_ConsoleOutput (void);
 
-extern HANDLE 
+extern gpointer 
 ves_icall_System_IO_MonoIO_get_ConsoleInput (void);
 
-extern HANDLE 
+extern gpointer 
 ves_icall_System_IO_MonoIO_get_ConsoleError (void);
 
 extern MonoBoolean
-ves_icall_System_IO_MonoIO_CreatePipe (HANDLE *read_handle, HANDLE *write_handle, gint32 *error);
+ves_icall_System_IO_MonoIO_CreatePipe (gpointer *read_handle, gpointer *write_handle, gint32 *error);
 
 extern MonoBoolean
-ves_icall_System_IO_MonoIO_DuplicateHandle (HANDLE source_process_handle, HANDLE source_handle,
-               HANDLE target_process_handle, HANDLE *target_handle, gint32 access, gint32 inherit, gint32 options, gint32 *error);
+ves_icall_System_IO_MonoIO_DuplicateHandle (gpointer source_process_handle, gpointer source_handle,
+               gpointer target_process_handle, gpointer *target_handle, gint32 access, gint32 inherit, gint32 options, gint32 *error);
 
 extern gunichar2 
 ves_icall_System_IO_MonoIO_get_VolumeSeparatorChar (void);
@@ -253,9 +252,9 @@ ves_icall_System_IO_MonoIO_get_PathSeparator (void);
 extern MonoArray *
 ves_icall_System_IO_MonoIO_get_InvalidPathChars (void);
 
-extern void ves_icall_System_IO_MonoIO_Lock (HANDLE handle, gint64 position,
+extern void ves_icall_System_IO_MonoIO_Lock (gpointer handle, gint64 position,
                                             gint64 length, gint32 *error);
-extern void ves_icall_System_IO_MonoIO_Unlock (HANDLE handle, gint64 position,
+extern void ves_icall_System_IO_MonoIO_Unlock (gpointer handle, gint64 position,
                                               gint64 length, gint32 *error);
 
 extern MonoBoolean
index cef862e3bea755408ad986fcafb3f19d87b99cd4..a91b1b11d08b538f51baaf8c043350f4a51b02e1 100644 (file)
@@ -15,7 +15,6 @@
 #include <glib.h>
 
 #include <mono/metadata/object-internals.h>
-#include <mono/io-layer/io-layer.h>
 #include <mono/utils/mono-compiler.h>
 
 extern void mono_mmap_close (void *mmap_handle);
index e6902c6caa394157f7ec2c223980bc84f42df8cd..90a54d5050ad6aaea8545a0f8e7379f32d63eced 100644 (file)
@@ -28,6 +28,8 @@
 #include <mono/metadata/marshal.h>
 #include <mono/utils/mono-dl.h>
 #include <mono/utils/mono-io-portability.h>
+#include <mono/io-layer/io-layer.h>
+
 #ifdef HOST_WIN32
 
 /*
index 605fd0e9ac2503d70c8eb2051e4bf7043adf4846..5982dc5b7bff6e016eb75b76df10f7be50594c8a 100644 (file)
@@ -11,7 +11,6 @@
 #define _MONO_METADATA_FILEWATCHER_H
 
 #include <mono/metadata/object.h>
-#include <mono/io-layer/io-layer.h>
 #include "mono/utils/mono-compiler.h"
 #include <glib.h>
 
index 3c479f5736f910f7f1086dec5e829d5eb7d818c6..13009cc52570e423dc7f362494497d6ea67e485c 100644 (file)
@@ -12,7 +12,6 @@
 
 #include <glib.h>
 #include <mono/metadata/object.h>
-#include <mono/io-layer/io-layer.h>
 #include <mono/utils/mono-compiler.h>
 #include <mono/utils/mono-coop-semaphore.h>
 
index bc76b0460c8b69f7195e4ecf18e27626e5c3de27..f0e024c1d4f1d137a2a94bab73d88d7eade6178f 100644 (file)
@@ -8,7 +8,6 @@
 #include <mono/metadata/class-internals.h>
 #include <mono/metadata/threads-types.h>
 #include <mono/metadata/handle.h>
-#include <mono/io-layer/io-layer.h>
 #include "mono/utils/mono-compiler.h"
 #include "mono/utils/mono-error.h"
 #include "mono/utils/mono-error-internals.h"
@@ -353,7 +352,7 @@ struct _MonoInternalThread {
        MonoObject  obj;
        volatile int lock_thread_id; /* to be used as the pre-shifted thread id in thin locks. Used for appdomain_ref push/pop */
        MonoThreadHandle *handle;
-       HANDLE native_handle;
+       gpointer native_handle;
        MonoArray  *cached_culture_info;
        gunichar2  *name;
        guint32     name_len;
@@ -615,16 +614,16 @@ MONO_COLD void mono_set_pending_exception (MonoException *exc);
 /* remoting and async support */
 
 MonoAsyncResult *
-mono_async_result_new      (MonoDomain *domain, HANDLE handle, 
+mono_async_result_new      (MonoDomain *domain, gpointer handle, 
                             MonoObject *state, gpointer data, MonoObject *object_data, MonoError *error);
 
 MonoObject *
 ves_icall_System_Runtime_Remoting_Messaging_AsyncResult_Invoke (MonoAsyncResult *ares);
 
 MonoWaitHandle *
-mono_wait_handle_new       (MonoDomain *domain, HANDLE handle, MonoError *error);
+mono_wait_handle_new       (MonoDomain *domain, gpointer handle, MonoError *error);
 
-HANDLE
+gpointer
 mono_wait_handle_get_handle (MonoWaitHandle *handle);
 
 gboolean
@@ -1351,7 +1350,7 @@ typedef struct {
        MonoProperty *prop;
 } CattrNamedArg;
 
-gboolean          mono_image_create_pefile (MonoReflectionModuleBuilder *module, HANDLE file, MonoError *error);
+gboolean          mono_image_create_pefile (MonoReflectionModuleBuilder *module, gpointer file, MonoError *error);
 guint32       mono_image_insert_string (MonoReflectionModuleBuilder *module, MonoString *str);
 guint32       mono_image_create_token  (MonoDynamicImage *assembly, MonoObject *obj, gboolean create_methodspec, gboolean register_token, MonoError *error);
 guint32       mono_image_create_method_token (MonoDynamicImage *assembly, MonoObject *obj, MonoArray *opt_param_types, MonoError *error);
@@ -1770,7 +1769,7 @@ ves_icall_ModuleBuilder_getMethodToken (MonoReflectionModuleBuilder *mb,
                                                                                MonoArray *opt_param_types);
 
 void
-ves_icall_ModuleBuilder_WriteToFile (MonoReflectionModuleBuilder *mb, HANDLE file);
+ves_icall_ModuleBuilder_WriteToFile (MonoReflectionModuleBuilder *mb, gpointer file);
 
 void
 ves_icall_ModuleBuilder_build_metadata (MonoReflectionModuleBuilder *mb);
index b1ac12a9e0cd77c2ef9b582f71e9a5844ff68ba0..0a6df1231eab5944092ad99a6335625ad51c0ac4 100644 (file)
@@ -50,6 +50,7 @@
 #include <mono/utils/mono-threads.h>
 #include <mono/utils/mono-threads-coop.h>
 #include "cominterop.h"
+#include <mono/io-layer/io-layer.h>
 
 static void
 get_default_field_value (MonoDomain* domain, MonoClassField *field, void *value, MonoError *error);
index 0c898b2ec94905f4441723e36f6311151551c489..54a76285bfa0e2a8ff1e76b6ebba67d3af41d286 100644 (file)
@@ -29,6 +29,8 @@
 #include "mono/utils/mono-digest.h"
 #include "mono/utils/mono-error-internals.h"
 
+#include "mono/io-layer/io-layer.h"
+
 #define TEXT_OFFSET 512
 #define CLI_H_SIZE 136
 #define FILE_ALIGN 512
index 041a2ba6f4859f38494cd49ea37422e4e4f3a8aa..d899b2b3b894d6e08b5860ccc7612ae0388e1003 100644 (file)
@@ -34,6 +34,7 @@
 #include "mono/metadata/tokentype.h"
 #include "mono/utils/checked-build.h"
 #include "mono/utils/mono-digest.h"
+#include "mono/io-layer/io-layer.h"
 
 static GENERATE_GET_CLASS_WITH_CACHE (marshal_as_attribute, System.Runtime.InteropServices, MarshalAsAttribute);
 static GENERATE_GET_CLASS_WITH_CACHE (module_builder, System.Reflection.Emit, ModuleBuilder);
index 945dc80843d715a8eb14010000359b5b65984c28..aa8289cd51da288d5aae492e11daab745f5bcef8 100644 (file)
@@ -44,6 +44,7 @@
 #include <mono/utils/mono-threads.h>
 #include <mono/utils/mono-time.h>
 #include <mono/utils/mono-rand.h>
+#include <mono/io-layer/io-layer.h>
 
 #define CPU_USAGE_LOW 80
 #define CPU_USAGE_HIGH 95
index 3f2bd1d7befad7d5e9cdd868cec1dfa68c0b235e..dfe2b7ee64035ab11e875ad1c9d70fa5c53aa13e 100644 (file)
@@ -15,7 +15,6 @@
 
 #include <glib.h>
 
-#include <mono/io-layer/io-layer.h>
 #include <mono/metadata/object.h>
 #include "mono/utils/mono-compiler.h"
 #include "mono/utils/mono-membar.h"
@@ -69,7 +68,7 @@ MonoInternalThread* mono_thread_create_internal (MonoDomain *domain, gpointer fu
 void mono_threads_install_cleanup (MonoThreadCleanupFunc func);
 
 void ves_icall_System_Threading_Thread_ConstructInternalThread (MonoThread *this_obj);
-HANDLE ves_icall_System_Threading_Thread_Thread_internal(MonoThread *this_obj, MonoObject *start);
+gpointer ves_icall_System_Threading_Thread_Thread_internal(MonoThread *this_obj, MonoObject *start);
 void ves_icall_System_Threading_InternalThread_Thread_free_internal(MonoInternalThread *this_obj);
 void ves_icall_System_Threading_Thread_Sleep_internal(gint32 ms);
 gboolean ves_icall_System_Threading_Thread_Join_internal(MonoThread *this_obj, int ms);
@@ -87,8 +86,8 @@ MonoThread *ves_icall_System_Threading_Thread_GetCurrentThread (void);
 
 gint32 ves_icall_System_Threading_WaitHandle_WaitAll_internal(MonoArray *mono_handles, gint32 ms);
 gint32 ves_icall_System_Threading_WaitHandle_WaitAny_internal(MonoArray *mono_handles, gint32 ms);
-gint32 ves_icall_System_Threading_WaitHandle_WaitOne_internal(HANDLE handle, gint32 ms);
-gint32 ves_icall_System_Threading_WaitHandle_SignalAndWait_Internal (HANDLE toSignal, HANDLE toWait, gint32 ms);
+gint32 ves_icall_System_Threading_WaitHandle_WaitOne_internal(gpointer handle, gint32 ms);
+gint32 ves_icall_System_Threading_WaitHandle_SignalAndWait_Internal (gpointer toSignal, gpointer toWait, gint32 ms);
 
 MonoArray* ves_icall_System_Threading_Thread_ByteArrayToRootDomain (MonoArray *arr);
 MonoArray* ves_icall_System_Threading_Thread_ByteArrayToCurrentDomain (MonoArray *arr);
index 1212f1cdd0ff62bd05c857075482f3aad97e20d9..d4fae9dd09e1543bca9224dce1aa1ab07e27cf39 100644 (file)
@@ -844,7 +844,7 @@ mono_w32handle_ops_specialwait (gpointer handle, guint32 timeout, gboolean *aler
        MonoW32HandleType type;
 
        if (!mono_w32handle_lookup_data (handle, &handle_data)) {
-               return(WAIT_FAILED);
+               return MONO_W32HANDLE_WAIT_RET_FAILED;
        }
 
        type = handle_data->type;
@@ -853,7 +853,7 @@ mono_w32handle_ops_specialwait (gpointer handle, guint32 timeout, gboolean *aler
            handle_ops[type]->special_wait != NULL) {
                return(handle_ops[type]->special_wait (handle, timeout, alerted));
        } else {
-               return(WAIT_FAILED);
+               return MONO_W32HANDLE_WAIT_RET_FAILED;
        }
 }
 
index d98b8bf46b8cc6b8917a98c9abcbbaece7829dc1..e4a8a755ff239519c28b9021447d8df43087ad47 100644 (file)
@@ -10,6 +10,7 @@
 #include "class-internals.h"
 #include "image.h"
 #include "utils/mono-proclib.h"
+#include "io-layer/io-layer.h"
 
 #define LOGDEBUG(...)
 /* define LOGDEBUG(...) g_message(__VA_ARGS__)  */
index 91b9b1c52b7c6f040b1b89648e61b78ca91095ae..ae787feabca52c5739401128b2049165d032d935 100644 (file)
@@ -55,6 +55,7 @@
 #include <mono/utils/mono-rand.h>
 #include <mono/utils/json.h>
 #include <mono/utils/mono-threads-coop.h>
+#include <mono/io-layer/io-layer.h>
 
 #include "aot-compiler.h"
 #include "seq-points.h"
index b9829db0e9769386ccd4fc16e227c95d27a018ea..171bae152e4967c1e58c2ed7334c94a038077057 100644 (file)
@@ -75,6 +75,7 @@
 #include "debugger-agent.h"
 #include "mini.h"
 #include "seq-points.h"
+#include <mono/io-layer/io-layer.h>
 
 /*
  * On iOS we can't use System.Environment.Exit () as it will do the wrong
index 033e4670851677870a93ce842b1a1c629a2cb79a..7cb14bc796d8956a27be673dfa3233a5a4e17843 100644 (file)
@@ -32,6 +32,8 @@
 #include <mono/utils/mono-threads-debug.h>
 #include <mono/utils/os-event.h>
 
+#include <mono/io-layer/io-layer.h>
+
 #include <errno.h>
 
 #if defined(__MACH__)
index 52ac93337b9973df31a097be8208bc828a42b1e0..002df31173b15e18307cd04aeafcb33bd1ca0ccc 100644 (file)
@@ -18,8 +18,6 @@
 #include <mono/utils/os-event.h>
 #include <mono/utils/refcount.h>
 
-#include <mono/io-layer/io-layer.h>
-
 #include <glib.h>
 #include <config.h>
 #ifdef HOST_WIN32