ソースを参照

* fixed PTCPas compilation with fpc 2.6.2
- rm winapi constants that were already included in fpc 2.6.2
* winapi constants that were included in fpc trunk put behind {$ifdef ver2_6}

git-svn-id: trunk@25775 -

nickysn 11 年 前
コミット
1956ffa3ae

+ 0 - 4
packages/ptc/src/win32/base/win32hook.inc

@@ -30,10 +30,6 @@
     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 }
 
-{$WARNING this has to go to the windows unit}
-const
-  GWLP_WNDPROC = GWL_WNDPROC;
-
 type
   PWin32Hook_Lookup = ^TWin32Hook_Lookup;
   TWin32Hook_Lookup = record

+ 0 - 5
packages/ptc/src/win32/base/win32kbd.inc

@@ -30,11 +30,6 @@
     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 }
 
-{$WARNING this should be in the windows unit}
-const
-  VK_OEM_COMMA = $BC;
-  VK_OEM_PERIOD = $BE;
-
 constructor TWin32Keyboard.Create(AWindow: HWND; AThread: DWord; AMultithreaded: Boolean; AEventQueue: TEventQueue);
 begin
   FMonitor := nil;

+ 10 - 9
packages/ptc/src/win32/base/win32window.inc

@@ -30,6 +30,11 @@
     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 }
 
+{$ifdef VER2_6}
+type
+  WNDCLASSEXA = WNDCLASSEX;
+{$endif VER2_6}
+
 { $R win32\base\ptcres.res}
 
 { bug in the compiler???}
@@ -62,7 +67,7 @@ begin
     FInterceptClose := AInterceptClose;
     program_instance := GetModuleHandle(nil);
 {    library_instance := program_instance;}
-    wc.cbSize := SizeOf(WNDCLASSEX);
+    wc.cbSize := SizeOf(wc);
     wc.hInstance := program_instance;
     wc.lpszClassName := PChar(AWndClass);
     wc.style := AClassStyle;
@@ -136,15 +141,13 @@ procedure TWin32Window.Cursor(AFlag: Boolean);
 begin
   if AFlag then
   begin
-    {$WARNING GCLP_HCURSOR not defined in windows unit}
 //    SetClassLong(FWindow, GCL_HCURSOR, LoadCursor(0, IDC_ARROW));
-    SetClassLongPtr(FWindow, {GCLP_HCURSOR}GCL_HCURSOR, LoadCursor(0, IDC_ARROW));
+    SetClassLongPtr(FWindow, GCLP_HCURSOR, LoadCursor(0, IDC_ARROW));
   end
   else
   begin
-    {$WARNING GCLP_HCURSOR not defined in windows unit}
 //    SetClassLong(FWindow, GCL_HCURSOR, 0);
-    SetClassLongPtr(FWindow, {GCLP_HCURSOR}GCL_HCURSOR, 0);
+    SetClassLongPtr(FWindow, GCLP_HCURSOR, 0);
   end;
   SendMessage(FWindow, WM_SETCURSOR, 0, 0);
 end;
@@ -265,8 +268,7 @@ begin
           Result := DefWindowProcA(hWnd, message, wParam, lParam);
       end;
     WM_SETCURSOR: begin
-      {$WARNING GCLP_HCURSOR not defined in windows unit}
-      if (LOWORD(lParam) = HTCLIENT) and (GetClassLongPtr(hWnd, {GCLP_HCURSOR}GCL_HCURSOR) = 0) then
+      if (LOWORD(lParam) = HTCLIENT) and (GetClassLongPtr(hWnd, GCLP_HCURSOR) = 0) then
       begin
         SetCursor(0);
 	Result := 1;
@@ -300,8 +302,7 @@ begin
           Result := DefWindowProcA(hWnd, message, wParam, lParam);
       end;
     WM_SETCURSOR: begin
-      {$WARNING GCLP_HCURSOR not defined in windows unit}
-      if (LOWORD(lParam) = HTCLIENT) and (GetClassLongPtr(hWnd, {GCLP_HCURSOR}GCL_HCURSOR) = 0) then
+      if (LOWORD(lParam) = HTCLIENT) and (GetClassLongPtr(hWnd, GCLP_HCURSOR) = 0) then
       begin
         SetCursor(0);
 	Result := 1;

+ 0 - 2
packages/ptc/src/win32/directx/p_ddraw.pp

@@ -186,8 +186,6 @@ type
         #define HMONITOR_DECLARED
         DECLARE_HANDLE(HMONITOR);
     #endif}
-    {$WARNING HMONITOR should go to the windows unit}
-    HMONITOR = HANDLE;
 //    typedef BOOL (FAR PASCAL * LPDDENUMCALLBACKEXA)(GUID FAR *, LPSTR, LPSTR, LPVOID, HMONITOR);
     LPDDENUMCALLBACKEXA = function(lpGUID: PGUID; lpDriverDescription: LPSTR; lpDriverName: LPSTR; lpContext: LPVOID; hm: HMONITOR): BOOL; stdcall;
   

+ 3 - 1
packages/ptc/src/win32/gdi/win32openglwindowi.inc

@@ -29,10 +29,12 @@
     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 }
 
-{$WARNING add these to the windows unit}
+{$ifdef VER2_6}
+{ constants moved to the windows unit in fpc trunk }
 const
   PFD_DIRECT3D_ACCELERATED = $00004000;
   PFD_SUPPORT_COMPOSITION = $00008000;
+{$endif VER2_6}
 
 constructor TWin32OpenGLWindow.Create(const AWndClass, ATitle: string; AExtra, AStyle, AClassStyle: DWord;
               AShow, AX, AY, AWidth, AHeight: Integer; ACenter, AMultithreaded, ACursor, AInterceptClose: Boolean;