Browse Source

--- Merging r23028 into '.':
U packages/hermes/src/hermes.pp
--- Merging r23045 into '.':
G packages/hermes/src/hermes.pp
--- Merging r24709 into '.':
U packages/ptc/src/core/errori.inc
U packages/ptc/src/win32/gdi/win32modesetteri.inc
U packages/ptc/src/win32/base/win32window.inc

# revisions: 23028,23045,24709
r23028 | nickysn | 2012-11-18 21:37:32 +0100 (Sun, 18 Nov 2012) | 1 line
Changed paths:
M /trunk/packages/hermes/src/hermes.pp

* only enable I386_ASSEMBLER on certain platforms
r23045 | jonas | 2012-11-22 14:34:21 +0100 (Thu, 22 Nov 2012) | 3 lines
Changed paths:
M /trunk/packages/hermes/src/hermes.pp

- disabled assembler implementations for darwin/i386 because they don't
work on i386 targets that require a 16-byte aligned stack
r24709 | marco | 2013-06-01 14:48:11 +0200 (Sat, 01 Jun 2013) | 2 lines
Changed paths:
M /trunk/packages/ptc/src/core/errori.inc
M /trunk/packages/ptc/src/win32/base/win32window.inc
M /trunk/packages/ptc/src/win32/gdi/win32modesetteri.inc

* several -A fixes for ptcpas.
* some constants with "move to windows" comment moved to windows.

git-svn-id: branches/fixes_2_6@25923 -

marco 11 years ago
parent
commit
b21a554e15

+ 13 - 1
packages/hermes/src/hermes.pp

@@ -34,8 +34,20 @@ unit Hermes;
 
 
 {$MODE objfpc}
 {$MODE objfpc}
 
 
+{$if defined(darwin) and defined(cpui386)}
+{ darwin/i386 requires a 16 byte aligned stack, and inserts code for that on
+  entry in assembler routines (unless they are declared with "nostackframe").
+  These assembler routines manually create their own stack frame and hardcode
+  parameter offsets without using nostackframe, so they can never work on
+  Darwin.
+}
+{$define noassembler}
+{$endif}
+
 {$IF defined(cpui386) and not defined(noassembler)}
 {$IF defined(cpui386) and not defined(noassembler)}
-  {$DEFINE I386_ASSEMBLER}
+  {$IF defined(linux) or defined(win32) or defined(go32v2) or defined(freebsd) or defined(haiku) or defined(beos)}
+    {$DEFINE I386_ASSEMBLER}
+  {$ENDIF}
 {$ENDIF}
 {$ENDIF}
 
 
 {$IF defined(cpux86_64) and not defined(noassembler)}
 {$IF defined(cpux86_64) and not defined(noassembler)}

+ 1 - 1
packages/ptc/src/core/errori.inc

@@ -100,7 +100,7 @@ begin
   {$IFDEF Win32}
   {$IFDEF Win32}
 //  Win32Cursor_resurrect;
 //  Win32Cursor_resurrect;
   txt := FMessage;
   txt := FMessage;
-  MessageBox(0, PChar(txt), 'Error', MB_OK or MB_ICONERROR or MB_SETFOREGROUND or MB_TOPMOST);
+  MessageBoxA(0, PChar(txt), 'Error', MB_OK or MB_ICONERROR or MB_SETFOREGROUND or MB_TOPMOST);
   {$ENDIF Win32}
   {$ENDIF Win32}
 
 
   {$IFDEF WinCE}
   {$IFDEF WinCE}

+ 13 - 13
packages/ptc/src/win32/base/win32window.inc

@@ -53,7 +53,7 @@ var
   program_instance{, library_instance}: DWord;
   program_instance{, library_instance}: DWord;
   rectangle: RECT;
   rectangle: RECT;
   display_width, display_height: Integer;
   display_width, display_height: Integer;
-  wc: WNDCLASSEX;
+  wc: WNDCLASSEXA;
 begin
 begin
   LOG('creating managed window');
   LOG('creating managed window');
   Defaults;
   Defaults;
@@ -79,7 +79,7 @@ begin
       wc.hCursor := LoadCursor(0, IDC_ARROW)
       wc.hCursor := LoadCursor(0, IDC_ARROW)
     else
     else
       wc.hCursor := 0;
       wc.hCursor := 0;
-    RegisterClassEx(wc);
+    RegisterClassExA(wc);
     with rectangle do
     with rectangle do
     begin
     begin
       left := 0;
       left := 0;
@@ -111,7 +111,7 @@ begin
     end
     end
     else
     else
     begin
     begin
-      FWindow := CreateWindowEx(FExtra, PChar(FName), PChar(FTitle), FStyle, FX, FY, FWidth, FHeight, 0, 0, 0, Self);
+      FWindow := CreateWindowExA(FExtra, PChar(FName), PChar(FTitle), FStyle, FX, FY, FWidth, FHeight, 0, 0, 0, Self);
       if not IsWindow(FWindow) then
       if not IsWindow(FWindow) then
         raise TPTCError.Create('could not create window');
         raise TPTCError.Create('could not create window');
       ShowWindow(FWindow, FShow);
       ShowWindow(FWindow, FShow);
@@ -261,7 +261,7 @@ begin
         if wParam = SC_KEYMENU then
         if wParam = SC_KEYMENU then
 	  Result := 0
 	  Result := 0
 	else
 	else
