Jelajahi Sumber

use MOONLIGHT symbol

svn path=/trunk/mcs/; revision=153656
Jb Evain 16 tahun lalu
induk
melakukan
05a5b21fa0

+ 5 - 0
mcs/class/corlib/System.IO/ChangeLog

@@ -1,3 +1,8 @@
+2010-03-16  Jb Evain  <[email protected]>
+
+	* FileStream.cs, File.cs, DirectoryInfo.cs, Directory.cs: use
+	MOONLIGHT symbol to disambiguate MonoTouch and Moonlight code.
+
 2010-03-16  Rolf Bjarne Kvinge  <[email protected]>
 
 	* Path.cs:

+ 8 - 8
mcs/class/corlib/System.IO/Directory.cs

@@ -44,7 +44,7 @@ using System.Security.Permissions;
 using System.Text;
 using System.Runtime.InteropServices;
 
-#if !NET_2_1 || MONOTOUCH
+#if !MOONLIGHT
 using System.Security.AccessControl;
 #endif
 
@@ -79,7 +79,7 @@ namespace System.IO
 			return CreateDirectoriesInternal (path);
 		}
 
-#if !NET_2_1 || MONOTOUCH
+#if !MOONLIGHT
 		[MonoLimitation ("DirectorySecurity not implemented")]
 		public static DirectoryInfo CreateDirectory (string path, DirectorySecurity directorySecurity)
 		{
@@ -89,7 +89,7 @@ namespace System.IO
 
 		static DirectoryInfo CreateDirectoriesInternal (string path)
 		{
-#if !NET_2_1 || MONOTOUCH
+#if !MOONLIGHT
 			if (SecurityManager.SecurityEnabled) {
 				new FileIOPermission (FileIOPermissionAccess.Read | FileIOPermissionAccess.Write, path).Demand ();
 			}
@@ -240,7 +240,7 @@ namespace System.IO
 			string result = MonoIO.GetCurrentDirectory (out error);
 			if (error != MonoIOError.ERROR_SUCCESS)
 				throw MonoIO.GetException (error);
-#if !NET_2_1 || MONOTOUCH
+#if !MOONLIGHT
 			if ((result != null) && (result.Length > 0) && SecurityManager.SecurityEnabled) {
 				new FileIOPermission (FileIOPermissionAccess.PathDiscovery, result).Demand ();
 			}
@@ -258,7 +258,7 @@ namespace System.IO
 			return GetFileSystemEntries (path, searchPattern, FileAttributes.Directory, FileAttributes.Directory);
 		}
 		
-#if !NET_2_1 || MONOTOUCH
+#if !MOONLIGHT
 		public static string [] GetDirectories (string path, string searchPattern, SearchOption searchOption)
 		{
 			if (searchOption == SearchOption.TopDirectoryOnly)
@@ -291,7 +291,7 @@ namespace System.IO
 			return GetFileSystemEntries (path, searchPattern, FileAttributes.Directory, 0);
 		}
 
-#if !NET_2_1 || MONOTOUCH
+#if !MOONLIGHT
 		public static string[] GetFiles (string path, string searchPattern, SearchOption searchOption)
 		{
 			if (searchOption == SearchOption.TopDirectoryOnly)
@@ -386,7 +386,7 @@ namespace System.IO
 				throw MonoIO.GetException (error);
 		}
 
-#if !NET_2_1 || MONOTOUCH
+#if !MOONLIGHT
 		public static void SetAccessControl (string path, DirectorySecurity directorySecurity)
 		{
 			throw new NotImplementedException ();
@@ -624,7 +624,7 @@ namespace System.IO
 		
 #endif
 
-#if !NET_2_1 || MONOTOUCH
+#if !MOONLIGHT
 		[MonoNotSupported ("DirectorySecurity isn't implemented")]
 		public static DirectorySecurity GetAccessControl (string path, AccessControlSections includeSections)
 		{

+ 2 - 2
mcs/class/corlib/System.IO/DirectoryInfo.cs

@@ -36,7 +36,7 @@ using System.Collections.Generic;
 using System.Runtime.InteropServices;
 using System.Runtime.Serialization;
 using System.Text;
-#if !NET_2_1 || MONOTOUCH
+#if !MOONLIGHT
 using System.Security.AccessControl;
 #endif
 
@@ -262,7 +262,7 @@ namespace System.IO {
 			return OriginalPath;
 		}
 
-#if !NET_2_1 || MONOTOUCH
+#if !MOONLIGHT
 		public DirectoryInfo[] GetDirectories (string searchPattern, SearchOption searchOption)
 		{
 			switch (searchOption) {

+ 2 - 2
mcs/class/corlib/System.IO/File.cs

@@ -54,7 +54,7 @@ namespace System.IO
 				throw new ArgumentNullException ("path");
 			if (path.Length == 0)
 				throw new ArgumentException ("path");
-#if NET_2_1 && !MONOTOUCH && !DEBUG
+#if MOONLIGHT && !DEBUG
 			// On Moonlight (SL4+) this is possible, with limitations, in "Elevated Trust"
 			throw new SecurityException ("we're not ready to enable this SL4 feature yet");
 #endif
@@ -641,7 +641,7 @@ namespace System.IO
 			throw new NotSupportedException (Locale.GetText ("File encryption isn't supported on any file system."));
 		}
 
-#if (NET_2_1 && !MONOTOUCH) || NET_4_0
+#if MOONLIGHT || NET_4_0
 		public static IEnumerable<string> ReadLines (string path)
 		{
 			ValidatePath (path);

+ 1 - 1
mcs/class/corlib/System.IO/FileStream.cs

@@ -98,7 +98,7 @@ namespace System.IO
 			this.access = access;
 			this.owner = ownsHandle;
 			this.async = isAsync;
-#if NET_2_1 && !MONOTOUCH
+#if MOONLIGHT
 			// default the browser to 'all' anonymous files and let other usage (like smcs) with 'normal'
 			// (i.e. non-anonymous except for isolated storage) files and paths
 			this.anonymous = SecurityManager.SecurityEnabled;

+ 1 - 1
mcs/class/corlib/System.Reflection.Emit/AssemblyBuilder.cs

@@ -262,7 +262,7 @@ namespace System.Reflection.Emit
 			// remove Mono specific flag to allow enum check to pass
 			access &= ~COMPILER_ACCESS;
 
-#if NET_2_1 && !MONOTOUCH
+#if MOONLIGHT
 			// only "Run" is supported by Silverlight
 			// however SMCS requires more than this but runs outside the CoreCLR sandbox
 			if (SecurityManager.SecurityEnabled && (access != AssemblyBuilderAccess.Run))

+ 5 - 0
mcs/class/corlib/System.Reflection.Emit/ChangeLog

@@ -1,3 +1,8 @@
+2010-03-16  Jb Evain  <[email protected]>
+
+	* AssemblyBuilder.cs, ModuleBuilder.cs: use MOONLIGHT symbol to
+	disambiguate MonoTouch and Moonlight code.
+
 2010-03-12  Jb Evain  <[email protected]>
 
 	* AssemblyBuilder.cs (AddTypeForwarder): throw if the

+ 1 - 1
mcs/class/corlib/System.Reflection.Emit/ModuleBuilder.cs

@@ -101,7 +101,7 @@ namespace System.Reflection.Emit {
 			}
 
 			if (emitSymbolInfo) {
-#if NET_2_1 && !MONOTOUCH
+#if MOONLIGHT
 				symbolWriter = new Mono.CompilerServices.SymbolWriter.SymbolWriterImpl (this);
 #else
 				Assembly asm = Assembly.LoadWithPartialName ("Mono.CompilerServices.SymbolWriter");

+ 4 - 4
mcs/class/corlib/System.Reflection/Assembly.cs

@@ -146,7 +146,7 @@ namespace System.Reflection {
 			[MethodImplAttribute (MethodImplOptions.InternalCall)]
 			get;
 		}
-#if !NET_2_1 || MONOTOUCH
+#if !MOONLIGHT
 		public virtual Evidence Evidence {
 			[SecurityPermission (SecurityAction.Demand, ControlEvidence = true)]
 			get { return UnprotectedGetEvidence (); }
@@ -292,7 +292,7 @@ namespace System.Reflection {
 
 				string location = Path.GetDirectoryName (Location);
 				string filename = Path.Combine (location, info.FileName);
-#if NET_2_1 && !MONOTOUCH
+#if MOONLIGHT
 				// we don't control the content of 'info.FileName' so we want to make sure we keep to ourselves
 				filename = Path.GetFullPath (filename);
 				if (!filename.StartsWith (location))
@@ -469,7 +469,7 @@ namespace System.Reflection {
 			// Try the assembly directory
 			string location = Path.GetDirectoryName (Location);
 			string fullName = Path.Combine (location, Path.Combine (culture.Name, aname.Name + ".dll"));
-#if NET_2_1 && !MONOTOUCH
+#if MOONLIGHT
 			// it's unlikely that culture.Name or aname.Name could contain stuff like ".." but...
 			fullName = Path.GetFullPath (fullName);
 			if (!fullName.StartsWith (location)) {
@@ -809,7 +809,7 @@ namespace System.Reflection {
 		}
 #endif
 
-#if !NET_2_1 || MONOTOUCH
+#if !MOONLIGHT
 		// Code Access Security
 
 		internal void Resolve () 

+ 5 - 0
mcs/class/corlib/System.Reflection/ChangeLog

@@ -1,3 +1,8 @@
+2010-03-16  Jb Evain  <[email protected]>
+
+	* Assembly.cs: use MOONLIGHT symbol to
+	disambiguate MonoTouch and Moonlight code.
+
 2010-03-07 Rodrigo Kumpera  <[email protected]>
 
 	* EventInfo.cs: Some v4 adjustments.

+ 5 - 0
mcs/class/corlib/System.Runtime.InteropServices/ChangeLog

@@ -1,3 +1,8 @@
+2010-03-16  Jb Evain  <[email protected]>
+
+	* MarshalAsAttribute.cs, Marshal.cs: use MOONLIGHT symbol to
+	disambiguate MonoTouch and Moonlight code.
+
 2009-12-13  Miguel de Icaza  <[email protected]>
 
 	* SafeBuffer.cs: When comparing the end, we only need to compare

+ 8 - 8
mcs/class/corlib/System.Runtime.InteropServices/Marshal.cs

@@ -38,11 +38,11 @@ using System.Reflection;
 using System.Threading;
 
 using System.Runtime.ConstrainedExecution;
-#if !NET_2_1 || MONOTOUCH
+#if !MOONLIGHT
 using System.Runtime.InteropServices.ComTypes;
 #endif
 
-#if !NET_2_1 || MONOTOUCH
+#if !MOONLIGHT
 using Mono.Interop;
 #endif
 
@@ -189,7 +189,7 @@ namespace System.Runtime.InteropServices
 			throw new NotImplementedException ();
 		}
 
-#if !NET_2_1 || MONOTOUCH
+#if !MOONLIGHT
 		public static object CreateWrapperOfType (object o, Type t)
 		{
 			__ComObject co = o as __ComObject;
@@ -272,7 +272,7 @@ namespace System.Runtime.InteropServices
 			FreeHGlobal (s);
 		}
 
-#if !NET_2_1 || MONOTOUCH
+#if !MOONLIGHT
 		public static Guid GenerateGuidForType (Type type)
 		{
 			return type.GUID;
@@ -374,7 +374,7 @@ namespace System.Runtime.InteropServices
 		{
 			throw new NotImplementedException ();
 		}
-#if !NET_2_1 || MONOTOUCH
+#if !MOONLIGHT
 		[MethodImplAttribute (MethodImplOptions.InternalCall)]
 		private extern static IntPtr GetIDispatchForObjectInternal (object o);
 
@@ -744,7 +744,7 @@ namespace System.Runtime.InteropServices
 			return ReleaseInternal (pUnk);
 		}
 
-#if !NET_2_1 || MONOTOUCH
+#if !MOONLIGHT
 		[MethodImplAttribute (MethodImplOptions.InternalCall)]
 		private extern static int ReleaseComObjectInternal (object co);
 
@@ -833,7 +833,7 @@ namespace System.Runtime.InteropServices
 		[MethodImplAttribute(MethodImplOptions.InternalCall)]
 		public extern static IntPtr StringToHGlobalUni (string s);
 
-#if !NET_2_1 || MONOTOUCH
+#if !MOONLIGHT
 		public static IntPtr SecureStringToBSTR (SecureString s)
 		{
 			if (s == null)
@@ -1049,7 +1049,7 @@ namespace System.Runtime.InteropServices
 			return null;
 		}
 
-#if !NET_2_1 || MONOTOUCH
+#if !MOONLIGHT
 		public static int FinalReleaseComObject (object o)
 		{
 			while (ReleaseComObject (o) != 0);

+ 1 - 1
mcs/class/corlib/System.Runtime.InteropServices/MarshalAsAttribute.cs

@@ -46,7 +46,7 @@ namespace System.Runtime.InteropServices {
 		[ComVisible(true)]
 		public Type MarshalTypeRef;
 		
-#if !NET_2_1 || MONOTOUCH
+#if !MOONLIGHT
 		public VarEnum SafeArraySubType;
 #endif