Author: spouliot
Date: 2005-03-29 13:34:21 -0500 (Tue, 29 Mar 2005)
New Revision: 42351

Modified:
   trunk/mono/mono/metadata/ChangeLog
   trunk/mono/mono/metadata/appdomain.c
   trunk/mono/mono/metadata/appdomain.h
   trunk/mono/mono/metadata/assembly.c
   trunk/mono/mono/metadata/domain.c
   trunk/mono/mono/metadata/icall.c
   trunk/mono/mono/metadata/mono-config.c
   trunk/mono/mono/metadata/rand.c
   trunk/mono/mono/metadata/rawbuffer.c
   trunk/mono/mono/metadata/sysmath.h
   trunk/mono/mono/metadata/threads.c
Log:
2005-03-29  Sebastien Pouliot  <[EMAIL PROTECTED]>

        * assembly.c: Set MONO_ASSEMBLIES to NULL when compiling from a VS.NET
        project/solution.
        * appdomain.h|domain.c: Removed inline from functions.
        * appdomain.c: Reduced warnings when compiling on windows.
        * icall.c: Fixed output_debug declaration to gunichar2*.
        * mono-config.c: Reduced warnings when compiling on windows.
        * rand.c: Added missing "windows.h". Added missing return value.
        * rawbuffer.c: Added missing winsock2.h for windows.
        * sysmath.h: Added mono-compiler.h header to allow/ease 
        compilation with non-GCC compilers.
        * threads.c: Fixed declarations to compile with VS.NET C compiler.
        Removed cast warnings.

        Adapted from the work of J Lothian (for VC6).



Modified: trunk/mono/mono/metadata/ChangeLog
===================================================================
--- trunk/mono/mono/metadata/ChangeLog  2005-03-29 18:25:37 UTC (rev 42350)
+++ trunk/mono/mono/metadata/ChangeLog  2005-03-29 18:34:21 UTC (rev 42351)
@@ -1,3 +1,20 @@
+2005-03-29  Sebastien Pouliot  <[EMAIL PROTECTED]>
+
+       * assembly.c: Set MONO_ASSEMBLIES to NULL when compiling from a VS.NET
+       project/solution.
+       * appdomain.h|domain.c: Removed inline from functions.
+       * appdomain.c: Reduced warnings when compiling on windows.
+       * icall.c: Fixed output_debug declaration to gunichar2*.
+       * mono-config.c: Reduced warnings when compiling on windows.
+       * rand.c: Added missing "windows.h". Added missing return value.
+       * rawbuffer.c: Added missing winsock2.h for windows.
+       * sysmath.h: Added mono-compiler.h header to allow/ease 
+       compilation with non-GCC compilers.
+       * threads.c: Fixed declarations to compile with VS.NET C compiler.
+       Removed cast warnings.
+
+       Adapted from the work of J Lothian (for VC6).
+
 2005-03-29  Zoltan Varga  <[EMAIL PROTECTED]>
 
        * assembly.c (mono_assembly_load_corlib): Do not try loading corlib

Modified: trunk/mono/mono/metadata/appdomain.c
===================================================================
--- trunk/mono/mono/metadata/appdomain.c        2005-03-29 18:25:37 UTC (rev 
42350)
+++ trunk/mono/mono/metadata/appdomain.c        2005-03-29 18:34:21 UTC (rev 
42351)
@@ -1373,7 +1373,7 @@
 #if 0
        thread_handle = CreateThread (NULL, 0, unload_thread_main, 
&thread_data, 0, &tid);
 #else
-       thread_handle = CreateThread (NULL, 0, unload_thread_main, 
&thread_data, CREATE_SUSPENDED, &tid);
+       thread_handle = CreateThread (NULL, 0, 
(LPTHREAD_START_ROUTINE)unload_thread_main, &thread_data, CREATE_SUSPENDED, 
&tid);
        ResumeThread (thread_handle);
 #endif
 

Modified: trunk/mono/mono/metadata/appdomain.h
===================================================================
--- trunk/mono/mono/metadata/appdomain.h        2005-03-29 18:25:37 UTC (rev 
42350)
+++ trunk/mono/mono/metadata/appdomain.h        2005-03-29 18:34:21 UTC (rev 
42351)
@@ -59,19 +59,19 @@
 MonoDomain *
 mono_domain_create         (void);
 
-inline MonoDomain *
+MonoDomain *
 mono_domain_get            (void);
 
-inline MonoDomain *
+MonoDomain *
 mono_domain_get_by_id      (gint32 domainid);
 
 gint32
 mono_domain_get_id         (MonoDomain *domain);
 
-inline gboolean
+gboolean
 mono_domain_set            (MonoDomain *domain, gboolean force);
 
-inline void
+void
 mono_domain_set_internal   (MonoDomain *domain);
 
 gboolean
@@ -101,10 +101,10 @@
 void
 mono_context_init                                 (MonoDomain *domain);
 
