浏览代码

2008-01-23 Marek Safar <[email protected]>

 	* codegen.cs: Fixed AssemblyBuilder initialization on other platforms.
 	

svn path=/trunk/mcs/; revision=93632
Marek Safar 18 年之前
父节点
当前提交
ca3cbabc86
共有 2 个文件被更改,包括 12 次插入4 次删除
  1. 4 0
      mcs/mcs/ChangeLog
  2. 8 4
      mcs/mcs/codegen.cs

+ 4 - 0
mcs/mcs/ChangeLog

@@ -1,3 +1,7 @@
+2008-01-23  Marek Safar  <[email protected]>
+
+ 	* codegen.cs: Fixed AssemblyBuilder initialization on other platforms.
+
 2008-01-22  Marek Safar  <[email protected]>
 
 	* ecore.cs, expression.cs, generic.cs: Implicit bool? to bool conversion is

+ 8 - 4
mcs/mcs/codegen.cs

@@ -106,9 +106,6 @@ namespace Mono.CSharp {
 		//
 		static public bool Init (string name, string output, bool want_debugging_support)
 		{
-			/* Keep this in sync with System.Reflection.Emit.AssemblyBuilder */
-			const AssemblyBuilderAccess COMPILER_ACCESS = (AssemblyBuilderAccess) 0x800;
-
 			FileName = output;
 			AssemblyName an = Assembly.GetAssemblyName (name, output);
 			if (an == null)
@@ -133,6 +130,13 @@ namespace Mono.CSharp {
 			current_domain = AppDomain.CurrentDomain;
 
 			try {
+#if MS_COMPATIBLE
+				const AssemblyBuilderAccess COMPILER_ACCESS = 0;
+#else
+				/* Keep this in sync with System.Reflection.Emit.AssemblyBuilder */
+				const AssemblyBuilderAccess COMPILER_ACCESS = (AssemblyBuilderAccess) 0x800;
+#endif
+				
 				Assembly.Builder = current_domain.DefineDynamicAssembly (an,
 					AssemblyBuilderAccess.Save | COMPILER_ACCESS, Dirname (name));
 			}
@@ -143,7 +147,7 @@ namespace Mono.CSharp {
 						RootContext.StrongNameKeyContainer + "'.");
 					Environment.Exit (1);
 				}
-				return false;
+				throw;
 			}
 			catch (CryptographicException) {
 				if ((RootContext.StrongNameKeyContainer != null) || (RootContext.StrongNameKeyFile != null)) {