Merge pull request #2255 from directhex/override-mono-wrapper
authorAlexander Köplinger <alex.koeplinger@outlook.com>
Sun, 22 Nov 2015 14:01:04 +0000 (15:01 +0100)
committerAlexander Köplinger <alex.koeplinger@outlook.com>
Sun, 22 Nov 2015 14:01:04 +0000 (15:01 +0100)
Allow mono-wrapper executable to be overridden by environment

64 files changed:
external/referencesource
mcs/class/System.Data/MobileStubs.cs [new file with mode: 0644]
mcs/class/System.Data/mobile_referencesource.sources
mcs/class/System.Drawing/System.Drawing/Color.cs
mcs/class/System.Drawing/System.Drawing/KnownColors.cs
mcs/class/System.Drawing/System.Drawing/Point.cs
mcs/class/System.Drawing/System.Drawing/Rectangle.cs
mcs/class/System.Drawing/System.Drawing/Size.cs
mcs/class/System.Drawing/System.Drawing/SizeF.cs
mcs/class/System.ServiceModel.Internals/MobileStubs.cs [new file with mode: 0644]
mcs/class/System.ServiceModel.Internals/mobile_System.ServiceModel.Internals.dll.sources [new file with mode: 0644]
mcs/class/System.ServiceModel.Internals/monotouch_System.ServiceModel.Internals.dll.sources [new file with mode: 0644]
mcs/class/System.ServiceModel.Internals/monotouch_tv_System.ServiceModel.Internals.dll.sources [new file with mode: 0644]
mcs/class/System.ServiceModel.Internals/xammac_System.ServiceModel.Internals.dll.sources [new file with mode: 0644]
mcs/class/System/System.Net.NetworkInformation/GatewayIPAddressInformationCollection.cs
mcs/class/System/System.Net.NetworkInformation/IPAddressCollection.cs
mcs/class/System/System.Net.NetworkInformation/IPAddressInformationCollection.cs
mcs/class/System/System.Net.NetworkInformation/IPGlobalProperties.cs
mcs/class/System/System.Net.NetworkInformation/IPGlobalStatistics.cs
mcs/class/System/System.Net.NetworkInformation/IPInterfaceProperties.cs
mcs/class/System/System.Net.NetworkInformation/IPv4InterfaceProperties.cs
mcs/class/System/System.Net.NetworkInformation/IPv4InterfaceStatistics.cs
mcs/class/System/System.Net.NetworkInformation/IPv6InterfaceProperties.cs
mcs/class/System/System.Net.NetworkInformation/IcmpV4Statistics.cs
mcs/class/System/System.Net.NetworkInformation/IcmpV6Statistics.cs
mcs/class/System/System.Net.NetworkInformation/MulticastIPAddressInformationCollection.cs
mcs/class/System/System.Net.NetworkInformation/NetworkInterface.cs
mcs/class/System/System.Net.NetworkInformation/TcpStatistics.cs
mcs/class/System/System.Net.NetworkInformation/UdpStatistics.cs
mcs/class/System/System.Net.NetworkInformation/UnicastIPAddressInformation.cs
mcs/class/System/System.Net.NetworkInformation/UnicastIPAddressInformationCollection.cs
mcs/class/System/System/Uri.cs
mcs/class/System/mobile_System.dll.sources
mcs/class/corlib/Test/System/DateTimeTest.cs
mcs/tools/mdoc/Mono.Documentation/mdoc.cs
mcs/tools/mdoc/Mono.Documentation/monodocer.cs
mcs/tools/mkbundle/mkbundle.cs
mono/metadata/debug-mono-ppdb.c
mono/metadata/image.c
mono/metadata/mono-hash.h
mono/mini/Makefile.am.in
mono/mini/aot-compiler.c
mono/mini/aot-runtime.c
mono/mini/aot-tests.cs
mono/mini/arrays.cs
mono/mini/basic-calls.cs
mono/mini/basic-float.cs
mono/mini/basic-long.cs
mono/mini/basic-math.cs
mono/mini/basic.cs
mono/mini/devirtualization.cs
mono/mini/exceptions.cs
mono/mini/gc-test.cs
mono/mini/generics.cs
mono/mini/gshared.cs
mono/mini/method-to-ir.c
mono/mini/mini-exceptions.c
mono/mini/mini-llvm-loaded.c
mono/mini/mini-llvm.c
mono/mini/mini-llvm.h [new file with mode: 0644]
mono/mini/mini-runtime.c
mono/mini/mini.c
mono/mini/mini.h
mono/mini/objects.cs

index fcfda01aa7f7d2faf975b86ee1ffd54adb52c2b3..8259de00d0ea77ecdcbf4bf62a3446f86cf4a1ac 160000 (submodule)
@@ -1 +1 @@
-Subproject commit fcfda01aa7f7d2faf975b86ee1ffd54adb52c2b3
+Subproject commit 8259de00d0ea77ecdcbf4bf62a3446f86cf4a1ac
diff --git a/mcs/class/System.Data/MobileStubs.cs b/mcs/class/System.Data/MobileStubs.cs
new file mode 100644 (file)
index 0000000..10a235e
--- /dev/null
@@ -0,0 +1,94 @@
+// help building System.Data without win32-specific p/invokes
+
+using System;
+using System.Diagnostics;
+
+internal static partial class Bid {
+    internal enum ApiGroup : uint {
+               Pooling     = 0x00001000,
+               Correlation = 0x00040000,
+       }
+       
+    internal static bool AdvancedOn {
+        get { return false; }
+    }
+
+    internal static bool IsOn (ApiGroup flag)
+       {
+        return false;
+    }
+
+       [Conditional ("BID")]
+       internal static void Trace (params object[] a)
+       {
+       }
+
+       [Conditional ("BID")]
+       internal static void PoolerTrace (params object[] a)
+       {
+       }
+
+       // out method can't be conditional
+       internal static void ScopeEnter (out IntPtr p, params object[] a)
+       {
+               p = IntPtr.Zero;
+       }
+       
+       [Conditional ("BID")]
+       internal static void ScopeLeave (ref IntPtr a)
+       {
+       }
+       
+       // out method can't be conditional
+       internal static void PoolerScopeEnter (out IntPtr p, string a, System.Int32 b)
+       {
+               p = IntPtr.Zero;
+       }
+}
+
+[ConditionalAttribute ("CODE_ANALYSIS")]
+[AttributeUsage (AttributeTargets.Method)]
+internal sealed class BidMethodAttribute : Attribute {
+}
+
+[ConditionalAttribute ("CODE_ANALYSIS")]
+[AttributeUsage (AttributeTargets.Parameter | AttributeTargets.Method, AllowMultiple=true)]
+internal sealed class BidArgumentTypeAttribute : Attribute {
+       internal BidArgumentTypeAttribute (Type bidArgumentType)
+       {
+       }
+}
+
+namespace System.Data.Common {
+
+       internal static class UnsafeNativeMethods {
+               
+               // note: likely unreachable code - as this never worked on mono
+               internal static int lstrlenW (IntPtr p)
+               {
+                       throw new NotImplementedException ();
+               }
+               
+               static internal int CreateWellKnownSid (int sidType, byte[] domainSid, byte[] resultSid, ref uint resultSidLength )
+               {
+                       return -1;
+               }
+               
+               static internal bool CheckTokenMembership (IntPtr tokenHandle, byte[] sidToCheck, out bool isMember)
+               {
+                       isMember = false;
+                       return false;
+               }
+               
+               static internal bool GetTokenInformation (IntPtr tokenHandle, uint token_class, IntPtr tokenStruct, uint tokenInformationLength, ref uint tokenString)
+               {
+                       return false;
+               }
+               
+               static internal bool ConvertSidToStringSidW (IntPtr sid, out IntPtr stringSid)
+               {
+                       stringSid = IntPtr.Zero;
+                       return false;
+               }
+       }
+}
index b4d03c4acffdc346505876175bd609ec47bf44d2..7dcb976cd391fd405eac966586b8c188adbd63fc 100644 (file)
@@ -1,4 +1,4 @@
-../../../external/referencesource/System.Data/bid/inc/cs/bidPrivateBase.cs
+MobileStubs.cs
 
 ../../../external/referencesource/System.Data/Microsoft/SqlServer/Server/SqlTriggerContext.cs
 
 ../../../external/referencesource/System.Data/System/Data/Common/SQLTypes/SqlXmlStorage.cs
 ../../../external/referencesource/System.Data/System/Data/Common/StringStorage.cs
 ../../../external/referencesource/System.Data/System/Data/Common/SupportedJoinOperators.cs
-../../../external/referencesource/System.Data/System/Data/Common/System.Data_BID.cs
 ../../../external/referencesource/System.Data/System/Data/Common/TimeSpanStorage.cs
 ../../../external/referencesource/System.Data/System/Data/Common/UInt16Storage.cs
 ../../../external/referencesource/System.Data/System/Data/Common/UInt32Storage.cs
 ../../../external/referencesource/System.Data/System/Data/Common/UInt64Storage.cs
-../../../external/referencesource/System.Data/System/Data/Common/UnsafeNativeMethods.cs
 ../../../external/referencesource/System.Data/System/Data/ConflictOptions.cs
 ../../../external/referencesource/System.Data/System/Data/ConnectionState.cs
 ../../../external/referencesource/System.Data/System/Data/ConstraintCollection.cs