-          Result := DefWindowProc(hWnd, message, wParam, lParam);
+          Result := DefWindowProcA(hWnd, message, wParam, lParam);
       end;
       end;
     WM_SETCURSOR: begin
     WM_SETCURSOR: begin
       {$WARNING GCLP_HCURSOR not defined in windows unit}
       {$WARNING GCLP_HCURSOR not defined in windows unit}
@@ -271,14 +271,14 @@ begin
 	Result := 1;
 	Result := 1;
       end
       end
       else
       else
-        Result := DefWindowProc(hWnd, message, wParam, lParam);
+        Result := DefWindowProcA(hWnd, message, wParam, lParam);
     end;
     end;
     WM_CLOSE: begin
     WM_CLOSE: begin
       LOG('TWin32Window WM_CLOSE');
       LOG('TWin32Window WM_CLOSE');
       Halt(0);
       Halt(0);
     end;
     end;
     else
     else
-      Result := DefWindowProc(hWnd, message, wParam, lParam);
+      Result := DefWindowProcA(hWnd, message, wParam, lParam);
   end;
   end;
 end;
 end;
 
 
@@ -292,7 +292,7 @@ begin
         if wParam = SC_KEYMENU then
         if wParam = SC_KEYMENU then
 	  Result := 0
 	  Result := 0
 	else
 	else
-          Result := DefWindowProc(hWnd, message, wParam, lParam);
+          Result := DefWindowProcA(hWnd, message, wParam, lParam);
       end;
       end;
     WM_SETCURSOR: begin
     WM_SETCURSOR: begin
       {$WARNING GCLP_HCURSOR not defined in windows unit}
       {$WARNING GCLP_HCURSOR not defined in windows unit}
@@ -302,7 +302,7 @@ begin
 	Result := 1;
 	Result := 1;
       end
       end
       else
       else
-        Result := DefWindowProc(hWnd, message, wParam, lParam);
+        Result := DefWindowProcA(hWnd, message, wParam, lParam);
     end;
     end;
     WM_DESTROY: begin
     WM_DESTROY: begin
       LOG('TWin32Window WM_DESTROY');
       LOG('TWin32Window WM_DESTROY');
@@ -313,7 +313,7 @@ begin
       Halt(0);
       Halt(0);
     end;
     end;
     else
     else
-      Result := DefWindowProc(hWnd, message, wParam, lParam);
+      Result := DefWindowProcA(hWnd, message, wParam, lParam);
   end;
   end;
 end;
 end;
 
 
@@ -369,7 +369,7 @@ begin
     FEvent := 0;
     FEvent := 0;
     FThread := 0;
     FThread := 0;
     FID := 0;
     FID := 0;
-    UnregisterClass(PChar(FName), GetModuleHandle(Nil));
+    UnregisterClassA(PChar(FName), GetModuleHandle(Nil));
   end;
   end;
 end;
 end;
 
 
@@ -379,7 +379,7 @@ var
 begin
 begin
   with AOwner do
   with AOwner do
   begin
   begin
-    FWindow := CreateWindowEx(FExtra, PChar(FName), PChar(FTitle), FStyle, FX, FY, FWidth, FHeight, 0, 0, 0, nil);
+    FWindow := CreateWindowExA(FExtra, PChar(FName), PChar(FTitle), FStyle, FX, FY, FWidth, FHeight, 0, 0, 0, nil);
     if IsWindow(FWindow) then
     if IsWindow(FWindow) then
     begin
     begin
       ShowWindow(FWindow, FShow);
       ShowWindow(FWindow, FShow);
@@ -399,10 +399,10 @@ end;
 
 
 function TWin32Window.WMCreate(hWnd: HWND; uMsg: UINT; wParam: WPARAM; lParam: LPARAM): LRESULT;
 function TWin32Window.WMCreate(hWnd: HWND; uMsg: UINT; wParam: WPARAM; lParam: LPARAM): LRESULT;
 begin
 begin
-  Result := DefWindowProc(hWnd, uMsg, wParam, lParam);
+  Result := DefWindowProcA(hWnd, uMsg, wParam, lParam);
 end;
 end;
 
 
 function TWin32Window.WMDestroy(hWnd: HWND; uMsg: UINT; wParam: WPARAM; lParam: LPARAM): LRESULT;
 function TWin32Window.WMDestroy(hWnd: HWND; uMsg: UINT; wParam: WPARAM; lParam: LPARAM): LRESULT;
 begin
 begin
-  Result := DefWindowProc(hWnd, uMsg, wParam, lParam);
+  Result := DefWindowProcA(hWnd, uMsg, wParam, lParam);
 end;
 end;

+ 0 - 12
packages/ptc/src/win32/gdi/win32modesetteri.inc

@@ -29,18 +29,6 @@
     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 }
 }
 
 
-{$WARNING add these to windows unit}
-const
-  DISP_CHANGE_BADPARAM = -5;
-  DISP_CHANGE_BADDUALVIEW = -6;
-  DM_POSITION = $00000020;
-  DM_NUP = $00000040;
-  DM_PANNINGWIDTH = $08000000;
-  DM_PANNINGHEIGHT = $10000000;
-  DMDFO_DEFAULT = 0;
-  DMDFO_STRETCH = 1;
-  DMDFO_CENTER  = 2;
-
 constructor TWin32ModeSetter.Create;
 constructor TWin32ModeSetter.Create;
 begin
 begin
   SetupModeList;
   SetupModeList;