浏览代码

Adaptions: cross compilation of Win32.Machine for Generic / non-Generic

git-svn-id: https://svn.inf.ethz.ch/svn/lecturers/a2/trunk@6455 8c9fc860-2736-0410-a75d-ab315db34111
felixf 10 年之前
父节点
当前提交
00abed5cf0
共有 3 个文件被更改,包括 20 次插入5 次删除
  1. 2 0
      source/Generic.Win32.Kernel32.Mod
  2. 14 4
      source/Win32.Kernel32.Mod
  3. 4 1
      source/Win32.Machine.Mod

+ 2 - 0
source/Generic.Win32.Kernel32.Mod

@@ -5,6 +5,8 @@ MODULE Kernel32;   (** AUTHOR "ejz"; PURPOSE "Definition of the Win32 Kernel32 A
 IMPORT SYSTEM;
 
 CONST
+	Generic*= TRUE;
+	
 	(** NIL pointer/address value *)
 	NULL* = 0;
 

+ 14 - 4
source/Win32.Kernel32.Mod

@@ -5,6 +5,9 @@ MODULE Kernel32;   (** AUTHOR "ejz"; PURPOSE "Definition of the Win32 Kernel32 A
 IMPORT SYSTEM;
 
 CONST
+
+	Generic*= FALSE;
+
 	(** NIL pointer/address value *)
 	NULL* = 0;
 
@@ -800,7 +803,11 @@ VAR
 		ExitProcess(l);
 	END Shutdown;
 
-	PROCEDURE Init;
+	PROCEDURE Init*; (* stub for interoperability of Machine with Generic version *)
+	BEGIN
+	END Init; 
+
+	PROCEDURE Init0;
 	VAR mod: HMODULE;
 		str: ARRAY 64 OF CHAR;
 	BEGIN
@@ -943,7 +950,7 @@ VAR
 		GetProcAddress(mod, "GlobalMemoryStatusEx",SYSTEM.VAL(ADDRESS,GlobalMemoryStatusEx));
 		isEXE := hInstance = NULL;
 		IF isEXE THEN hInstance := GetModuleHandle( NIL ) END;
-		END Init;
+		END Init0;
 
 		(* for new object file:
 
@@ -995,11 +1002,14 @@ VAR
 
 		*)
 BEGIN
-	Init;
+	Init0;
+	OutputDebugString("Test");
 	IF IsDebuggerPresent()=True THEN
 		OutputString := OutputDebugString
 	ELSE
 		OutputString := NoOutputString
 	END;
 END Kernel32.
-	
+
+	
+	#	PELinker.Link  Win32.Aos.Link ~

+ 4 - 1
source/Win32.Machine.Mod

@@ -1069,5 +1069,8 @@ CODE{SYSTEM.i386}
 	OUT DX,EAX
 END Portout32;
 
-
+BEGIN
+	IF ~Kernel32.Generic THEN
+		Init
+	END;
 END Machine.