index df8cc18a6f8f3780f7ae21a84189d28af0bee6b5..6e72b0ecb69a28d608f239c4db1f2975cb8405be 100644 (file)
@@ -38,8 +38,10 @@ using System.Runtime.InteropServices;
 
 namespace System.Drawing 
 {
+#if !MONOTOUCH && !MONOMAC
        [TypeConverter(typeof(ColorConverter))]
        [Editor ("System.Drawing.Design.ColorEditor, " + Consts.AssemblySystem_Drawing_Design, typeof (System.Drawing.Design.UITypeEditor))]
+#endif
        [Serializable]
        public struct Color {
 
index 46fda2a42439b0115c4ba7c158cd637dd27953ff..0440d8e30599a99504dc91416f1abaa2a5613aba 100644 (file)
@@ -210,6 +210,7 @@ namespace System.Drawing {
                        0xFF316AC5,     /* 174 - MenuHighlight */
                };
 
+#if !MONOTOUCH && !MONOMAC
                static KnownColors ()
                {
                        if (GDIPlus.RunningOnWindows ()) {
@@ -264,6 +265,7 @@ namespace System.Drawing {
                        ArgbValues [(int)KnownColor.MenuBar] = GetSysColor (GetSysColorIndex.COLOR_MENUBAR);
                        ArgbValues [(int)KnownColor.MenuHighlight] = GetSysColor (GetSysColorIndex.COLOR_MENUHIGHLIGHT);
                }
+#endif
 
                public static Color FromKnownColor (KnownColor kc)
                {
index 4737c4f1d455d97c26b28ffa11dc82468b0de1c4..88a8390b564906d2f34fc3785f8393481fd9dbc0 100644 (file)
@@ -40,7 +40,9 @@ namespace System.Drawing
 {
        [Serializable]  
        [ComVisible (true)]
+#if !MONOTOUCH && !MONOMAC
        [TypeConverter (typeof (PointConverter))]
+#endif
        public struct Point
        {
                // Private x and y coordinate fields.
index c8b3f6c7282d51da8ae314bcbc7a2230b7002888..c2ffbc80e5e647b589ed5aec55c96c1fb0703439 100644 (file)
@@ -39,7 +39,9 @@ namespace System.Drawing
 {
        [Serializable]
        [ComVisible (true)]
+#if !MONOTOUCH && !MONOMAC
        [TypeConverter (typeof (RectangleConverter))]
+#endif
        public struct Rectangle
        {
                private int x, y, width, height;
index 6e78072aa7dbb0ed396a83d4b19c0c9cc2dd0802..be8fda0ea8ef0b73bf815febb8e8d4e025eab3aa 100644 (file)
@@ -40,7 +40,9 @@ namespace System.Drawing
 {
        [Serializable]
        [ComVisible (true)]
+#if !MONOTOUCH && !MONOMAC
        [TypeConverter (typeof (SizeConverter))]
+#endif
        public struct Size
        { 
                
index 4c1c87f29aad44e4bed1beefb00a3ae833418196..38714d1c9968f30ae18e363a4c811a82dc38de99 100644 (file)
@@ -40,7 +40,9 @@ namespace System.Drawing
 {
        [Serializable]
        [ComVisible (true)]
+#if !MONOTOUCH && !MONOMAC
        [TypeConverter (typeof (SizeFConverter))]
+#endif
        public struct SizeF
        {
                // Private height and width fields.
diff --git a/mcs/class/System.ServiceModel.Internals/MobileStubs.cs b/mcs/class/System.ServiceModel.Internals/MobileStubs.cs
new file mode 100644 (file)
index 0000000..f82ff50
--- /dev/null
@@ -0,0 +1,146 @@
+// help compiles sources for mobile without having unusable
+// Windows p/invoke in the assemblies
+//
+// Copyright 2015 Xamarin Inc.
+
+#if MOBILE
+
+namespace System.Runtime.Interop {
+
+       using Microsoft.Win32.SafeHandles;
+       using System.Runtime.Diagnostics;
+       using System.Runtime.InteropServices;
+       using FILETIME = System.Runtime.InteropServices.ComTypes.FILETIME;
+
+       sealed class SafeEventLogWriteHandle : SafeHandleZeroOrMinusOneIsInvalid {
+
+               SafeEventLogWriteHandle () : base (true)
+               {
+               }
+
+               public static SafeEventLogWriteHandle RegisterEventSource (string uncServerName, string sourceName)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               static bool DeregisterEventSource (IntPtr hEventLog)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               protected override bool ReleaseHandle ()
+               {
+                       throw new NotImplementedException ();
+               }
+       }
+
+       static class UnsafeNativeMethods {
+
+               public const int ERROR_MORE_DATA = 234;
+               public const int ERROR_ARITHMETIC_OVERFLOW = 534;
+               public const int ERROR_NOT_ENOUGH_MEMORY = 8;
+
+               [StructLayout (LayoutKind.Explicit, Size = 16)]
+               public struct EventData {
+                       [FieldOffset(0)]
+                       internal UInt64 DataPointer;
+                       [FieldOffset(8)]
+                       internal uint Size;
+                       [FieldOffset(12)]
+                       internal int Reserved;
+               }
+
+               public static SafeWaitHandle CreateWaitableTimer (IntPtr mustBeZero, bool manualReset, string timerName)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public static bool SetWaitableTimer (SafeWaitHandle handle, ref long dueTime, int period, IntPtr mustBeZero, IntPtr mustBeZeroAlso, bool resume)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public static int QueryPerformanceCounter (out long time)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public static uint GetSystemTimeAdjustment (out int adjustment, out uint increment, out uint adjustmentDisabled)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public static void GetSystemTimeAsFileTime (out long time)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               internal static string GetComputerName (ComputerNameFormat nameType)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               internal static bool IsDebuggerPresent ()
+               {
+                       throw new NotImplementedException ();
+               }
+
+               internal static void DebugBreak ()
+               {
+                       throw new NotImplementedException ();
+               }
+
+               internal static void OutputDebugString (string lpOutputString)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               internal unsafe delegate void EtwEnableCallback (ref Guid sourceId, int isEnabled, byte level, long matchAnyKeywords, long matchAllKeywords, void* filterData, void* callbackContext);
+
+               internal static unsafe uint EventRegister (ref Guid providerId, EtwEnableCallback enableCallback, void* callbackContext, ref long registrationHandle)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               internal static uint EventUnregister (long registrationHandle)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               internal static bool EventEnabled (long registrationHandle, ref EventDescriptor eventDescriptor)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               internal static unsafe uint EventWrite (long registrationHandle, ref EventDescriptor eventDescriptor, uint userDataCount, EventData* userData)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               internal static unsafe uint EventWriteTransfer (long registrationHandle, ref EventDescriptor eventDescriptor, ref Guid activityId, ref Guid relatedActivityId, uint userDataCount, EventData* userData)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               internal static unsafe uint EventWriteString (long registrationHandle, byte level, long keywords, char* message)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               internal static unsafe uint EventActivityIdControl (int ControlCode, ref Guid ActivityId)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               internal static bool ReportEvent (SafeHandle hEventLog, ushort type, ushort category, uint eventID, byte[] userSID, ushort numStrings, uint dataLen, HandleRef strings, byte[] rawData)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               internal static SafeEventLogWriteHandle RegisterEventSource (string uncServerName, string sourceName)
+               {
+                       throw new NotImplementedException ();
+               }
+       }
+}
+#endif
diff --git a/mcs/class/System.ServiceModel.Internals/mobile_System.ServiceModel.Internals.dll.sources b/mcs/class/System.ServiceModel.Internals/mobile_System.ServiceModel.Internals.dll.sources
new file mode 100644 (file)
index 0000000..a2290a9
--- /dev/null
@@ -0,0 +1,78 @@
+../../build/common/Consts.cs
+../../build/common/SR.cs
+EventLogEntryType.cs
+InternalSR.cs
+MobileStubs.cs
+Assembly/AssemblyInfo.cs
+../../../external/referencesource/System.ServiceModel.Internals/AssemblyInfo.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/ActionItem.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/AssertHelper.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/AsyncCompletionResult.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/AsyncEventArgsCallback.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/AsyncEventArgs.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/AsyncResult.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/AsyncWaitHandle.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/BackoffTimeoutHelper.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/BufferedOutputStream.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/CallbackException.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/Collections/HopperCache.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/Collections/NullableKeyDictionary.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/Collections/ObjectCache.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/Collections/ObjectCacheItem.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/Collections/ObjectCacheSettings.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/Collections/OrderedDictionary.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/Collections/ValidatingCollection.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/CompletedAsyncResult.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/ComputerNameFormat.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/Diagnostics/ActivityControl.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/Diagnostics/DiagnosticEventProvider.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/Diagnostics/DiagnosticTraceBase.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/Diagnostics/DiagnosticTraceSource.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/Diagnostics/DictionaryTraceRecord.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/Diagnostics/EtwDiagnosticTrace.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/Diagnostics/EtwProvider.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/Diagnostics/EventDescriptor.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/Diagnostics/EventLogCategory.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/Diagnostics/EventLogEventId.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/Diagnostics/EventLogger.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/Diagnostics/EventTraceActivity.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/Diagnostics/ITraceSourceStringProvider.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/Diagnostics/PerformanceCounterNameAttribute.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/Diagnostics/StringTraceRecord.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/Diagnostics/TraceRecord.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/DiagnosticStrings.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/DuplicateDetector.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/ExceptionTrace.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/FastAsyncCallback.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/FatalException.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/FxCop.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/Fx.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/HashHelper.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/IAsyncEventArgs.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/InputQueue.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/InternalBufferManager.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/IOThreadCancellationTokenSource.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/IOThreadScheduler.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/IOThreadTimer.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/MruCache.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/NameGenerator.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/PartialTrustHelpers.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/ReadOnlyDictionaryInternal.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/ReadOnlyKeyedCollection.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/ScheduleActionItemAsyncResult.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/SignalGate.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/SynchronizedPool.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/TaskExtensions.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/ThreadNeutralSemaphore.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/Ticks.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/TimeoutHelper.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/TraceChannel.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/TraceEventLevel.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/TraceEventOpcode.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/TraceLevelHelper.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/TracePayload.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/TypedAsyncResult.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/TypeHelper.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/UrlUtility.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/WaitCallbackActionItem.cs
+../../../external/referencesource/System.ServiceModel.Internals/TraceCore.Designer.cs
diff --git a/mcs/class/System.ServiceModel.Internals/monotouch_System.ServiceModel.Internals.dll.sources b/mcs/class/System.ServiceModel.Internals/monotouch_System.ServiceModel.Internals.dll.sources
new file mode 100644 (file)
index 0000000..903b4f6
--- /dev/null
@@ -0,0 +1 @@
+#include mobile_System.ServiceModel.Internals.dll.sources
\ No newline at end of file
diff --git a/mcs/class/System.ServiceModel.Internals/monotouch_tv_System.ServiceModel.Internals.dll.sources b/mcs/class/System.ServiceModel.Internals/monotouch_tv_System.ServiceModel.Internals.dll.sources
new file mode 100644 (file)
index 0000000..12c950c
--- /dev/null
@@ -0,0 +1 @@
+#include monotouch_System.ServiceModel.Internals.dll.sources
\ No newline at end of file
diff --git a/mcs/class/System.ServiceModel.Internals/xammac_System.ServiceModel.Internals.dll.sources b/mcs/class/System.ServiceModel.Internals/xammac_System.ServiceModel.Internals.dll.sources
new file mode 100644 (file)
index 0000000..12c950c
--- /dev/null
@@ -0,0 +1 @@
+#include monotouch_System.ServiceModel.Internals.dll.sources
\ No newline at end of file
index 07c8f478dee5dc33884824f8ff3db64433e6ddef..14767dd782b42e4a10bc6315ded535f930af7bcc 100644 (file)
@@ -92,6 +92,7 @@ namespace System.Net.NetworkInformation {
                }
        }
 
+#if !MOBILE
        class Win32GatewayIPAddressInformationCollection : GatewayIPAddressInformationCollection
        {
                public static readonly Win32GatewayIPAddressInformationCollection Empty = new Win32GatewayIPAddressInformationCollection (true);
@@ -127,6 +128,7 @@ namespace System.Net.NetworkInformation {
                        get { return is_readonly; }
                }
        }
+#endif
 
        class UnixGatewayIPAddressInformationCollection : GatewayIPAddressInformationCollection
        {
index 69b05505403740965fca5ba724cf79e59ac5bc3e..3900ac1f192f00d9d8d6f91690e8f010644ce870 100644 (file)
@@ -100,6 +100,7 @@ namespace System.Net.NetworkInformation {
                }
        }
 
+#if !MOBILE
        class Win32IPAddressCollection : IPAddressCollection
        {
                public static readonly Win32IPAddressCollection Empty = new Win32IPAddressCollection (IntPtr.Zero);
@@ -168,6 +169,7 @@ namespace System.Net.NetworkInformation {
                        get { return is_readonly; }
                }
        }
+#endif
 }
 
 
index 40f5f70fef837f68932c36f08fcf3f9e7f8b4f17..1492fe0f925cbc906979606054c419eeed634631 100644 (file)
@@ -109,6 +109,7 @@ namespace System.Net.NetworkInformation {
                        get { return is_readonly; }
                }
 
+#if !MOBILE
                public static IPAddressInformationCollection Win32FromAnycast (IntPtr ptr)
                {
                        IPAddressInformationImplCollection c = new IPAddressInformationImplCollection (false);
@@ -123,6 +124,7 @@ namespace System.Net.NetworkInformation {
                        c.is_readonly = true;
                        return c;
                }
+#endif
 
                public static IPAddressInformationImplCollection LinuxFromAnycast (IList<IPAddress> addresses)
                {
index b7b7ebb2468e0c1c2f4095ed85f23459984243cb..9ff24cf7f1058105751e3ec6ea05c14b83725c36 100644 (file)
@@ -46,6 +46,8 @@ namespace System.Net.NetworkInformation {
                {
 #if MONODROID
                        return new AndroidIPGlobalProperties ();
+#elif MONOTOUCH || XAMMAC
+                       return new UnixIPGlobalProperties ();
 #else
                        switch (Environment.OSVersion.Platform) {
                        case PlatformID.Unix:
@@ -190,6 +192,7 @@ namespace System.Net.NetworkInformation {
                }
        }
 
+#if MONODROID
        sealed class AndroidIPGlobalProperties : UnixIPGlobalProperties
        {
                public override string DomainName {
@@ -198,6 +201,7 @@ namespace System.Net.NetworkInformation {
                        }
                }
        }
+#endif
 
        // It expects /proc/net/snmp (or /usr/compat/linux/proc/net/snmp),
        // formatted like:
@@ -403,6 +407,7 @@ namespace System.Net.NetworkInformation {
                }
        }
 
+#if !MOBILE
        class Win32IPGlobalProperties : IPGlobalProperties
        {
                public const int AF_INET = 2;
@@ -736,4 +741,5 @@ namespace System.Net.NetworkInformation {
                        }
                }
        }
+#endif
 }
index 7a017ef80a854b6700da25c4e8ae2929b40f0e5a..749be358302b0390c4d6454279649f045cd58d69 100644 (file)
@@ -142,6 +142,7 @@ namespace System.Net.NetworkInformation {
                }
        }
 
+#if !MOBILE
        class Win32IPGlobalStatistics : IPGlobalStatistics 
        {
                Win32_MIB_IPSTATS info;
@@ -218,7 +219,7 @@ namespace System.Net.NetworkInformation {
                        get { return info.InUnknownProtos; }
                }
        }
-
+       
        [StructLayout (LayoutKind.Sequential)]
        struct Win32_MIB_IPSTATS
        {
@@ -246,5 +247,6 @@ namespace System.Net.NetworkInformation {
                public int NumAddr;
                public int NumRoutes;
        }
+#endif
 }
 
index 13edcd33351156f76183ec5a80a4f931bd1c7443..3a37594d7553aeb1528d170399781c88f97dce47 100644 (file)
@@ -325,6 +325,7 @@ namespace System.Net.NetworkInformation {
                }
        }
 
+#if !MOBILE
        class Win32IPInterfaceProperties2 : IPInterfaceProperties
        {
                readonly Win32_IP_ADAPTER_ADDRESSES addr;
@@ -406,6 +407,7 @@ namespace System.Net.NetworkInformation {
                }
 
        }
+#endif
 }
 
 
index 9202c0f09a8564eb49657348597f3a4aa050d35f..33264fb4d6a7d07376d26f8f318849d69af19e54 100644 (file)
@@ -137,6 +137,7 @@ namespace System.Net.NetworkInformation {
                }
        }
        
+#if !MOBILE
        sealed class Win32IPv4InterfaceProperties : IPv4InterfaceProperties
        {
                [DllImport ("iphlpapi.dll")]
@@ -198,5 +199,6 @@ namespace System.Net.NetworkInformation {
                public IntPtr CurrentDnsServer; // to Win32_IP_ADDR_STRING
                public Win32_IP_ADDR_STRING DnsServerList;
        }
+#endif
 }
 
index 8dd8743c85ffbcc070cc2fda0f5a766df00a786a..ba12ba067dab630b3b9c7049ab86865d6038cd2a 100644 (file)
@@ -28,6 +28,7 @@
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 namespace System.Net.NetworkInformation {
+#if !MOBILE
        class Win32IPv4InterfaceStatistics : IPv4InterfaceStatistics
        {
                Win32_MIB_IFROW info;
@@ -86,6 +87,7 @@ namespace System.Net.NetworkInformation {
                }
        
        }
+#endif
 
        class LinuxIPv4InterfaceStatistics : IPv4InterfaceStatistics
        {
index e81df59229c4ca79623a7096488a5b050777cfbb..bf31050377aed351375a6e76145611ef864fa5b7 100644 (file)
@@ -35,7 +35,7 @@ namespace System.Net.NetworkInformation {
                public abstract int Index { get; }
                public abstract int Mtu { get; }
        }
-
+#if !MOBILE
        class Win32IPv6InterfaceProperties : IPv6InterfaceProperties
        {
                Win32_MIB_IFROW mib;
@@ -53,5 +53,6 @@ namespace System.Net.NetworkInformation {
                        get { return mib.Mtu; }
                }
        }
+#endif
 }
 
index bb7fab0b66c9db9e893751b6e3e5308742421f28..3ad40ed2e1cd13361e8af8d0bb0ab2ac14b265b6 100644 (file)
@@ -157,6 +157,7 @@ namespace System.Net.NetworkInformation {
                }
        }
 
+#if !MOBILE
        class Win32IcmpV4Statistics : IcmpV4Statistics
        {
                Win32_MIBICMPSTATS iin, iout;
@@ -269,5 +270,6 @@ namespace System.Net.NetworkInformation {
                public uint AddrMasks;
                public uint AddrMaskReps;
        }
+#endif
 }
 
index 7683ebd33e9bb8f86bc1331e2495520ad8bcd47b..94b05b143429e883141eb4e4e54029371f3ebc0c 100644 (file)
@@ -201,6 +201,7 @@ namespace System.Net.NetworkInformation {
                public const int RouterRenumbering = 138;
        }
 
+#if !MOBILE
        class Win32IcmpV6Statistics : IcmpV6Statistics
        {
                Win32_MIBICMPSTATS_EX iin, iout;
@@ -322,5 +323,6 @@ namespace System.Net.NetworkInformation {
                [MarshalAs (UnmanagedType.ByValArray, SizeConst = 256)]
                public uint [] Counts;
        }
+#endif
 }
 
index 218adff70d6e1788c3511bf7266ccd63c52f8939..36bd9c42de1a4e5b0bf5346432a2998a05b99bb0 100644 (file)
@@ -109,6 +109,7 @@ namespace System.Net.NetworkInformation {
                        get { return is_readonly; }
                }
 
+#if !MOBILE
                public static MulticastIPAddressInformationCollection Win32FromMulticast (IntPtr ptr)
                {
                        MulticastIPAddressInformationImplCollection c = new MulticastIPAddressInformationImplCollection (false);
@@ -123,6 +124,7 @@ namespace System.Net.NetworkInformation {
                        c.is_readonly = true;
                        return c;
                }
+#endif
 
                public static MulticastIPAddressInformationImplCollection LinuxFromList (List<IPAddress> addresses)
                {
index 62748e573f693e4a8344a822c9eec687f543b2fe..92a5dfe0a60892c3e5321b07a0308a4754975cb3 100644 (file)
@@ -410,6 +410,7 @@ namespace System.Net.NetworkInformation {
                        }
                }
 
+#if !MOBILE
                class Win32NetworkInterfaceAPI : NetworkInterfaceFactory
                {
                        [DllImport ("iphlpapi.dll", SetLastError = true)]
@@ -457,6 +458,7 @@ namespace System.Net.NetworkInformation {
                                throw new NotImplementedException ();
                        }
                }
+#endif
 
                public abstract NetworkInterface [] GetAllNetworkInterfaces ();
                public abstract int GetLoopbackInterfaceIndex ();
@@ -464,7 +466,7 @@ namespace System.Net.NetworkInformation {
 
                public static NetworkInterfaceFactory Create ()
                {
-#if MONOTOUCH
+#if MONOTOUCH || XAMMAC
                        return new MacOsNetworkInterfaceAPI ();
 #else
                        Version windowsVer51 = new Version (5, 1);
@@ -718,6 +720,7 @@ namespace System.Net.NetworkInformation {
                }
        }
 
+#if !MOBILE
        class Win32NetworkInterface2 : NetworkInterface
        {
                [DllImport ("iphlpapi.dll", SetLastError = true)]
@@ -830,5 +833,6 @@ namespace System.Net.NetworkInformation {
                        get { return !addr.NoMulticast; }
                }
        }
+#endif
 }
 
index a7b46e35d6b3701a7f00af123bbc6aba70d2818d..9f8c88a2eb3f8fd0fd2024a0e0c8fb3745e86046 100644 (file)
@@ -109,6 +109,7 @@ namespace System.Net.NetworkInformation {
                }
        }
 
+#if !MOBILE
        class Win32TcpStatistics : TcpStatistics
        {
                Win32_MIB_TCPSTATS info;
@@ -193,6 +194,6 @@ namespace System.Net.NetworkInformation {
                public uint OutRsts;
                public uint NumConns;
        }
-
+#endif
 }
 
index 6126b93d79908833e023602d7b6de3cb0916f5a1..2c9d6962912f899d777f1fc66e6e886630a5c604 100644 (file)
@@ -73,6 +73,7 @@ namespace System.Net.NetworkInformation {
                }
        }
 
+#if !MOBILE
        class Win32UdpStatistics : UdpStatistics
        {
                Win32_MIB_UDPSTATS info;
@@ -111,5 +112,6 @@ namespace System.Net.NetworkInformation {
                public uint OutDatagrams;
                public int NumAddrs;
        }
+#endif
 }
 
index e8c254a2a378e1ce0d9b33a1637cda3ff8d2764a..a7510f033e9bca3608bcf551146d2381f44f10a2 100644 (file)
@@ -32,6 +32,7 @@ using System.Runtime.InteropServices;
 using System.Net.Sockets;
 
 namespace System.Net.NetworkInformation {
+#if !MOBILE
        class Win32UnicastIPAddressInformation : UnicastIPAddressInformation 
        {
                int if_index;
@@ -105,6 +106,7 @@ namespace System.Net.NetworkInformation {
                        get { return info.SuffixOrigin; }
                }
        }
+#endif
 
        class LinuxUnicastIPAddressInformation : UnicastIPAddressInformation
        {
index 3905225f9349b93402b796819fc9de7f3444e5d6..b83959a3faf73ced0c16b365355dc387f135bc35 100644 (file)
@@ -111,6 +111,7 @@ namespace System.Net.NetworkInformation {
                        get { return is_readonly; }
                }
 
+#if !MOBILE
                public static UnicastIPAddressInformationCollection Win32FromUnicast (int ifIndex, IntPtr ptr)
                {
                        UnicastIPAddressInformationImplCollection c = new UnicastIPAddressInformationImplCollection (false);
@@ -122,6 +123,7 @@ namespace System.Net.NetworkInformation {
                        c.is_readonly = true;
                        return c;
                }
+#endif
 
                public static UnicastIPAddressInformationCollection LinuxFromList (List<IPAddress> addresses)
                {
index 0685b5985d4ef80b452e0dbeaf7aa9d35703edd6..91fd65b38280fb614aad7435ad41aae78705e371 100644 (file)
@@ -1777,7 +1777,7 @@ namespace System {
 
                // static methods
 
-               private const int MaxUriLength = 32766;
+               private const int MaxUriLength = 0xfff0;
 
                public static int Compare (Uri uri1, Uri uri2, UriComponents partsToCompare, UriFormat compareFormat, StringComparison comparisonType)
                {
@@ -1825,7 +1825,7 @@ namespace System {
                        if (stringToEscape == null)
                                throw new ArgumentNullException ("stringToEscape");
 
-                       if (stringToEscape.Length > MaxUriLength) {
+                       if (stringToEscape.Length >= MaxUriLength) {
                                throw new UriFormatException (string.Format ("Uri is longer than the maximum {0} characters.", MaxUriLength));
                        }
 
@@ -1882,7 +1882,7 @@ namespace System {
                        if (stringToEscape == null)
                                throw new ArgumentNullException ("stringToEscape");
 
-                       if (stringToEscape.Length > MaxUriLength) {
+                       if (stringToEscape.Length >= MaxUriLength) {
                                throw new UriFormatException (string.Format ("Uri is longer than the maximum {0} characters.", MaxUriLength));
                        }
 
index 270ea6b23047769a05dd0539873ba973bb78b5f0..2d502c5b7085a731208d67fa7f8d24b4715cdb8a 100644 (file)
@@ -104,7 +104,6 @@ System.Net.NetworkInformation/TcpStatistics.cs
 System.Net.NetworkInformation/UdpStatistics.cs
 System.Net.NetworkInformation/UnicastIPAddressInformation.cs
 System.Net.NetworkInformation/UnicastIPAddressInformationCollection.cs
-System.Net.NetworkInformation/Win32NetworkInterfaceMarshal.cs
 System.Net.Security/AuthenticatedStream.cs
 System.Net.Security/AuthenticationLevel.cs
 System.Net.Security/EncryptionPolicy.cs
index e318d62052e98ef1bdc53e5a364e4023948bd29e..a412ae71541af33a56b0d4ddec8e6b82dfc85b46 100644 (file)
@@ -1296,6 +1296,21 @@ namespace MonoTests.System
                        }
                }
 
+               [Test]
+               public void Parse_SameTimeAndDateSeparator ()
+               {
+                       var fiFI = (CultureInfo) CultureInfo.GetCultureInfo("fi-FI").Clone();
+
+                       fiFI.DateTimeFormat.TimeSeparator = fiFI.DateTimeFormat.DateSeparator;
+
+                       var dt = DateTime.Parse("4.3.2010", fiFI);
+
+                       Assert.AreEqual (2010, dt.Year, "#1");
+                       Assert.AreEqual (3, dt.Month, "#2");
+                       Assert.AreEqual (4, dt.Day, "#3");
+               }
+
+
                [Test]
                [ExpectedException (typeof (FormatException))]
                public void Parse_RequireSpaceSeparator ()
index 30cad403132dc83afdd438b11208c2e752de3ef7..207d6cb40f911ba5cda004fefb7b8665b655082d 100644 (file)
@@ -26,7 +26,7 @@ namespace Mono.Documentation {
                                else {
                                        Console.Error.WriteLine ("mdoc: {0}", e.Message);
                                }
-                               Console.Error.WriteLine ("See `mdoc help' for more information.");
+                               Console.Error.WriteLine ("See `mdoc help' for more information or use --debug to diagnose.");
                                Environment.ExitCode = 1;
                        }
                }
index a1f91f3b24b4cca519b4c71ddf7418b95da45ba5..20ab1e69abf6ffa628e684cccee3248bea0a3084 100644 (file)
@@ -1015,7 +1015,12 @@ class MDocUpdater : MDocCommand
                                        XmlDocument doc = new XmlDocument ();
                                        doc.Load (typefile.FullName);
                                        XmlElement e = doc.SelectSingleNode("/Type") as XmlElement;
-                                       string assemblyName = doc.SelectSingleNode ("/Type/AssemblyInfo/AssemblyName").InnerText;
+                                       var assemblyNameNode = doc.SelectSingleNode ("/Type/AssemblyInfo/AssemblyName");
+                                       if (assemblyNameNode == null){
+                                               Warning ("Did not find /Type/AssemblyInfo/AssemblyName on {0}", typefile.FullName);
+                                               continue;
+                                       }
+                                       string assemblyName = assemblyNameNode.InnerText;
                                        AssemblyDefinition assembly = assemblies.FirstOrDefault (a => a.Name.Name == assemblyName);
 
                                        Action saveDoc = () => {
index ec5c1f10aabad6e73e5b4e84fa54d1b42b21a954..4611bf698423f9fbcbee43e1d4e881336f755735 100755 (executable)
@@ -167,11 +167,7 @@ class MakeBundle {
                                sources.Add (args [i]);
                                break;
                        }
-                       
-                       if (static_link && style == "windows") {
-                               Console.Error.WriteLine ("The option `{0}' is not supported on this platform.", args [i]);
-                               return 1;
-                       }
+
                }
 
                Console.WriteLine ("Sources: {0} Auto-dependencies: {1}", sources.Count, autodeps);
@@ -419,16 +415,6 @@ void          mono_register_config_for_assembly (const char* assembly_name, cons
                        }
                        ts.Close ();
 
-                       string assembler = GetEnv ("AS", IsUnix ? "as" : "i686-pc-mingw32-as");
-                       
-                       Console.WriteLine ("Compiling:");
-                       string cmd = String.Format ("{0} -o {1} {2} ", assembler, temp_o, temp_s);
-                       int ret = Execute (cmd);
-                       if (ret != 0){
-                               Error ("[Fail]");
-                               return;
-                       }
-
                        if (compress)
                                tc.WriteLine ("\nstatic const CompressedAssembly *compressed [] = {");
                        else
@@ -478,42 +464,90 @@ void          mono_register_config_for_assembly (const char* assembly_name, cons
                                string maintemplate = st.ReadToEnd ();
                                tc.Write (maintemplate);
                        }
-                       
+
                        tc.Close ();
 
                        if (compile_only)
                                return;
+                       Console.WriteLine("Compiling:");
 
-                       string zlib = (compress ? "-lz" : "");
-                       string debugging = "-g";
-                       string cc = GetEnv ("CC", IsUnix ? "cc" : "i686-pc-mingw32-gcc");
+                       if (style == "windows")
+                       {
+                               string assembler = GetEnv("AS", "as");
+                               string as_cmd = String.Format("{0} -o {1} {2} ", assembler, temp_o, temp_s);
+                               Execute(as_cmd);
 
-                       if (style == "linux")
-                               debugging = "-ggdb";
-                       if (static_link) {
-                               string smonolib;
-                               if (style == "osx")
-                                       smonolib = "`pkg-config --variable=libdir mono-2`/libmono-2.0.a ";
-                               else
-                                       smonolib = "-Wl,-Bstatic -lmono-2.0 -Wl,-Bdynamic ";
-                               cmd = String.Format ("{4} -o {2} -Wall `pkg-config --cflags mono-2` {0} {3} " +
-                                                    "`pkg-config --libs-only-L mono-2` " + smonolib +
-                                                    "`pkg-config --libs-only-l mono-2 | sed -e \"s/\\-lmono-2.0 //\"` {1}",
-                                                    temp_c, temp_o, output, zlib, cc);
-                       } else {
-                               
-                               cmd = String.Format ("{4} " + debugging + " -o {2} -Wall {0} `pkg-config --cflags --libs mono-2` {3} {1}",
-                                                    temp_c, temp_o, output, zlib, cc);
+                               Func<string, string> quote = (pp) => { return "\"" + pp + "\""; };
+
+                               string compiler = GetEnv("CC", "cl.exe");
+                               string winsdkPath = GetEnv("WINSDK", @"C:\Program Files (x86)\Windows Kits\8.1");
+                               string vsPath = GetEnv("VSINCLUDE", @"C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC");
+                               string monoPath = GetEnv("MONOPREFIX", @"C:\Program Files (x86)\Mono");
+
+                               string[] includes = new string[] {winsdkPath + @"\Include\um", winsdkPath + @"\Include\shared", vsPath + @"\include", monoPath + @"\include\mono-2.0"};
+                               string[] libs = new string[] { winsdkPath + @"\Lib\winv6.3\um\x86" , vsPath + @"\lib" };
+                               string monoFile;
+
+                               var compilerArgs = new List<string>();
+                               foreach (string include in includes)
+                                       compilerArgs.Add(String.Format ("/I {0}", quote (include)));
+
+                               if (static_link) {
+                                       compilerArgs.Add("/MT");
+                                       monoFile = monoPath + @"\lib\mono-2.0.lib";
+                               }
+                               else {
+                                       compilerArgs.Add("/MD");
+                                       monoFile = monoPath + @"\lib\mono-2.0.dll";
+                               }
+
+                               compilerArgs.Add(temp_c);
+                               compilerArgs.Add(temp_o);
+                               compilerArgs.Add("/link");
+
+                               foreach (string lib in libs)
+                                       compilerArgs.Add(String.Format ("/LIBPATH:{0}", quote(lib)));
+                               compilerArgs.Add (quote(monoFile));
+
+                               string cl_cmd = String.Format("{0} {1}", compiler, String.Join(" ", compilerArgs.ToArray()));
+                               Execute (cl_cmd);
                        }
-                            
-                       ret = Execute (cmd);
-                       if (ret != 0){
-                               Error ("[Fail]");
-                               return;
+                       else
+                       {
+                               string assembler = GetEnv("AS", "as");
+                               string cmd = String.Format("{0} -o {1} {2} ", assembler, temp_o, temp_s);
+                               Execute(cmd);
+
+                               string zlib = (compress ? "-lz" : "");
+                               string debugging = "-g";
+                               string cc = GetEnv("CC", "cc");
+
+                               if (style == "linux")
+                                       debugging = "-ggdb";
+                               if (static_link)
+                               {
+                                       string smonolib;
+                                       if (style == "osx")
+                                               smonolib = "`pkg-config --variable=libdir mono-2`/libmono-2.0.a ";
+                                       else
+                                               smonolib = "-Wl,-Bstatic -lmono-2.0 -Wl,-Bdynamic ";
+                                       cmd = String.Format("{4} -o {2} -Wall `pkg-config --cflags mono-2` {0} {3} " +
+                                               "`pkg-config --libs-only-L mono-2` " + smonolib +
+                                               "`pkg-config --libs-only-l mono-2 | sed -e \"s/\\-lmono-2.0 //\"` {1}",
+                                               temp_c, temp_o, output, zlib, cc);
+                               }
+                               else
+                               {
+
+                                       cmd = String.Format("{4} " + debugging + " -o {2} -Wall {0} `pkg-config --cflags --libs mono-2` {3} {1}",
+                                               temp_c, temp_o, output, zlib, cc);
+                               }
+                               Execute (cmd);
                        }
+
                        Console.WriteLine ("Done");
-                       }
-                       }
+               }
+       }
                } finally {
                        if (!keeptemp){
                                if (object_out == null){
@@ -708,81 +742,98 @@ void          mono_register_config_for_assembly (const char* assembly_name, cons
                }
        }
 
-       static int Execute (string cmdLine)
+       static void Execute (string cmdLine)
        {
                if (IsUnix) {
                        Console.WriteLine (cmdLine);
-                       return system (cmdLine);
+                       int ret = system (cmdLine);
+                       if (ret != 0)
+                       {
+                               Error(String.Format("[Fail] {0}", ret));
+                       }
                }
-               
+
                // on Windows, we have to pipe the output of a
                // `cmd` interpolation to dos2unix, because the shell does not
                // strip the CRLFs generated by the native pkg-config distributed
                // with Mono.
                //
                // But if it's *not* on cygwin, just skip it.
-               
+
                // check if dos2unix is applicable.
-               if (use_dos2unix == null) {
-                       use_dos2unix = false;
+               if (use_dos2unix == true)
                        try {
-                               var info = new ProcessStartInfo ("dos2unix");
-                               info.CreateNoWindow = true;
-                               info.RedirectStandardInput = true;
-                               info.UseShellExecute = false;
-                               var dos2unix = Process.Start (info);
-                               dos2unix.StandardInput.WriteLine ("aaa");
-                               dos2unix.StandardInput.WriteLine ("\u0004");
-                               dos2unix.StandardInput.Close ();
-                               dos2unix.WaitForExit ();
-                               if (dos2unix.ExitCode == 0)
-                                       use_dos2unix = true;
-                       } catch {
-                               // ignore
-                       }
-               }
-               // and if there is no dos2unix, just run cmd /c.
-               if (use_dos2unix == false) {
-                       Console.WriteLine (cmdLine);
-                       ProcessStartInfo dos2unix = new ProcessStartInfo ();
-                       dos2unix.UseShellExecute = false;
-                       dos2unix.FileName = "cmd";
-                       dos2unix.Arguments = String.Format ("/c \"{0}\"", cmdLine);
-
-                       using (Process p = Process.Start (dos2unix)) {
-                               p.WaitForExit ();
-                               return p.ExitCode;
-                       }
+                       var info = new ProcessStartInfo ("dos2unix");
+                       info.CreateNoWindow = true;
+                       info.RedirectStandardInput = true;
+                       info.UseShellExecute = false;
+                       var dos2unix = Process.Start (info);
+                       dos2unix.StandardInput.WriteLine ("aaa");
+                       dos2unix.StandardInput.WriteLine ("\u0004");
+                       dos2unix.StandardInput.Close ();
+                       dos2unix.WaitForExit ();
+                       if (dos2unix.ExitCode == 0)
+                               use_dos2unix = true;
+               } catch {
+                       Console.WriteLine("Warning: dos2unix not found");
+                       use_dos2unix = false;
                }
 
-               StringBuilder b = new StringBuilder ();
-               int count = 0;
-               for (int i = 0; i < cmdLine.Length; i++) {
-                       if (cmdLine [i] == '`') {
-                               if (count % 2 != 0) {
-                                       b.Append ("|dos2unix");
+               if (use_dos2unix == null)
+                       use_dos2unix = false;
+
+               ProcessStartInfo psi = new ProcessStartInfo();
+               psi.UseShellExecute = false;
+
+               // if there is no dos2unix, just run cmd /c.
+               if (use_dos2unix == false)
+               {
+                       psi.FileName = "cmd";
+                       psi.Arguments = String.Format("/c \"{0}\"", cmdLine);
+               }
+               else
+               {
+                       psi.FileName = "sh";
+                       StringBuilder b = new StringBuilder();
+                       int count = 0;
+                       for (int i = 0; i < cmdLine.Length; i++)
+                       {
+                               if (cmdLine[i] == '`')
+                               {
+                                       if (count % 2 != 0)
+                                       {
+                                               b.Append("|dos2unix");
+                                       }
+                                       count++;
                                }
-                               count++;
+                               b.Append(cmdLine[i]);
                        }
-                       b.Append (cmdLine [i]);
+                       cmdLine = b.ToString();
+                       psi.Arguments = String.Format("-c \"{0}\"", cmdLine);
                }
-               cmdLine = b.ToString ();
-               Console.WriteLine (cmdLine);
-                       
-               ProcessStartInfo psi = new ProcessStartInfo ();
-               psi.UseShellExecute = false;
-               psi.FileName = "sh";
-               psi.Arguments = String.Format ("-c \"{0}\"", cmdLine);
 
+               Console.WriteLine(cmdLine);
                using (Process p = Process.Start (psi)) {
                        p.WaitForExit ();
-                       return p.ExitCode;
+                       int ret = p.ExitCode;
+                       if (ret != 0){
+                               Error (String.Format("[Fail] {0}", ret));
+                       }
                }
        }
 
-       static string GetEnv (string name, string defaultValue) 
+       static string GetEnv(string name, string defaultValue)
        {
-               string s = Environment.GetEnvironmentVariable (name);
-               return s != null ? s : defaultValue;
+               string val = Environment.GetEnvironmentVariable(name);
+               if (val != null)
+               {
+                       Console.WriteLine("{0} = {1}", name, val);
+               }
+               else
+               {
+                       val = defaultValue;
+                       Console.WriteLine("{0} = {1} (default)", name, val);
+               }
+               return val;
        }
 }
index 8f4220eead563a11693368e78c18ec231a9d2806..560f6bd035b007888900ac09f9bd03ed53499222 100644 (file)
@@ -30,7 +30,8 @@
 
 struct _MonoPPDBFile {
        MonoImage *image;
-       GHashTable *doc_cache;
+       GHashTable *doc_hash;
+       GHashTable *method_hash;
 };
 
 /* IMAGE_DEBUG_DIRECTORY structure */
@@ -84,6 +85,15 @@ get_pe_debug_guid (MonoImage *image, guint8 *out_guid, gint32 *out_age, gint32 *
        return FALSE;
 }
 
+static void
+doc_free (gpointer key)
+{
+       MonoDebugSourceInfo *info = key;
+
+       g_free (info->source_file);
+       g_free (info);
+}
+
 MonoPPDBFile*
 mono_ppdb_load_file (MonoImage *image, const guint8 *raw_contents, int size)
 {
@@ -111,6 +121,8 @@ mono_ppdb_load_file (MonoImage *image, const guint8 *raw_contents, int size)
                }
 
                ppdb_image = mono_image_open_metadata_only (ppdb_filename, &status);
+               if (!ppdb_image)
+                       g_free (ppdb_filename);
        }
        if (!ppdb_image)
                return NULL;
@@ -136,6 +148,8 @@ mono_ppdb_load_file (MonoImage *image, const guint8 *raw_contents, int size)
 
        ppdb = g_new0 (MonoPPDBFile, 1);
        ppdb->image = ppdb_image;
+       ppdb->doc_hash = g_hash_table_new_full (NULL, NULL, NULL, (GDestroyNotify) doc_free);
+       ppdb->method_hash = g_hash_table_new_full (NULL, NULL, NULL, (GDestroyNotify) g_free);
 
        return ppdb;
 }
@@ -146,8 +160,8 @@ mono_ppdb_close (MonoDebugHandle *handle)
        MonoPPDBFile *ppdb = handle->ppdb;
 
        mono_image_close (ppdb->image);
-       if (ppdb->doc_cache)
-               g_hash_table_destroy (ppdb->doc_cache);
+       g_hash_table_destroy (ppdb->doc_hash);
+       g_hash_table_destroy (ppdb->method_hash);
        g_free (ppdb);
 }
 
@@ -155,19 +169,28 @@ MonoDebugMethodInfo *
 mono_ppdb_lookup_method (MonoDebugHandle *handle, MonoMethod *method)
 {
        MonoDebugMethodInfo *minfo;
+       MonoPPDBFile *ppdb = handle->ppdb;
 
        if (handle->image != mono_class_get_image (mono_method_get_class (method)))
                return NULL;
 
-       // FIXME: Cache
+       mono_debugger_lock ();
 
-       // FIXME: Methods without tokens
+       minfo = g_hash_table_lookup (ppdb->method_hash, method);
+       if (minfo) {
+               mono_debugger_unlock ();
+               return minfo;
+       }
 
        minfo = g_new0 (MonoDebugMethodInfo, 1);
        minfo->index = 0;
        minfo->method = method;
        minfo->handle = handle;
 
+       g_hash_table_insert (ppdb->method_hash, method, minfo);
+
+       mono_debugger_unlock ();
+
        return minfo;
 }
 
@@ -182,9 +205,13 @@ get_docinfo (MonoPPDBFile *ppdb, MonoImage *image, int docidx)
        int size, part_size, partidx, nparts;
        char sep;
        GString *s;
-       MonoDebugSourceInfo *res;
+       MonoDebugSourceInfo *res, *cached;
 
-       // FIXME: Cache
+       mono_debugger_lock ();
+       cached = g_hash_table_lookup (ppdb->doc_hash, GUINT_TO_POINTER (docidx));
+       mono_debugger_unlock ();
+       if (cached)
+               return cached;
 
        mono_metadata_decode_row (&tables [MONO_TABLE_DOCUMENT], docidx-1, cols, MONO_DOCUMENT_SIZE);
 
@@ -218,6 +245,15 @@ get_docinfo (MonoPPDBFile *ppdb, MonoImage *image, int docidx)
        res->guid = NULL;
        res->hash = (guint8*)mono_metadata_blob_heap (image, cols [MONO_DOCUMENT_HASH]);
 
+       mono_debugger_lock ();
+       cached = g_hash_table_lookup (ppdb->doc_hash, GUINT_TO_POINTER (docidx));
+       if (!cached) {
+               g_hash_table_insert (ppdb->doc_hash, GUINT_TO_POINTER (docidx), res);
+       } else {
+               doc_free (res);
+               res = cached;
+       }
+       mono_debugger_unlock ();
        return res;
 }
 
@@ -263,8 +299,8 @@ mono_ppdb_lookup_location (MonoDebugMethodInfo *minfo, uint32_t offset)
 
        docidx = cols [MONO_METHODBODY_DOCUMENT];
 
-       // FIXME:
-       g_assert (cols [MONO_METHODBODY_SEQ_POINTS]);
+       if (!cols [MONO_METHODBODY_SEQ_POINTS])
+               return NULL;
        ptr = mono_metadata_blob_heap (image, cols [MONO_METHODBODY_SEQ_POINTS]);
        size = mono_metadata_decode_blob_size (ptr, &ptr);
        end = ptr + size;
@@ -282,9 +318,10 @@ mono_ppdb_lookup_location (MonoDebugMethodInfo *minfo, uint32_t offset)
        while (ptr < end) {
                delta_il = mono_metadata_decode_value (ptr, &ptr);
                if (!first && delta_il == 0) {
-                       /* Document record */
-                       // FIXME:
-                       g_assert_not_reached ();
+                       /* document-record */
+                       docidx = mono_metadata_decode_value (ptr, &ptr);
+                       docname = get_docname (ppdb, image, docidx);
+                       continue;
                }
                if (!first && iloffset + delta_il > offset)
                        break;
@@ -297,8 +334,8 @@ mono_ppdb_lookup_location (MonoDebugMethodInfo *minfo, uint32_t offset)
                else
                        delta_cols = mono_metadata_decode_signed_value (ptr, &ptr);
                if (delta_lines == 0 && delta_cols == 0)
-                       // FIXME:
-                       g_assert_not_reached ();
+                       /* hidden-sequence-point-record */
+                       continue;
                if (first_non_hidden) {
                        start_line = mono_metadata_decode_value (ptr, &ptr);
                        start_col = mono_metadata_decode_value (ptr, &ptr);
index d88757ab4fdb729f27cf39ccb3e398144f426e54..158831256dc2eacb34f728ef746fb950e60f5cda 100644 (file)
@@ -1037,30 +1037,32 @@ do_mono_image_load (MonoImage *image, MonoImageOpenStatus *status,
        iinfo = image->image_info;
        header = &iinfo->cli_header;
 
-       for (l = image_loaders; l; l = l->next) {
-               MonoImageLoader *loader = l->data;
-               if (loader->match (image)) {
-                       image->loader = loader;
-                       break;
+       if (!image->metadata_only) {
+               for (l = image_loaders; l; l = l->next) {
+                       MonoImageLoader *loader = l->data;
+                       if (loader->match (image)) {
+                               image->loader = loader;
+                               break;
+                       }
+               }
+               if (!image->loader) {
+                       *status = MONO_IMAGE_IMAGE_INVALID;
+                       goto invalid_image;
                }
-       }
-       if (!image->loader) {
-               *status = MONO_IMAGE_IMAGE_INVALID;
-               goto invalid_image;
-       }
 
-       if (status)
-               *status = MONO_IMAGE_IMAGE_INVALID;
+               if (status)
+                       *status = MONO_IMAGE_IMAGE_INVALID;
 
-       if (care_about_pecoff == FALSE)
-               goto done;
+               if (care_about_pecoff == FALSE)
+                       goto done;
 
-       if (!image->metadata_only) {
                if (image->loader == &pe_loader && !mono_verifier_verify_pe_data (image, &errors))
                        goto invalid_image;
 
                if (!mono_image_load_pe_data (image))
                        goto invalid_image;
+       } else {
+               image->loader = &pe_loader;
        }
 
        if (care_about_cli == FALSE) {
index 4626ed48ca03b0d37d73a04b3a47bc44b952e83a..e07f8fadb838dcd599922996f8b077333134d56d 100644 (file)
 #include <mono/metadata/mono-gc.h>
 
 MONO_BEGIN_DECLS
-
+/* do not change the values of this enum */
 typedef enum {
-       MONO_HASH_KEY_GC,
-       MONO_HASH_VALUE_GC,
-       MONO_HASH_KEY_VALUE_GC
+       MONO_HASH_KEY_GC = 1,
+       MONO_HASH_VALUE_GC = 2,
+       MONO_HASH_KEY_VALUE_GC = MONO_HASH_KEY_GC | MONO_HASH_VALUE_GC,
 } MonoGHashGCType;
 
 typedef struct _MonoGHashTable MonoGHashTable;
index cb23e6b3adad39792962ce581a08debb3b687b2f..d9fa2e2c9c381dcda55ed6b602514ec13102aa27 100755 (executable)
@@ -432,6 +432,7 @@ common_sources = \
        debugger-agent.h        \
        debugger-agent.c        \
        xdebug.c                        \
+       mini-llvm.h                     \
        mini-llvm-cpp.h \
        alias-analysis.c        \
        mini-cross-helpers.c \
index 8e96bed61a6b55bbbe21bb2d61a4cf731f3c243c..49fb87c222d85c528497109c1c0c4dab3fe46e21 100644 (file)
@@ -56,6 +56,7 @@
 #include "image-writer.h"
 #include "dwarfwriter.h"
 #include "mini-gc.h"
+#include "mini-llvm.h"
 
 #if !defined(DISABLE_AOT) && !defined(DISABLE_JIT)
 
@@ -4482,6 +4483,26 @@ add_generic_instances (MonoAotCompile *acfg)
                if (klass)
                        add_instances_of (acfg, klass, insts, ninsts, TRUE);
 
+               /* Add an instance of LongEnumEqualityComparer<long/ulong> which is created by EqualityComparer<T> for enums */
+               {
+                       MonoClass *enum_comparer;
+                       MonoGenericContext ctx;
+                       MonoType *args [16];
+
+                       enum_comparer = mono_class_from_name (mono_defaults.corlib, "System.Collections.Generic", "LongEnumEqualityComparer`1");
+                       g_assert (enum_comparer);
+
+                       memset (&ctx, 0, sizeof (ctx));
+                       args [0] = &mono_defaults.int64_class->byval_arg;
+                       ctx.class_inst = mono_metadata_get_generic_inst (1, args);
+                       add_generic_class (acfg, mono_class_inflate_generic_class (enum_comparer, &ctx), FALSE, "EqualityComparer<T>");
+
+                       memset (&ctx, 0, sizeof (ctx));
+                       args [0] = &mono_defaults.uint64_class->byval_arg;
+                       ctx.class_inst = mono_metadata_get_generic_inst (1, args);
+                       add_generic_class (acfg, mono_class_inflate_generic_class (enum_comparer, &ctx), FALSE, "EqualityComparer<T>");
+               }
+
                /* Add instances of the array generic interfaces for primitive types */
                /* This will add instances of the InternalArray_ helper methods in Array too */
                klass = mono_class_from_name (acfg->image, "System.Collections.Generic", "ICollection`1");
@@ -4557,6 +4578,30 @@ add_generic_instances (MonoAotCompile *acfg)
                                }
                        }
                }
+
+               /* object[] accessor wrappers. */
+               {
+                       MonoClass *obj_array_class = mono_array_class_get (mono_defaults.object_class, 1);
+                       MonoMethod *m;
+
+                       m = mono_class_get_method_from_name (obj_array_class, "Get", 1);
+                       g_assert (m);
+
+                       m = mono_marshal_get_array_accessor_wrapper (m);
+                       add_extra_method (acfg, m);
+
+                       m = mono_class_get_method_from_name (obj_array_class, "Address", 1);
+                       g_assert (m);
+
+                       m = mono_marshal_get_array_accessor_wrapper (m);
+                       add_extra_method (acfg, m);
+
+                       m = mono_class_get_method_from_name (obj_array_class, "Set", 2);
+                       g_assert (m);
+
+                       m = mono_marshal_get_array_accessor_wrapper (m);
+                       add_extra_method (acfg, m);
+               }
        }
 }
 
index 3091cab90549320f868f5dc2f5c385c909fc21b8..bb6d72f607a188a06bc2b50c7c1340c6952a8272 100644 (file)
@@ -4243,6 +4243,27 @@ mono_aot_get_method (MonoDomain *domain, MonoMethod *method)
                                return code;
                }
 
+               /* For ARRAY_ACCESSOR wrappers with reference types, use the <object> instantiation saved in corlib */
+               if (method_index == 0xffffff && method->wrapper_type == MONO_WRAPPER_UNKNOWN) {
+                       WrapperInfo *info = mono_marshal_get_wrapper_info (method);
+
+                       if (info->subtype == WRAPPER_SUBTYPE_ARRAY_ACCESSOR) {
+                               MonoMethod *array_method = info->d.array_accessor.method;
+                               if (MONO_TYPE_IS_REFERENCE (&array_method->klass->element_class->byval_arg)) {
+                                       MonoClass *obj_array_class = mono_array_class_get (mono_defaults.object_class, 1);
+                                       MonoMethod *m = mono_class_get_method_from_name (obj_array_class, array_method->name, mono_method_signature (array_method)->param_count);
+                                       g_assert (m);
+
+                                       m = mono_marshal_get_array_accessor_wrapper (m);
+                                       if (m != method) {
+                                               code = mono_aot_get_method (domain, m);
+                                               if (code)
+                                                       return code;
+                                       }
+                               }
+                       }
+               }
+
                if (method_index == 0xffffff && method->is_inflated && mono_method_is_generic_sharable_full (method, FALSE, TRUE, FALSE)) {
                        /* Partial sharing */
                        MonoMethod *shared;
index 98bd905faf3550cfae9354d3c34360ba53cdebd9..048ae081e4e8ef7d3d54de059a5526ddad5d5551 100644 (file)
@@ -5,18 +5,19 @@ using System.Reflection;
 using System.Runtime.InteropServices;
 using System.Runtime.CompilerServices;
 using System.Collections.Generic;
+using System.Collections.ObjectModel;
 
 /*
  * Regression tests for the AOT/FULL-AOT code.
  */
 
-#if MOBILE
+#if __MOBILE__
 class AotTests
 #else
 class Tests
 #endif
 {
-#if !MOBILE
+#if !__MOBILE__
        static int Main (String[] args) {
                return TestDriver.RunTests (typeof (Tests), args);
        }
@@ -291,4 +292,24 @@ class Tests
                        return 1;
                return 0;
        }
+
+       enum LongEnum : ulong {
+               A = 1
+                       }
+
+       public static int test_0_long_enum_eq_comparer () {
+               var c = EqualityComparer<LongEnum>.Default;
+               c.GetHashCode (LongEnum.A);
+               return 0;
+       }
+
+       public static int test_0_array_accessor_runtime_invoke_ref () {
+               var t = typeof (string[]);
+               var arr = Array.CreateInstance (typeof (string), 1);
+               arr.GetType ().GetMethod ("Set").Invoke (arr, new object [] { 0, "A" });
+               var res = (string)arr.GetType ().GetMethod ("Get").Invoke (arr, new object [] { 0 });
+               if (res != "A")
+                       return 1;
+               return 0;
+       }
 }
index 55df1662c34358f3bf3fc345dec84b404e7e8a16..00a3c6b901f86a6b0c92e4b9a2993dbb447f3e78 100644 (file)
@@ -23,14 +23,14 @@ using System.Reflection;
  * the IL code looks.
  */
 
-#if MOBILE
+#if __MOBILE__
 class ArrayTests
 #else
 class Tests
 #endif
 {
 
-#if !MOBILE
+#if !__MOBILE__
        public static int Main (string[] args) {
                return TestDriver.RunTests (typeof (Tests), args);
        }
index ba0351628184c28297183dfcdd2350bd2a40ed70..ad3cdde59a1f3284f151948cf5441b6910db2fd8 100644 (file)
@@ -23,14 +23,14 @@ using System.Reflection;
  * the IL code looks.
  */
 
-#if MOBILE
+#if __MOBILE__
 class CallsTests
 #else
 class Tests
 #endif
 {
 
-#if !MOBILE
+#if !__MOBILE__
        public static int Main (string[] args) {
                return TestDriver.RunTests (typeof (Tests), args);
        }
index 0eb1e240bc5348d18f4d81badc38b476dee69152..9415256e94fd78049813135bd7df3a1b2e723629 100644 (file)
@@ -26,14 +26,14 @@ using System.Reflection;
 /* A comparison made to same variable. */
 #pragma warning disable 1718
 
-#if MOBILE
+#if __MOBILE__
 class FloatTests
 #else
 class Tests
 #endif
 {
 
-#if !MOBILE
+#if !__MOBILE__
        public static int Main (string[] args) {
                return TestDriver.RunTests (typeof (Tests), args);
        }
index 1d81232c3a04dbb80a94811fbdf41ee1766f2285..82eb5befe7dd3b2b3a6b1153bf7cc70d65beee1f 100644 (file)
@@ -23,14 +23,14 @@ using System.Reflection;
  * the IL code looks.
  */
 
-#if MOBILE
+#if __MOBILE__
 class LongTests
 #else
 class Tests
 #endif
 {
 
-#if !MOBILE
+#if !__MOBILE__
        public static int Main (string[] args) {
                return TestDriver.RunTests (typeof (Tests), args);
        }
index 854b21e5868870a4ca21709eff65612f6bdfdcde..9a1fcb9406cd97e0c3887220e7f1df61fdef5600 100644 (file)
@@ -23,14 +23,14 @@ using System.Reflection;
  * the IL code looks.
  */
 
-#if MOBILE
+#if __MOBILE__
 class MathTests
 #else
 class Tests
 #endif
 {
 
-#if !MOBILE
+#if !__MOBILE__
        public static int Main (string[] args) {
                return TestDriver.RunTests (typeof (Tests), args);
        }
index 477af333e9b4a8401a8b6ec5ab4e7646e6044ac3..4cf0e75f5d9cb07ec0ea64bd42d800d95bc4a373 100644 (file)
@@ -23,14 +23,14 @@ using System.Reflection;
  * the IL code looks.
  */
 
-#if MOBILE
+#if __MOBILE__
 class BasicTests
 #else
 class Tests
 #endif
 {
 
-#if !MOBILE
+#if !__MOBILE__
        public static int Main (string[] args) {
                return TestDriver.RunTests (typeof (Tests), args);
        }
index 285eb3f49edbf98ae7ac2b47f5e451f6c2c6e3dd..bf1134be6bb765cbed3bab6e178cd595a00106d3 100644 (file)
@@ -193,4 +193,4 @@ class Tests {
                
                return 0;
        }
-}
\ No newline at end of file
+}
index 131a9c63a5ce1b69d7cfe3ffb0f9450325c9817a..0148488dee3a3ab0ca92865eaf656c14f4a0fb93 100644 (file)
@@ -24,14 +24,14 @@ using System.Runtime.CompilerServices;
  * the IL code looks.
  */
 
-#if MOBILE
+#if __MOBILE__
 class ExceptionTests
 #else
 class Tests
 #endif
 {
 
-#if !MOBILE
+#if !__MOBILE__
        public static int Main (string[] args) {
                return TestDriver.RunTests (typeof (Tests), args);
        }
@@ -2589,7 +2589,7 @@ class Tests
        public static int test_0_lmf_filter () {
                try {
                        // The invoke calls a runtime-invoke wrapper which has a filter clause
-#if MOBILE
+#if __MOBILE__
                        typeof (ExceptionTests).GetMethod ("lmf_filter").Invoke (null, new object [] { });
 #else
                        typeof (Tests).GetMethod ("lmf_filter").Invoke (null, new object [] { });
@@ -2818,8 +2818,8 @@ class Tests
        }
 }
 
-#if !MOBILE
+#if !__MOBILE__
 class ExceptionTests : Tests
 {
 }
-#endif
\ No newline at end of file
+#endif
index 50a91fdf2ea4ef97daa5257c588f42ab40ae82de..023a56d716507bda15dc1dc604531d94b82090eb 100644 (file)
@@ -628,4 +628,4 @@ class Tests {
 
                return (int)lb.o1 + (int)lb.o2 + (int)lb.o3 + (int)lb.o32;
        }
-}
\ No newline at end of file
+}
index 9d7517e39e35c0aa05dc796db55cac9a700f5c25..04b4e544933452b1f4e56149c235a69c492c0598 100644 (file)
@@ -5,7 +5,7 @@ using System.Runtime.CompilerServices;
 using System.Threading;
 using System.Threading.Tasks;
 
-#if MOBILE
+#if __MOBILE__
 class GenericsTests
 #else
 class Tests
@@ -21,7 +21,7 @@ class Tests
                }
        }
 
-#if !MOBILE
+#if !__MOBILE__
        class Enumerator <T> : MyIEnumerator <T> {
                T MyIEnumerator<T>.Current {
                        get {
@@ -41,7 +41,7 @@ class Tests
        }
 #endif
 
-#if !MOBILE
+#if !__MOBILE__
        static int Main (string[] args)
        {
                return TestDriver.RunTests (typeof (Tests), args);
@@ -191,7 +191,7 @@ class Tests
        public static int test_0_constrained_vtype_box () {
                GenericClass<TestStruct> t = new GenericClass<TestStruct> ();
 
-#if MOBILE
+#if __MOBILE__
                return t.toString (new TestStruct ()) == "GenericsTests+TestStruct" ? 0 : 1;
 #else
                return t.toString (new TestStruct ()) == "Tests+TestStruct" ? 0 : 1;
@@ -401,7 +401,7 @@ class Tests
                return 0;
        }
 
-#if !MOBILE
+#if !__MOBILE__
        public static int test_0_variance_reflection () {
                // covariance on IEnumerator
                if (!typeof (MyIEnumerator<object>).IsAssignableFrom (typeof (MyIEnumerator<string>)))
@@ -1233,7 +1233,7 @@ class Tests
        }
 }
 
-#if !MOBILE
+#if !__MOBILE__
 class GenericsTests : Tests
 {
 }
index f5ee9bbbf6069effddeddeeed2067809a3058226..c4c6a1ff19654120bb1f9d2c669758082f64eb56 100644 (file)
@@ -48,13 +48,13 @@ class GFoo3<T> {
 
 // FIXME: Add mixed ref/noref tests, i.e. Dictionary<string, int>
 
-#if MOBILE
+#if __MOBILE__
 public class GSharedTests
 #else
 public class Tests
 #endif
 {
-#if !MOBILE
+#if !__MOBILE__
        public static int Main (String[] args) {
                return TestDriver.RunTests (typeof (Tests), args);
        }
@@ -1735,7 +1735,7 @@ public class MobileServiceCollection<TTable, TCol>
        }
 }
 
-#if !MOBILE
+#if !__MOBILE__
 public class GSharedTests : Tests {
 }
 #endif
index 2f3d41924fe45b0f15f9764c5480d487e0ea280f..70bfd7934f6549cf96af06bbf01418b37222d8b7 100644 (file)
@@ -70,6 +70,7 @@
 #include "debugger-agent.h"
 #include "seq-points.h"
 #include "aot-compiler.h"
+#include "mini-llvm.h"
 
 #define BRANCH_COST 10
 #define INLINE_LENGTH_LIMIT 20
index 924b6fbca3361c512e928ab46a8d09576dea1ed4..26c9451330e2e6786e57841f94baed3ce723afc8 100644 (file)
@@ -67,6 +67,7 @@
 #include "debugger-agent.h"
 #include "seq-points.h"
 #include "llvm-runtime.h"
+#include "mini-llvm.h"
 
 #ifdef ENABLE_LLVM
 #include "mini-llvm-cpp.h"
index 40b44036e4b0c340d91031f64880d942ddf84b9b..cecc654cc5b8d648329740c046b875f87690d2d8 100644 (file)
@@ -4,6 +4,7 @@
  */
 
 #include "mini.h"
+#include "mini-llvm.h"
 
 #ifdef MONO_LLVM_LOADED
 
index 07b19c46ab0769e5f06074f067fa2fd5b9787532..777abee96cfe4fbf9301d8012a1f48f3f9ae8d92 100644 (file)
@@ -30,6 +30,7 @@
 
 #include "mini-llvm-cpp.h"
 #include "aot-compiler.h"
+#include "mini-llvm.h"
 
 #ifdef __MINGW32__
 
diff --git a/mono/mini/mini-llvm.h b/mono/mini/mini-llvm.h
new file mode 100644 (file)
index 0000000..3e36b0a
--- /dev/null
@@ -0,0 +1,32 @@
+#ifndef __MONO_MINI_LLVM_H__
+#define __MONO_MINI_LLVM_H__
+
+#include "mini.h"
+
+/* LLVM backend */
+/* KEEP THIS IN SYNCH WITH mini-llvm-loaded.c */
+void     mono_llvm_init                     (void) MONO_LLVM_INTERNAL;
+void     mono_llvm_cleanup                  (void) MONO_LLVM_INTERNAL;
+void     mono_llvm_emit_method              (MonoCompile *cfg) MONO_LLVM_INTERNAL;
+void     mono_llvm_emit_call                (MonoCompile *cfg, MonoCallInst *call) MONO_LLVM_INTERNAL;
+void     mono_llvm_create_aot_module        (MonoAssembly *assembly, const char *global_prefix, gboolean emit_dwarf, gboolean static_link, gboolean llvm_only) MONO_LLVM_INTERNAL;
+void     mono_llvm_emit_aot_module          (const char *filename, const char *cu_name) MONO_LLVM_INTERNAL;
+void     mono_llvm_emit_aot_file_info       (MonoAotFileInfo *info, gboolean has_jitted_code) MONO_LLVM_INTERNAL;
+void     mono_llvm_emit_aot_data            (const char *symbol, guint8 *data, int data_len) MONO_LLVM_INTERNAL;
+void     mono_llvm_check_method_supported   (MonoCompile *cfg) MONO_LLVM_INTERNAL;
+void     mono_llvm_free_domain_info         (MonoDomain *domain) MONO_LLVM_INTERNAL;
+MONO_API void mono_personality              (void);
+int      mono_llvm_load                     (const char* bpath);
+void     mono_llvm_rethrow_exception (MonoObject *ex);
+void     mono_llvm_throw_exception (MonoObject *ex);
+void     mono_llvm_throw_corlib_exception (guint32 ex_token_index);
+void     mono_llvm_resume_exception (void);
+gint32   mono_llvm_match_exception (MonoJitInfo *jinfo, guint32 region_start, guint32 region_end);
+void     mono_llvm_clear_exception (void);
+MonoObject *mono_llvm_load_exception (void);
+void     mono_llvm_reset_exception (void);
+void     mono_llvm_raise_exception (MonoException *e);
+
+gboolean mini_llvm_init                     (void);
+
+#endif
index 41fd8fccadf6187eb7f2cd5aafee97303f552659..3583d587c611043dab0f9e5eb7f58f9b0734c88e 100644 (file)
@@ -73,6 +73,7 @@
 #include "jit-icalls.h"
 
 #include "mini-gc.h"
+#include "mini-llvm.h"
 #include "debugger-agent.h"
 
 #ifdef MONO_ARCH_LLVM_SUPPORTED
index e96c0dce16cad93258db77d18358afad4e46f943..4bc45b46f3223b6e17d911f07ea4e8bdb52c5334 100644 (file)
@@ -73,6 +73,7 @@
 #include "mini-gc.h"
 #include "debugger-agent.h"
 #include "llvm-runtime.h"
+#include "mini-llvm.h"
 
 MonoTraceSpec *mono_jit_trace_calls;
 MonoMethodDesc *mono_inject_async_exc_method;
index 2c2702b418e4438a7311fe4fe65040f037178eef..c355233ad961b5697780a19bf543fa9bc213008a 100644 (file)
@@ -2401,32 +2401,6 @@ void     mono_save_trampoline_xdebug_info   (MonoTrampInfo *info);
 /* This is an exported function */
 void     mono_xdebug_flush                  (void);
 
-/* LLVM backend */
-/* KEEP THIS IN SYNCH WITH mini-llvm-loaded.c */
-void     mono_llvm_init                     (void) MONO_LLVM_INTERNAL;
-void     mono_llvm_cleanup                  (void) MONO_LLVM_INTERNAL;
-void     mono_llvm_emit_method              (MonoCompile *cfg) MONO_LLVM_INTERNAL;
-void     mono_llvm_emit_call                (MonoCompile *cfg, MonoCallInst *call) MONO_LLVM_INTERNAL;
-void     mono_llvm_create_aot_module        (MonoAssembly *assembly, const char *global_prefix, gboolean emit_dwarf, gboolean static_link, gboolean llvm_only) MONO_LLVM_INTERNAL;
-void     mono_llvm_emit_aot_module          (const char *filename, const char *cu_name) MONO_LLVM_INTERNAL;
-void     mono_llvm_emit_aot_file_info       (MonoAotFileInfo *info, gboolean has_jitted_code) MONO_LLVM_INTERNAL;
-void     mono_llvm_emit_aot_data            (const char *symbol, guint8 *data, int data_len) MONO_LLVM_INTERNAL;
-void     mono_llvm_check_method_supported   (MonoCompile *cfg) MONO_LLVM_INTERNAL;
-void     mono_llvm_free_domain_info         (MonoDomain *domain) MONO_LLVM_INTERNAL;
-MONO_API void mono_personality              (void);
-int      mono_llvm_load                     (const char* bpath);
-void     mono_llvm_rethrow_exception (MonoObject *ex);
-void     mono_llvm_throw_exception (MonoObject *ex);
-void     mono_llvm_throw_corlib_exception (guint32 ex_token_index);
-void     mono_llvm_resume_exception (void);
-gint32   mono_llvm_match_exception (MonoJitInfo *jinfo, guint32 region_start, guint32 region_end);
-void     mono_llvm_clear_exception (void);
-MonoObject *mono_llvm_load_exception (void);
-void     mono_llvm_reset_exception (void);
-void     mono_llvm_raise_exception (MonoException *e);
-
-gboolean mini_llvm_init                     (void);
-
 gboolean  mono_method_blittable             (MonoMethod *method);
 gboolean  mono_method_same_domain           (MonoJitInfo *caller, MonoJitInfo *callee);
 
index f944713a7bc818e5c711eb7529a2af42e035cb1e..3de372c89d034a04764fadff0a7140974f750e7a 100644 (file)
@@ -26,7 +26,7 @@ using System.Runtime.CompilerServices;
  * the IL code looks.
  */
 
-#if MOBILE
+#if __MOBILE__
 namespace ObjectTests
 {
 #endif
@@ -119,7 +119,7 @@ struct Gamma {
 
 class Tests {
 
-#if !MOBILE
+#if !__MOBILE__
        public static int Main (string[] args) {
                return TestDriver.RunTests (typeof (Tests), args);
        }
@@ -1688,6 +1688,6 @@ ncells ) {
        }
 }
 
-#if MOBILE
+#if __MOBILE__
 }
 #endif