-inline void 
+void 
 mono_context_set                                  (MonoAppContext 
*new_context);
 
-inline MonoAppContext * 
+MonoAppContext * 
 mono_context_get                                  (void);
 
 MonoJitInfo *

Modified: trunk/mono/mono/metadata/assembly.c
===================================================================
--- trunk/mono/mono/metadata/assembly.c 2005-03-29 18:25:37 UTC (rev 42350)
+++ trunk/mono/mono/metadata/assembly.c 2005-03-29 18:34:21 UTC (rev 42351)
@@ -28,7 +28,11 @@
 #include <mono/utils/mono-logger.h>
 #ifdef PLATFORM_WIN32
 #include <mono/os/util.h>
+#ifdef _MSC_VER
+       /* not used on Windows - see mono_set_rootdir () */
+       #define MONO_ASSEMBLIES         NULL
 #endif
+#endif
 
 /* AssemblyVersionMap: an assembly name and the assembly version set on which 
it is based */
 typedef struct  {

Modified: trunk/mono/mono/metadata/domain.c
===================================================================
--- trunk/mono/mono/metadata/domain.c   2005-03-29 18:25:37 UTC (rev 42350)
+++ trunk/mono/mono/metadata/domain.c   2005-03-29 18:34:21 UTC (rev 42351)
@@ -682,7 +682,7 @@
  *
  * Returns: the current domain.
  */
-inline MonoDomain *
+MonoDomain *
 mono_domain_get ()
 {
        return GET_APPDOMAIN ();
@@ -694,7 +694,7 @@
  *
  * Sets the current domain to @domain.
  */
-inline void
+void
 mono_domain_set_internal (MonoDomain *domain)
 {
        SET_APPDOMAIN (domain);

Modified: trunk/mono/mono/metadata/icall.c
===================================================================
--- trunk/mono/mono/metadata/icall.c    2005-03-29 18:25:37 UTC (rev 42350)
+++ trunk/mono/mono/metadata/icall.c    2005-03-29 18:34:21 UTC (rev 42351)
@@ -5488,7 +5488,7 @@
 ves_icall_System_Diagnostics_DefaultTraceListener_WriteWindowsDebugString 
(MonoString *message)
 {
 #if defined (PLATFORM_WIN32)
-       static void (*output_debug) (gchar *);
+       static void (*output_debug) (gunichar2 *);
        static gboolean tried_loading = FALSE;
 
        MONO_ARCH_SAVE_REGS;

Modified: trunk/mono/mono/metadata/mono-config.c
===================================================================
--- trunk/mono/mono/metadata/mono-config.c      2005-03-29 18:25:37 UTC (rev 
42350)
+++ trunk/mono/mono/metadata/mono-config.c      2005-03-29 18:34:21 UTC (rev 
42351)
@@ -10,6 +10,8 @@
 #include "config.h"
 #include <glib.h>
 #include <string.h>
+
+#include "mono/metadata/assembly.h"
 #include "mono/metadata/loader.h"
 #include "mono/metadata/mono-config.h"
 #include "mono/metadata/metadata-internals.h"
@@ -344,9 +346,11 @@
 void
 mono_config_parse (const char *filename) {
        const char *home;
+       char *mono_cfg;
+#ifndef PLATFORM_WIN32
        char *user_cfg;
-       char *mono_cfg;
-       
+#endif
+
        if (filename) {
                mono_config_parse_file (filename);
                return;

Modified: trunk/mono/mono/metadata/rand.c
===================================================================
--- trunk/mono/mono/metadata/rand.c     2005-03-29 18:25:37 UTC (rev 42350)
+++ trunk/mono/mono/metadata/rand.c     2005-03-29 18:34:21 UTC (rev 42351)
@@ -94,6 +94,7 @@
 
 #if defined (PLATFORM_WIN32)
 
+#include <windows.h>
 #include <WinCrypt.h>
 
 #ifndef PROV_INTEL_SEC
@@ -158,13 +159,14 @@
        if (!CryptGenRandom (provider, len, buf)) {
                CryptReleaseContext (provider, 0);
                /* we may have lost our context with CryptoAPI, but all hope 
isn't lost yet! */
-               provider = 
ves_icall_System_Security_Cryptography_RNGCryptoServiceProvider_RngInitialize 
(NULL);
+               provider = (HCRYPTPROV) 
ves_icall_System_Security_Cryptography_RNGCryptoServiceProvider_RngInitialize 
(NULL);
                if (!CryptGenRandom (provider, len, buf)) {
                        CryptReleaseContext (provider, 0);
                        provider = 0;
                        /* exception will be thrown in managed code */
                }
-       } 
+       }
+       return (gpointer) provider;
 }
 
 void

Modified: trunk/mono/mono/metadata/rawbuffer.c
===================================================================
--- trunk/mono/mono/metadata/rawbuffer.c        2005-03-29 18:25:37 UTC (rev 
42350)
+++ trunk/mono/mono/metadata/rawbuffer.c        2005-03-29 18:34:21 UTC (rev 
42351)
@@ -14,6 +14,7 @@
 #include <unistd.h>
 #include <errno.h>
 #ifdef USE_WIN32_API
+#include <winsock2.h>
 #include <windows.h>
 #include <io.h>
 #else

Modified: trunk/mono/mono/metadata/sysmath.h
===================================================================
--- trunk/mono/mono/metadata/sysmath.h  2005-03-29 18:25:37 UTC (rev 42350)
+++ trunk/mono/mono/metadata/sysmath.h  2005-03-29 18:34:21 UTC (rev 42351)
@@ -12,6 +12,7 @@
 
 #include <config.h>
 #include <glib.h>
+#include "mono/utils/mono-compiler.h"
 
 extern gdouble ves_icall_System_Math_Floor (gdouble x);
 extern gdouble ves_icall_System_Math_Round (gdouble x);

Modified: trunk/mono/mono/metadata/threads.c
===================================================================
--- trunk/mono/mono/metadata/threads.c  2005-03-29 18:25:37 UTC (rev 42350)
+++ trunk/mono/mono/metadata/threads.c  2005-03-29 18:34:21 UTC (rev 42351)
@@ -222,7 +222,7 @@
                mono_thread_cleanup (thread);
 }
 
-static guint32 start_wrapper(void *data)
+static guint32 WINAPI start_wrapper(void *data)
 {
        struct StartInfo *start_info=(struct StartInfo *)data;
        guint32 (*start_func)(void *);
@@ -359,7 +359,7 @@
        /* Create suspended, so we can do some housekeeping before the thread
         * starts
         */
-       thread_handle = CreateThread(NULL, default_stacksize_for_thread 
(thread), start_wrapper, start_info,
+       thread_handle = CreateThread(NULL, default_stacksize_for_thread 
(thread), (LPTHREAD_START_ROUTINE)start_wrapper, start_info,
                                     CREATE_SUSPENDED, &tid);
        THREAD_DEBUG (g_message (G_GNUC_PRETTY_FUNCTION ": Started thread ID %d 
(handle %p)",
                  tid, thread_handle));
@@ -510,7 +510,7 @@
                        return(NULL);
                }
 
-               thread=CreateThread(NULL, default_stacksize_for_thread (this), 
start_wrapper, start_info,
+               thread=CreateThread(NULL, default_stacksize_for_thread (this), 
(LPTHREAD_START_ROUTINE)start_wrapper, start_info,
                                    CREATE_SUSPENDED, &tid);
                if(thread==NULL) {
                        g_warning(G_GNUC_PRETTY_FUNCTION
@@ -1293,7 +1293,7 @@
 int  
 mono_thread_get_abort_signal (void)
 {
-#ifdef __MINGW32__
+#if defined (__MINGW32__) || defined (_MSC_VER)
        return -1;
 #else
 #ifndef        SIGRTMIN
@@ -1301,17 +1301,16 @@
 #else
        return SIGRTMIN;
 #endif
-#endif /* __MINGW32__ */
+#endif /*defined (__MINGW32__) || defined (_MSC_VER) */
 }
 
-#ifdef __MINGW32__
-static CALLBACK void interruption_request_apc (ULONG_PTR param)
+#if defined (__MINGW32__) || defined (_MSC_VER)
+static void CALLBACK interruption_request_apc (ULONG_PTR param)
 {
        MonoException* exc = mono_thread_request_interruption (FALSE);
        if (exc) mono_raise_exception (exc);
-       return 0;
 }
-#endif /* __MINGW32__ */
+#endif /* defined (__MINGW32__) || defined (_MSC_VER) */
 
 /*
  * signal_thread_state_change
@@ -1328,8 +1327,8 @@
                        mono_raise_exception (exc);
        }
 
-#ifdef __MINGW32__
-       QueueUserAPC (interruption_request_apc, thread->handle, NULL);
+#if defined (__MINGW32__) || defined (_MSC_VER)
+       QueueUserAPC ((PAPCFUNC)interruption_request_apc, thread->handle, NULL);
 #else
        /* fixme: store the state somewhere */
 #ifdef PTHREAD_POINTER_ID
@@ -1337,7 +1336,7 @@
 #else
        pthread_kill (thread->tid, mono_thread_get_abort_signal ());
 #endif
-#endif /* __MINGW32__ */
+#endif /* defined (__MINGW32__) || defined (__MSC_VER) */
 }
 
 void
@@ -2331,7 +2330,7 @@
                
                /* this will awake the thread if it is in WaitForSingleObject 
               or similar */
-               QueueUserAPC (dummy_apc, thread->handle, NULL);
+               QueueUserAPC ((PAPCFUNC)dummy_apc, thread->handle, NULL);
                
                return NULL;
        }

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to