* win64 compile fixes

git-svn-id: trunk@3297 -
This commit is contained in:
peter 2006-04-20 11:27:53 +00:00
parent b36e38ead1
commit d98336156f
17 changed files with 197 additions and 187 deletions

View File

@ -15,10 +15,10 @@
program FP; program FP;
{$ifdef IncRes} {$ifdef IncRes}
{$ifdef win32} {$ifdef Windows}
{$R fpw32t.rc} {$R fpw32t.rc}
{$R fpw32ico.rc} {$R fpw32ico.rc}
{$endif win32} {$endif Windows}
{$endif IncRes} {$endif IncRes}
{$I globdir.inc} {$I globdir.inc}
@ -31,9 +31,9 @@ program FP;
uses uses
{$ifndef NODEBUG} {$ifndef NODEBUG}
{$ifdef win32} {$ifdef Windows}
fpcygwin, fpcygwin,
{$endif win32} {$endif Windows}
{$endif NODEBUG} {$endif NODEBUG}
{$ifdef IDEHeapTrc} {$ifdef IDEHeapTrc}
PPheap, PPheap,
@ -298,10 +298,10 @@ BEGIN
writeln('þ Compiler Version '+Version_String); writeln('þ Compiler Version '+Version_String);
{$ifndef NODEBUG} {$ifndef NODEBUG}
writeln('þ GBD Version '+GDBVersion); writeln('þ GBD Version '+GDBVersion);
{$ifdef win32} {$ifdef Windows}
writeln('þ Cygwin "',GetCygwinFullName,'" version ',GetCygwinVersionString); writeln('þ Cygwin "',GetCygwinFullName,'" version ',GetCygwinVersionString);
CheckCygwinVersion; CheckCygwinVersion;
{$endif win32} {$endif Windows}
{$endif NODEBUG} {$endif NODEBUG}
ProcessParams(true); ProcessParams(true);

View File

@ -111,9 +111,11 @@ uses
{$ifdef go32v2} {$ifdef go32v2}
dpmiexcp, dpmiexcp,
{$endif} {$endif}
{$ifdef win32} {$ifdef windows}
signals, {$ifdef HasSignal}
{$endif} signals,
{$endif}
{$endif windows}
FPString,FPUtils,FPConst,WUtils; FPString,FPUtils,FPConst,WUtils;
const const

View File

@ -30,9 +30,13 @@ uses
uses uses
dpmiexcp; dpmiexcp;
{$endif} {$endif}
{$ifdef win32} {$ifdef Windows}
uses uses
windows, signals; windows
{$ifdef HasSignal}
,signals
{$endif}
;
{$endif} {$endif}
{$ifdef HasSignal} {$ifdef HasSignal}
@ -204,16 +208,16 @@ Const
CatchSignalsEnabled : boolean = false; CatchSignalsEnabled : boolean = false;
Procedure EnableCatchSignals; Procedure EnableCatchSignals;
{$ifdef win32} {$ifdef Windows}
var Mode: DWORD; var Mode: DWORD;
{$endif win32} {$endif Windows}
begin begin
if CatchSignalsEnabled then if CatchSignalsEnabled then
exit; exit;
{$ifdef win32} {$ifdef Windows}
if GetConsoleMode(GetStdHandle(cardinal(Std_Input_Handle)), @Mode) then if GetConsoleMode(GetStdHandle(cardinal(Std_Input_Handle)), @Mode) then
SetConsoleMode(GetStdHandle(cardinal(Std_Input_Handle)), (Mode or ENABLE_MOUSE_INPUT) and not ENABLE_PROCESSED_INPUT); SetConsoleMode(GetStdHandle(cardinal(Std_Input_Handle)), (Mode or ENABLE_MOUSE_INPUT) and not ENABLE_PROCESSED_INPUT);
{$endif win32} {$endif Windows}
{$ifdef go32v2} {$ifdef go32v2}
djgpp_set_ctrl_c(false); djgpp_set_ctrl_c(false);
{$endif go32v2} {$endif go32v2}

View File

@ -121,8 +121,10 @@ uses
{$ifdef go32v2} {$ifdef go32v2}
dpmiexcp, dpmiexcp,
{$endif} {$endif}
{$ifdef win32} {$ifdef Windows}
signals, {$ifdef HasSignal}
signals,
{$endif}
{$endif} {$endif}
{ $ifdef HasSignal} { $ifdef HasSignal}
fpcatch, fpcatch,

View File

@ -21,9 +21,9 @@ end.
interface interface
{$i globdir.inc} {$i globdir.inc}
uses uses
{$ifdef win32} {$ifdef Windows}
Windows, Windows,
{$endif win32} {$endif Windows}
Objects,Dialogs,Drivers,Views, Objects,Dialogs,Drivers,Views,
{$ifndef NODEBUG} {$ifndef NODEBUG}
GDBCon,GDBInt, GDBCon,GDBInt,
@ -338,9 +338,9 @@ uses
{$endif DOS} {$endif DOS}
App,Strings, App,Strings,
FVConsts, FVConsts,
{$ifdef win32} {$ifdef Windows}
Windebug, Windebug,
{$endif win32} {$endif Windows}
{$ifdef Unix} {$ifdef Unix}
{$ifdef VER1_0} {$ifdef VER1_0}
Linux, Linux,
@ -468,20 +468,20 @@ begin
{ should we also use / chars ? } { should we also use / chars ? }
for i:=1 to Length(st) do for i:=1 to Length(st) do
if st[i]='\' then if st[i]='\' then
{$ifdef win32} {$ifdef Windows}
{ Don't touch at '\ ' used to escapes spaces in windows file names PM } { Don't touch at '\ ' used to escapes spaces in windows file names PM }
if (i=length(st)) or (st[i+1]<>' ') then if (i=length(st)) or (st[i+1]<>' ') then
{$endif win32} {$endif Windows}
st[i]:='/'; st[i]:='/';
{$ifdef win32} {$ifdef Windows}
{ for win32 we should convert e:\ into //e/ PM } { for Windows we should convert e:\ into //e/ PM }
if (length(st)>2) and (st[2]=':') and (st[3]='/') then if (length(st)>2) and (st[2]=':') and (st[3]='/') then
st:=CygDrivePrefix+'/'+st[1]+copy(st,3,length(st)); st:=CygDrivePrefix+'/'+st[1]+copy(st,3,length(st));
{ support spaces in the name by escaping them but without changing '\ ' into '\\ ' } { support spaces in the name by escaping them but without changing '\ ' into '\\ ' }
for i:=Length(st) downto 1 do for i:=Length(st) downto 1 do
if (st[i]=' ') and ((i=1) or (st[i-1]<>'\')) then if (st[i]=' ') and ((i=1) or (st[i-1]<>'\')) then
st:=copy(st,1,i-1)+'\'+copy(st,i,length(st)); st:=copy(st,1,i-1)+'\'+copy(st,i,length(st));
{$endif win32} {$endif Windows}
{$ifdef go32v2} {$ifdef go32v2}
{ for go32v2 we should convert //e/ back into e:/ PM } { for go32v2 we should convert //e/ back into e:/ PM }
if (length(st)>3) and (st[1]='/') and (st[2]='/') and (st[4]='/') then if (length(st)>3) and (st[1]='/') and (st[2]='/') and (st[4]='/') then
@ -500,13 +500,13 @@ begin
{$ifdef Unix} {$ifdef Unix}
OSFileName:=st; OSFileName:=st;
{$else} {$else}
{$ifdef win32} {$ifdef Windows}
{$ifndef NODEBUG} {$ifndef NODEBUG}
{ for win32 we should convert /cygdrive/e/ into e:\ PM } { for Windows we should convert /cygdrive/e/ into e:\ PM }
if pos(CygDrivePrefix+'/',st)=1 then if pos(CygDrivePrefix+'/',st)=1 then
st:=st[Length(CygdrivePrefix)+2]+':\'+copy(st,length(CygdrivePrefix)+4,length(st)); st:=st[Length(CygdrivePrefix)+2]+':\'+copy(st,length(CygdrivePrefix)+4,length(st));
{$endif NODEBUG} {$endif NODEBUG}
{$endif win32} {$endif Windows}
{ support spaces in the name by escaping them but without changing '\ ' into '\\ ' } { support spaces in the name by escaping them but without changing '\ ' into '\\ ' }
for i:=Length(st) downto 2 do for i:=Length(st) downto 2 do
if (st[i]=' ') and (st[i-1]='\') then if (st[i]=' ') and (st[i-1]='\') then
@ -762,14 +762,14 @@ begin
else else
begin begin
{$endif SUPPORT_REMOTE} {$endif SUPPORT_REMOTE}
{$ifdef win32} {$ifdef Windows}
{ Run the debugge in another console } { Run the debugge in another console }
if DebuggeeTTY<>'' then if DebuggeeTTY<>'' then
Command('set new-console on') Command('set new-console on')
else else
Command('set new-console off'); Command('set new-console off');
NoSwitch:=DebuggeeTTY<>''; NoSwitch:=DebuggeeTTY<>'';
{$endif win32} {$endif Windows}
{$ifdef Unix} {$ifdef Unix}
{ Run the debuggee in another tty } { Run the debuggee in another tty }
if DebuggeeTTY <> '' then if DebuggeeTTY <> '' then
@ -1261,17 +1261,17 @@ begin
end; end;
{ In case we have something that the compiler touched } { In case we have something that the compiler touched }
AskToReloadAllModifiedFiles; AskToReloadAllModifiedFiles;
{$ifdef win32} {$ifdef Windows}
main_pid_valid:=false; main_pid_valid:=false;
{$endif win32} {$endif Windows}
end; end;
procedure TDebugController.DoDebuggerScreen; procedure TDebugController.DoDebuggerScreen;
{$ifdef win32} {$ifdef Windows}
var var
IdeMode : DWord; IdeMode : DWord;
{$endif win32} {$endif Windows}
begin begin
if NoSwitch then if NoSwitch then
begin begin
@ -1283,7 +1283,7 @@ begin
Message(Application,evBroadcast,cmDebuggerStopped,pointer(ptrint(RunCount))); Message(Application,evBroadcast,cmDebuggerStopped,pointer(ptrint(RunCount)));
PopStatus; PopStatus;
end; end;
{$ifdef win32} {$ifdef Windows}
if NoSwitch then if NoSwitch then
begin begin
{ Ctrl-C as normal char } { Ctrl-C as normal char }
@ -1292,16 +1292,16 @@ begin
SetConsoleMode(GetStdHandle(cardinal(Std_Input_Handle)), IdeMode); SetConsoleMode(GetStdHandle(cardinal(Std_Input_Handle)), IdeMode);
end; end;
ChangeDebuggeeWindowTitleTo(Stopped_State); ChangeDebuggeeWindowTitleTo(Stopped_State);
{$endif win32} {$endif Windows}
end; end;
procedure TDebugController.DoUserScreen; procedure TDebugController.DoUserScreen;
{$ifdef win32} {$ifdef Windows}
var var
IdeMode : DWord; IdeMode : DWord;
{$endif win32} {$endif Windows}
begin begin
Inc(RunCount); Inc(RunCount);
if NoSwitch then if NoSwitch then
@ -1321,7 +1321,7 @@ begin
PushStatus(msg_runningprogram); PushStatus(msg_runningprogram);
IDEApp.ShowUserScreen; IDEApp.ShowUserScreen;
end; end;
{$ifdef win32} {$ifdef Windows}
if NoSwitch then if NoSwitch then
begin begin
{ Ctrl-C as interrupt } { Ctrl-C as interrupt }
@ -1330,7 +1330,7 @@ begin
SetConsoleMode(GetStdHandle(cardinal(Std_Input_Handle)), IdeMode); SetConsoleMode(GetStdHandle(cardinal(Std_Input_Handle)), IdeMode);
end; end;
ChangeDebuggeeWindowTitleTo(Running_State); ChangeDebuggeeWindowTitleTo(Running_State);
{$endif win32} {$endif Windows}
end; end;
{$endif NODEBUG} {$endif NODEBUG}

View File

@ -287,9 +287,9 @@ begin
if (StartupOptions and soHeapMonitor)=0 then HeapView^.Hide; if (StartupOptions and soHeapMonitor)=0 then HeapView^.Hide;
Insert(HeapView); Insert(HeapView);
Drivers.ShowMouse; Drivers.ShowMouse;
{$ifdef win32} {$ifdef Windows}
// Win32ShowMouse; // WindowsShowMouse;
{$endif win32} {$endif Windows}
end; end;
procedure TIDEApp.InitDesktop; procedure TIDEApp.InitDesktop;
@ -907,35 +907,35 @@ begin
{$ifndef go32v2} {$ifndef go32v2}
InitScreen; InitScreen;
{$endif ndef go32v2} {$endif ndef go32v2}
{$ifdef win32} {$ifdef Windows}
{ write the empty screen to dummy console handle } { write the empty screen to dummy console handle }
UpdateScreen(true); UpdateScreen(true);
{$endif ndef win32} {$endif ndef Windows}
InitEvents; InitEvents;
InitSysError; InitSysError;
CurDirChanged; CurDirChanged;
{$ifndef win32} {$ifndef Windows}
Message(Application,evBroadcast,cmUpdate,nil); Message(Application,evBroadcast,cmUpdate,nil);
{$endif win32} {$endif Windows}
{$ifdef win32} {$ifdef Windows}
// Win32ShowMouse; // WindowsShowMouse;
{$endif win32} {$endif Windows}
if Assigned(UserScreen) then if Assigned(UserScreen) then
UserScreen^.SwitchBackToIDEScreen; UserScreen^.SwitchBackToIDEScreen;
{$ifdef win32} {$ifdef Windows}
{ This message was sent when the VideoBuffer was smaller { This message was sent when the VideoBuffer was smaller
than was the IdeApp thought => writes to random memory and random crashes... PM } than was the IdeApp thought => writes to random memory and random crashes... PM }
Message(Application,evBroadcast,cmUpdate,nil); Message(Application,evBroadcast,cmUpdate,nil);
{$endif win32} {$endif Windows}
{$ifdef Unix} {$ifdef Unix}
SetKnownKeys; SetKnownKeys;
{$endif Unix} {$endif Unix}
{$ifndef win32} {$ifndef Windows}
{$ifndef go32v2} {$ifndef go32v2}
UpdateScreen(true); UpdateScreen(true);
{$endif go32v2} {$endif go32v2}
{$endif win32} {$endif Windows}
end; end;
function TIDEApp.AutoSave: boolean; function TIDEApp.AutoSave: boolean;

View File

@ -95,7 +95,7 @@ begin
GetDir(DriveNumber,StoreDir2); GetDir(DriveNumber,StoreDir2);
{$ifndef FPC} {$ifndef FPC}
ChDir(Copy(FileDir,1,2)); ChDir(Copy(FileDir,1,2));
{ sets InOutRes in win32 PM } { sets InOutRes in Windows PM }
{$endif not FPC} {$endif not FPC}
end; end;
if (FileDir<>'') and ExistsDir(FileDir) then if (FileDir<>'') and ExistsDir(FileDir) then

View File

@ -435,7 +435,7 @@ begin
LibLinkerSwitches^.SetCurrSel(RB2^.Value); LibLinkerSwitches^.SetCurrSel(RB2^.Value);
OtherLinkerSwitches^.SetBooleanItem(1,CB2^.Mark(0)); OtherLinkerSwitches^.SetBooleanItem(1,CB2^.Mark(0));
if LibLinkerSwitches^.GetCurrSelParam='X' then if LibLinkerSwitches^.GetCurrSelParam='X' then
if CompareText(TargetSwitches^.GetCurrSelParam,'win32')=0 then if CompareText(TargetSwitches^.GetCurrSelParam,'Windows')=0 then
if CompareText(AsmOutputSwitches^.GetCurrSelParam,'pecoff')<>0 then if CompareText(AsmOutputSwitches^.GetCurrSelParam,'pecoff')<>0 then
if ConfirmBox( if ConfirmBox(
FormatStrStr3(msg_xmustbesettoyforz_doyouwanttochangethis, FormatStrStr3(msg_xmustbesettoyforz_doyouwanttochangethis,
@ -453,24 +453,24 @@ var R,R2,R3: TRect;
D: PCenterDialog; D: PCenterDialog;
RB,RB2 : PRadioButtons; RB,RB2 : PRadioButtons;
CBStrip: PCheckBoxes; CBStrip: PCheckBoxes;
{$ifdef win32} {$ifdef Windows}
CB2: PCheckBoxes; CB2: PCheckBoxes;
{$endif win32} {$endif Windows}
{$ifdef Unix} {$ifdef Unix}
IL: PEditorInputLine; IL: PEditorInputLine;
{$endif Unix} {$endif Unix}
L,I: longint; L,I: longint;
Items: PSItem; Items: PSItem;
const const
{$ifdef win32} {$ifdef Windows}
OtherFieldLines = 3; OtherFieldLines = 3;
{$else not win32} {$else not Windows}
{$ifdef Unix} {$ifdef Unix}
OtherFieldLines = 3; OtherFieldLines = 3;
{$else not Unix} {$else not Unix}
OtherFieldLines = 0; OtherFieldLines = 0;
{$endif Unix} {$endif Unix}
{$endif win32} {$endif Windows}
begin begin
R.Assign(0,0,60,2+DebugInfoSwitches^.ItemCount+1+2 R.Assign(0,0,60,2+DebugInfoSwitches^.ItemCount+1+2
+ProfileInfoSwitches^.ItemCount+2+OtherFieldLines); +ProfileInfoSwitches^.ItemCount+2+OtherFieldLines);
@ -510,7 +510,7 @@ begin
R2.Move(0,-1); R2.B.Y:=R2.A.Y+1; R2.Move(0,-1); R2.B.Y:=R2.A.Y+1;
Insert(New(PLabel, Init(R2, label_debugger_profileswitches, RB2))); Insert(New(PLabel, Init(R2, label_debugger_profileswitches, RB2)));
{$ifdef win32} {$ifdef Windows}
R2.Move(0,ProfileInfoSwitches^.ItemCount+3); R2.Move(0,ProfileInfoSwitches^.ItemCount+3);
New(CB2,Init(R2,NewSItem(label_debugger_useanotherconsole, nil))); New(CB2,Init(R2,NewSItem(label_debugger_useanotherconsole, nil)));
Insert(CB2); Insert(CB2);
@ -521,7 +521,7 @@ begin
CB2^.SetData(L); CB2^.SetData(L);
R2.Move(0,-1); R2.Move(0,-1);
Insert(New(PLabel, Init(R2,label_debugger_redirection, CB2))); Insert(New(PLabel, Init(R2,label_debugger_redirection, CB2)));
{$endif win32} {$endif Windows}
{$ifdef Unix} {$ifdef Unix}
R2.Move(0,ProfileInfoSwitches^.ItemCount+3); R2.Move(0,ProfileInfoSwitches^.ItemCount+3);
New(IL, Init(R2, 255)); New(IL, Init(R2, 255));
@ -529,7 +529,7 @@ begin
Insert(IL); Insert(IL);
R2.Move(0,-1); R2.Move(0,-1);
Insert(New(PLabel, Init(R2,label_debugger_useanothertty, IL))); Insert(New(PLabel, Init(R2,label_debugger_useanothertty, IL)));
{$endif win32} {$endif Windows}
end; end;
InsertButtons(D); InsertButtons(D);
RB^.Select; RB^.Select;
@ -538,12 +538,12 @@ begin
DebugInfoSwitches^.SetCurrSel(RB^.Value); DebugInfoSwitches^.SetCurrSel(RB^.Value);
ProfileInfoSwitches^.SetCurrSel(RB2^.Value); ProfileInfoSwitches^.SetCurrSel(RB2^.Value);
OtherLinkerSwitches^.SetBooleanItem(0,CBStrip^.Mark(0)); OtherLinkerSwitches^.SetBooleanItem(0,CBStrip^.Mark(0));
{$ifdef win32} {$ifdef Windows}
if CB2^.value<>0 then if CB2^.value<>0 then
DebuggeeTTY:='on' DebuggeeTTY:='on'
else else
DebuggeeTTY:=''; DebuggeeTTY:='';
{$endif win32} {$endif Windows}
{$ifdef Unix} {$ifdef Unix}
DebuggeeTTY:=IL^.Data^; DebuggeeTTY:=IL^.Data^;
{$endif Unix} {$endif Unix}

View File

@ -33,7 +33,7 @@ Interface
{$ifdef OS2} {$ifdef OS2}
{$define shell_implemented} {$define shell_implemented}
{$endif} {$endif}
{$ifdef Win32} {$ifdef Windows}
{$define implemented} {$define implemented}
{$endif} {$endif}
{$ifdef linux} {$ifdef linux}
@ -96,9 +96,9 @@ Uses
{$ifdef netware_clib} {$ifdef netware_clib}
nwserv, nwserv,
{$endif netware_clib} {$endif netware_clib}
{$ifdef win32} {$ifdef Windows}
windows, windows,
{$endif win32} {$endif Windows}
{$ifdef unix} {$ifdef unix}
{$ifdef ver1_0} {$ifdef ver1_0}
linux, linux,
@ -188,13 +188,13 @@ end;
{$ifdef TP} {$ifdef TP}
{$ifndef win32} {$ifndef Windows}
const const
UnusedHandle = -1; UnusedHandle = -1;
StdInputHandle = 0; StdInputHandle = 0;
StdOutputHandle = 1; StdOutputHandle = 1;
StdErrorHandle = 2; StdErrorHandle = 2;
{$endif win32} {$endif Windows}
Type Type
PtrRec = packed record PtrRec = packed record
@ -282,7 +282,7 @@ end;
{$endif def go32v2} {$endif def go32v2}
{$ifdef win32} {$ifdef Windows}
Function {$ifdef ver1_0}fdclose{$else}fpclose{$endif} (Handle : Longint) : boolean; Function {$ifdef ver1_0}fdclose{$else}fpclose{$endif} (Handle : Longint) : boolean;
begin begin
{ Do we need this ?? } { Do we need this ?? }
@ -394,9 +394,9 @@ function ChangeRedirOut(Const Redir : String; AppendToFile : Boolean) : Boolean;
ChangeRedirOut:=True; ChangeRedirOut:=True;
OutRedirDisabled:=False; OutRedirDisabled:=False;
{$else} {$else}
{$ifdef win32} {$ifdef Windows}
if SetStdHandle(Std_Output_Handle,FileRec(FOUT^).Handle) then if SetStdHandle(Std_Output_Handle,FileRec(FOUT^).Handle) then
{$else not win32} {$else not Windows}
{$ifdef ver1_0} {$ifdef ver1_0}
dup(StdOutputHandle,TempHOut); dup(StdOutputHandle,TempHOut);
dup2(FileRec(FOUT^).Handle,StdOutputHandle); dup2(FileRec(FOUT^).Handle,StdOutputHandle);
@ -406,7 +406,7 @@ function ChangeRedirOut(Const Redir : String; AppendToFile : Boolean) : Boolean;
{$endif} {$endif}
if (TempHOut<>UnusedHandle) and if (TempHOut<>UnusedHandle) and
(StdOutputHandle<>UnusedHandle) then (StdOutputHandle<>UnusedHandle) then
{$endif not win32} {$endif not Windows}
begin begin
ChangeRedirOut:=True; ChangeRedirOut:=True;
OutRedirDisabled:=False; OutRedirDisabled:=False;
@ -432,9 +432,9 @@ function ChangeRedirIn(Const Redir : String) : Boolean;
ChangeRedirIn:=True; ChangeRedirIn:=True;
InRedirDisabled:=False; InRedirDisabled:=False;
{$else} {$else}
{$ifdef win32} {$ifdef Windows}
if SetStdHandle(Std_Input_Handle,FileRec(FIN^).Handle) then if SetStdHandle(Std_Input_Handle,FileRec(FIN^).Handle) then
{$else not win32} {$else not Windows}
{$ifdef ver1_0} {$ifdef ver1_0}
dup(StdInputHandle,TempHIn); dup(StdInputHandle,TempHIn);
dup2(FileRec(FIn^).Handle,StdInputHandle); dup2(FileRec(FIn^).Handle,StdInputHandle);
@ -444,7 +444,7 @@ function ChangeRedirIn(Const Redir : String) : Boolean;
{$endif} {$endif}
if (TempHIn<>UnusedHandle) and if (TempHIn<>UnusedHandle) and
(StdInputHandle<>UnusedHandle) then (StdInputHandle<>UnusedHandle) then
{$endif not win32} {$endif not Windows}
begin begin
ChangeRedirIn:=True; ChangeRedirIn:=True;
InRedirDisabled:=False; InRedirDisabled:=False;
@ -474,9 +474,9 @@ function ChangeRedirError(Const Redir : String; AppendToFile : Boolean) : Boolea
ChangeRedirError:=True; ChangeRedirError:=True;
ErrorRedirDisabled:=False; ErrorRedirDisabled:=False;
{$else} {$else}
{$ifdef win32} {$ifdef Windows}
if SetStdHandle(Std_Error_Handle,FileRec(FERR^).Handle) then if SetStdHandle(Std_Error_Handle,FileRec(FERR^).Handle) then
{$else not win32} {$else not Windows}
{$ifdef ver1_0} {$ifdef ver1_0}
dup(StdErrorHandle,TempHError); dup(StdErrorHandle,TempHError);
dup2(FileRec(FERR^).Handle,StdErrorHandle); dup2(FileRec(FERR^).Handle,StdErrorHandle);
@ -486,7 +486,7 @@ function ChangeRedirError(Const Redir : String; AppendToFile : Boolean) : Boolea
{$endif} {$endif}
if (TempHError<>UnusedHandle) and if (TempHError<>UnusedHandle) and
(StdErrorHandle<>UnusedHandle) then (StdErrorHandle<>UnusedHandle) then
{$endif not win32} {$endif not Windows}
begin begin
ChangeRedirError:=True; ChangeRedirError:=True;
ErrorRedirDisabled:=False; ErrorRedirDisabled:=False;
@ -538,11 +538,11 @@ end;
Handles^[StdOutputHandle]:=OldHandleOut; Handles^[StdOutputHandle]:=OldHandleOut;
OldHandleOut:=StdOutputHandle; OldHandleOut:=StdOutputHandle;
{$else} {$else}
{$ifdef win32} {$ifdef Windows}
SetStdHandle(Std_Output_Handle,StdOutputHandle); SetStdHandle(Std_Output_Handle,StdOutputHandle);
{$else not win32} {$else not Windows}
{$ifdef ver1_0}dup2{$else}fpdup2{$endif}(TempHOut,StdOutputHandle); {$ifdef ver1_0}dup2{$else}fpdup2{$endif}(TempHOut,StdOutputHandle);
{$endif not win32} {$endif not Windows}
{$endif FPC} {$endif FPC}
Close (FOUT^); Close (FOUT^);
{$ifdef ver1_0}fdclose{$else}fpclose{$endif}(TempHOut); {$ifdef ver1_0}fdclose{$else}fpclose{$endif}(TempHOut);
@ -559,11 +559,11 @@ end;
Handles^[StdInputHandle]:=OldHandleIn; Handles^[StdInputHandle]:=OldHandleIn;
OldHandleIn:=StdInputHandle; OldHandleIn:=StdInputHandle;
{$else} {$else}
{$ifdef win32} {$ifdef Windows}
SetStdHandle(Std_Input_Handle,StdInputHandle); SetStdHandle(Std_Input_Handle,StdInputHandle);
{$else not win32} {$else not Windows}
{$ifdef ver1_0}dup2{$else}fpdup2{$endif}(TempHIn,StdInputHandle); {$ifdef ver1_0}dup2{$else}fpdup2{$endif}(TempHIn,StdInputHandle);
{$endif not win32} {$endif not Windows}
{$endif} {$endif}
Close (FIn^); Close (FIn^);
{$ifdef ver1_0}fdclose{$else}fpclose{$endif}(TempHIn); {$ifdef ver1_0}fdclose{$else}fpclose{$endif}(TempHIn);
@ -580,11 +580,11 @@ end;
{$ifndef FPC} {$ifndef FPC}
Handles^[StdInputHandle]:=OldHandleIn; Handles^[StdInputHandle]:=OldHandleIn;
{$else} {$else}
{$ifdef win32} {$ifdef Windows}
SetStdHandle(Std_Input_Handle,StdInputHandle); SetStdHandle(Std_Input_Handle,StdInputHandle);
{$else not win32} {$else not Windows}
{$ifdef ver1_0}dup2{$else}fpdup2{$endif}(TempHIn,StdInputHandle); {$ifdef ver1_0}dup2{$else}fpdup2{$endif}(TempHIn,StdInputHandle);
{$endif not win32} {$endif not Windows}
{$endif} {$endif}
InRedirDisabled:=True; InRedirDisabled:=True;
end; end;
@ -600,11 +600,11 @@ end;
Handles:=Ptr (prefseg, PWord (Ptr (prefseg, $34))^); Handles:=Ptr (prefseg, PWord (Ptr (prefseg, $34))^);
Handles^[StdInputHandle]:=Handles^[FileRec (FIn^).Handle]; Handles^[StdInputHandle]:=Handles^[FileRec (FIn^).Handle];
{$else} {$else}
{$ifdef win32} {$ifdef Windows}
SetStdHandle(Std_Input_Handle,FileRec(FIn^).Handle); SetStdHandle(Std_Input_Handle,FileRec(FIn^).Handle);
{$else not win32} {$else not Windows}
{$ifdef ver1_0}dup2{$else}fpdup2{$endif}(FileRec(FIn^).Handle,StdInputHandle); {$ifdef ver1_0}dup2{$else}fpdup2{$endif}(FileRec(FIn^).Handle,StdInputHandle);
{$endif not win32} {$endif not Windows}
{$endif} {$endif}
InRedirDisabled:=False; InRedirDisabled:=False;
end; end;
@ -619,11 +619,11 @@ end;
{$ifndef FPC} {$ifndef FPC}
Handles^[StdOutputHandle]:=OldHandleOut; Handles^[StdOutputHandle]:=OldHandleOut;
{$else} {$else}
{$ifdef win32} {$ifdef Windows}
SetStdHandle(Std_Output_Handle,StdOutputHandle); SetStdHandle(Std_Output_Handle,StdOutputHandle);
{$else not win32} {$else not Windows}
{$ifdef ver1_0}dup2{$else}fpdup2{$endif}(TempHOut,StdOutputHandle); {$ifdef ver1_0}dup2{$else}fpdup2{$endif}(TempHOut,StdOutputHandle);
{$endif not win32} {$endif not Windows}
{$endif} {$endif}
OutRedirDisabled:=True; OutRedirDisabled:=True;
end; end;
@ -639,11 +639,11 @@ end;
Handles:=Ptr (prefseg, PWord (Ptr (prefseg, $34))^); Handles:=Ptr (prefseg, PWord (Ptr (prefseg, $34))^);
Handles^[StdOutputHandle]:=Handles^[FileRec (FOut^).Handle]; Handles^[StdOutputHandle]:=Handles^[FileRec (FOut^).Handle];
{$else} {$else}
{$ifdef win32} {$ifdef Windows}
SetStdHandle(Std_Output_Handle,FileRec(FOut^).Handle); SetStdHandle(Std_Output_Handle,FileRec(FOut^).Handle);
{$else not win32} {$else not Windows}
{$ifdef ver1_0}dup2{$else}fpdup2{$endif}(FileRec(FOut^).Handle,StdOutputHandle); {$ifdef ver1_0}dup2{$else}fpdup2{$endif}(FileRec(FOut^).Handle,StdOutputHandle);
{$endif not win32} {$endif not Windows}
{$endif} {$endif}
OutRedirDisabled:=False; OutRedirDisabled:=False;
end; end;
@ -658,11 +658,11 @@ end;
Handles^[StdErrorHandle]:=OldHandleError; Handles^[StdErrorHandle]:=OldHandleError;
OldHandleError:=StdErrorHandle; OldHandleError:=StdErrorHandle;
{$else} {$else}
{$ifdef win32} {$ifdef Windows}
SetStdHandle(Std_Error_Handle,StdErrorHandle); SetStdHandle(Std_Error_Handle,StdErrorHandle);
{$else not win32} {$else not Windows}
{$ifdef ver1_0}dup2{$else}fpdup2{$endif}(TempHError,StdErrorHandle); {$ifdef ver1_0}dup2{$else}fpdup2{$endif}(TempHError,StdErrorHandle);
{$endif not win32} {$endif not Windows}
{$endif} {$endif}
Close (FERR^); Close (FERR^);
{$ifdef ver1_0}fdclose{$else}fpclose{$endif}(TempHError); {$ifdef ver1_0}fdclose{$else}fpclose{$endif}(TempHError);
@ -679,11 +679,11 @@ end;
{$ifndef FPC} {$ifndef FPC}
Handles^[StdErrorHandle]:=OldHandleError; Handles^[StdErrorHandle]:=OldHandleError;
{$else} {$else}
{$ifdef win32} {$ifdef Windows}
SetStdHandle(Std_Error_Handle,StdErrorHandle); SetStdHandle(Std_Error_Handle,StdErrorHandle);
{$else not win32} {$else not Windows}
{$ifdef ver1_0}dup2{$else}fpdup2{$endif}(TempHError,StdErrorHandle); {$ifdef ver1_0}dup2{$else}fpdup2{$endif}(TempHError,StdErrorHandle);
{$endif not win32} {$endif not Windows}
{$endif} {$endif}
ErrorRedirDisabled:=True; ErrorRedirDisabled:=True;
end; end;
@ -699,11 +699,11 @@ end;
Handles:=Ptr (prefseg, PWord (Ptr (prefseg, $34))^); Handles:=Ptr (prefseg, PWord (Ptr (prefseg, $34))^);
Handles^[StdErrorHandle]:=Handles^[FileRec (FErr^).Handle]; Handles^[StdErrorHandle]:=Handles^[FileRec (FErr^).Handle];
{$else} {$else}
{$ifdef win32} {$ifdef Windows}
SetStdHandle(Std_Error_Handle,FileRec(FErr^).Handle); SetStdHandle(Std_Error_Handle,FileRec(FErr^).Handle);
{$else not win32} {$else not Windows}
{$ifdef ver1_0}dup2{$else}fpdup2{$endif}(FileRec(FERR^).Handle,StdErrorHandle); {$ifdef ver1_0}dup2{$else}fpdup2{$endif}(FileRec(FERR^).Handle,StdErrorHandle);
{$endif not win32} {$endif not Windows}
{$endif} {$endif}
ErrorRedirDisabled:=False; ErrorRedirDisabled:=False;
end; end;
@ -711,10 +711,10 @@ end;
{............................................................................} {............................................................................}
function ExecuteRedir (Const ProgName, ComLine, RedirStdIn, RedirStdOut, RedirStdErr : String) : boolean; function ExecuteRedir (Const ProgName, ComLine, RedirStdIn, RedirStdOut, RedirStdErr : String) : boolean;
{$ifdef win32} {$ifdef Windows}
var var
mode : word; mode : word;
{$endif win32} {$endif Windows}
Begin Begin
RedirErrorOut:=0; RedirErrorIn:=0; RedirErrorError:=0; RedirErrorOut:=0; RedirErrorIn:=0; RedirErrorError:=0;
ExecuteResult:=0; ExecuteResult:=0;
@ -732,12 +732,12 @@ Begin
ExecuteRedir:=(IOStatus=0) and (RedirErrorOut=0) and ExecuteRedir:=(IOStatus=0) and (RedirErrorOut=0) and
(RedirErrorIn=0) and (RedirErrorError=0) and (RedirErrorIn=0) and (RedirErrorError=0) and
(ExecuteResult=0); (ExecuteResult=0);
{$ifdef win32} {$ifdef Windows}
// reenable mouse events // reenable mouse events
GetConsoleMode(GetStdHandle(cardinal(Std_Input_Handle)), @mode); GetConsoleMode(GetStdHandle(cardinal(Std_Input_Handle)), @mode);
mode:=mode or ENABLE_MOUSE_INPUT; mode:=mode or ENABLE_MOUSE_INPUT;
SetConsoleMode(GetStdHandle(cardinal(Std_Input_Handle)), mode); SetConsoleMode(GetStdHandle(cardinal(Std_Input_Handle)), mode);
{$endif win32} {$endif Windows}
End; End;
{............................................................................} {............................................................................}
@ -948,10 +948,10 @@ end;
{............................................................................} {............................................................................}
procedure DosExecute(ProgName, ComLine : String); procedure DosExecute(ProgName, ComLine : String);
{$ifdef win32} {$ifdef Windows}
var var
StoreInherit : BOOL; StoreInherit : BOOL;
{$endif win32} {$endif Windows}
Begin Begin
{$IfDef MsDos} {$IfDef MsDos}
@ -977,10 +977,10 @@ end;
end; end;
{$endif} {$endif}
{$else} {$else}
{$ifdef win32} {$ifdef Windows}
StoreInherit:=ExecInheritsHandles; StoreInherit:=ExecInheritsHandles;
ExecInheritsHandles:=true; ExecInheritsHandles:=true;
{$endif win32} {$endif Windows}
DosError:=0; DosError:=0;
If UseComSpec then If UseComSpec then
Dos.Exec (Getenv('COMSPEC'),'/C '+MaybeQuoted(FixPath(progname))+' '+Comline) Dos.Exec (Getenv('COMSPEC'),'/C '+MaybeQuoted(FixPath(progname))+' '+Comline)
@ -991,9 +991,9 @@ end;
else else
DosError:=2; DosError:=2;
end; end;
{$ifdef win32} {$ifdef Windows}
ExecInheritsHandles:=StoreInherit; ExecInheritsHandles:=StoreInherit;
{$endif win32} {$endif Windows}
IOStatus:=DosError; IOStatus:=DosError;
ExecuteResult:=DosExitCode; ExecuteResult:=DosExitCode;
{$endif} {$endif}

View File

@ -20,9 +20,9 @@ end.
{$else NODEBUG} {$else NODEBUG}
interface interface
uses uses
{$ifdef win32} {$ifdef Windows}
Windows, Windows,
{$endif win32} {$endif Windows}
Objects,Dialogs,Drivers,Views, Objects,Dialogs,Drivers,Views,
FPViews; FPViews;
@ -342,7 +342,7 @@ Const
rs.esp:=v rs.esp:=v
else if reg='ebp' then else if reg='ebp' then
rs.ebp:=v rs.ebp:=v
{ under win32 flags are on a register named ps !! PM } { under Windows flags are on a register named ps !! PM }
else if (reg='eflags') or (reg='ps') then else if (reg='eflags') or (reg='ps') then
rs.eflags:=v rs.eflags:=v
else if reg='cs' then else if reg='cs' then

View File

@ -18,9 +18,9 @@ unit FPUsrScr;
interface interface
uses uses
{$ifdef win32} {$ifdef Windows}
windows, windows,
{$endif win32} {$endif Windows}
{$ifdef Unix} {$ifdef Unix}
{$ifdef VER1_0} {$ifdef VER1_0}
linux, linux,
@ -194,9 +194,9 @@ type
end; end;
{$endif} {$endif}
{$ifdef win32} {$ifdef Windows}
PWin32Screen = ^TWin32Screen; PWindowsScreen = ^TWindowsScreen;
TWin32Screen = object(TScreen) TWindowsScreen = object(TScreen)
constructor Init; constructor Init;
destructor Done; virtual; destructor Done; virtual;
public public
@ -975,10 +975,10 @@ end;
{$endif} {$endif}
{**************************************************************************** {****************************************************************************
TWin32Screen TWindowsScreen
****************************************************************************} ****************************************************************************}
{$ifdef win32} {$ifdef Windows}
procedure UpdateFileHandles; procedure UpdateFileHandles;
begin begin
@ -990,7 +990,7 @@ begin
{TextRec(StdErr).Handle:=StdErrorHandle;} {TextRec(StdErr).Handle:=StdErrorHandle;}
end; end;
constructor TWin32Screen.Init; constructor TWindowsScreen.Init;
var var
SecurityAttr : Security_attributes; SecurityAttr : Security_attributes;
BigWin : Coord; BigWin : Coord;
@ -1016,9 +1016,9 @@ begin
GetConsoleMode(GetStdHandle(cardinal(Std_Input_Handle)), @ConsoleMode); GetConsoleMode(GetStdHandle(cardinal(Std_Input_Handle)), @ConsoleMode);
IdeMode:=ConsoleMode; IdeMode:=ConsoleMode;
{$ifdef debug} {$ifdef debug}
{define win32bigwin} {define Windowsbigwin}
{$endif debug} {$endif debug}
{$ifdef win32bigwin} {$ifdef Windowsbigwin}
GetConsoleScreenBufferInfo(StartScreenBufferHandle, GetConsoleScreenBufferInfo(StartScreenBufferHandle,
@ConsoleScreenBufferInfo); @ConsoleScreenBufferInfo);
BigWin.X:=ConsoleScreenBufferInfo.dwSize.X; BigWin.X:=ConsoleScreenBufferInfo.dwSize.X;
@ -1030,7 +1030,7 @@ begin
res:=SetConsoleScreenBufferSize(StartScreenBufferHandle,BigWin); res:=SetConsoleScreenBufferSize(StartScreenBufferHandle,BigWin);
if not res then if not res then
error:=GetLastError; error:=GetLastError;
{$endif win32bigwin} {$endif Windowsbigwin}
GetConsoleScreenBufferInfo(StartScreenBufferHandle, GetConsoleScreenBufferInfo(StartScreenBufferHandle,
@ConsoleScreenBufferInfo); @ConsoleScreenBufferInfo);
{ make sure that the IDE Screen Handle has the maximum display size { make sure that the IDE Screen Handle has the maximum display size
@ -1046,7 +1046,7 @@ begin
SwitchBackToIDEScreen; SwitchBackToIDEScreen;
end; end;
destructor TWin32Screen.Done; destructor TWindowsScreen.Done;
begin begin
{ copy the Dos buffer content into the original ScreenBuffer { copy the Dos buffer content into the original ScreenBuffer
which remains the startup std_output_handle PM } which remains the startup std_output_handle PM }
@ -1060,7 +1060,7 @@ begin
inherited Done; inherited Done;
end; end;
function TWin32Screen.GetWidth: integer; function TWindowsScreen.GetWidth: integer;
var var
ConsoleScreenBufferInfo : Console_screen_buffer_info; ConsoleScreenBufferInfo : Console_screen_buffer_info;
begin begin
@ -1069,7 +1069,7 @@ begin
GetWidth:=ConsoleScreenBufferInfo.dwSize.X; GetWidth:=ConsoleScreenBufferInfo.dwSize.X;
end; end;
function TWin32Screen.GetHeight: integer; function TWindowsScreen.GetHeight: integer;
var var
ConsoleScreenBufferInfo : Console_screen_buffer_info; ConsoleScreenBufferInfo : Console_screen_buffer_info;
begin begin
@ -1078,7 +1078,7 @@ begin
GetHeight:=ConsoleScreenBufferInfo.dwSize.Y; GetHeight:=ConsoleScreenBufferInfo.dwSize.Y;
end; end;
function TWin32Screen.CanScroll : boolean; function TWindowsScreen.CanScroll : boolean;
var var
ConsoleScreenBufferInfo : Console_screen_buffer_info; ConsoleScreenBufferInfo : Console_screen_buffer_info;
BufferLines : longint; BufferLines : longint;
@ -1092,7 +1092,7 @@ begin
CanScroll:=(BufferLines>WindowLines); CanScroll:=(BufferLines>WindowLines);
end; end;
function TWin32Screen.Scroll(i : integer) : integer; function TWindowsScreen.Scroll(i : integer) : integer;
var var
ConsoleScreenBufferInfo : Console_screen_buffer_info; ConsoleScreenBufferInfo : Console_screen_buffer_info;
ConsoleWindow : Small_rect; ConsoleWindow : Small_rect;
@ -1116,7 +1116,7 @@ begin
Scroll:=0; Scroll:=0;
end; end;
procedure TWin32Screen.GetLine(Line: integer; var Text, Attr: string); procedure TWindowsScreen.GetLine(Line: integer; var Text, Attr: string);
type type
CharInfoArray = Array [0..255] of Char_Info; CharInfoArray = Array [0..255] of Char_Info;
var var
@ -1153,7 +1153,7 @@ begin
end; end;
procedure TWin32Screen.GetCursorPos(var P: TPoint); procedure TWindowsScreen.GetCursorPos(var P: TPoint);
var var
ConsoleScreenBufferInfo : Console_screen_buffer_info; ConsoleScreenBufferInfo : Console_screen_buffer_info;
begin begin
@ -1163,7 +1163,7 @@ begin
P.Y:=ConsoleScreenBufferInfo.dwCursorPosition.Y; P.Y:=ConsoleScreenBufferInfo.dwCursorPosition.Y;
end; end;
procedure TWin32Screen.BufferCopy(Src, Dest : THandle); procedure TWindowsScreen.BufferCopy(Src, Dest : THandle);
type type
CharInfoArray = Array [0..256*255-1] of Char_Info; CharInfoArray = Array [0..256*255-1] of Char_Info;
var var
@ -1243,7 +1243,7 @@ begin
SetConsoleCursorPosition(Dest, ConsoleScreenBufferInfo.dwCursorPosition); SetConsoleCursorPosition(Dest, ConsoleScreenBufferInfo.dwCursorPosition);
end; end;
procedure TWin32Screen.Capture; procedure TWindowsScreen.Capture;
begin begin
{if StartScreenBufferHandle=IdeScreenBufferHandle then {if StartScreenBufferHandle=IdeScreenBufferHandle then
BufferCopy(IDEScreenBufferHandle,DosScreenBufferHandle) BufferCopy(IDEScreenBufferHandle,DosScreenBufferHandle)
@ -1252,14 +1252,14 @@ begin
SaveConsoleScreen; SaveConsoleScreen;
end; end;
procedure TWin32Screen.Restore; procedure TWindowsScreen.Restore;
begin begin
SwitchToConsoleScreen; SwitchToConsoleScreen;
end; end;
{ dummy for win32 as the Buffer screen { dummy for Windows as the Buffer screen
do hold all the info } do hold all the info }
procedure TWin32Screen.SaveIDEScreen; procedure TWindowsScreen.SaveIDEScreen;
begin begin
IdeScreenMode:=ScreenMode; IdeScreenMode:=ScreenMode;
GetConsoleMode(GetStdHandle(cardinal(Std_Input_Handle)), @IdeMode); GetConsoleMode(GetStdHandle(cardinal(Std_Input_Handle)), @IdeMode);
@ -1268,9 +1268,9 @@ begin
UpdateFileHandles; UpdateFileHandles;
end; end;
{ dummy for win32 as the Buffer screen { dummy for Windows as the Buffer screen
do hold all the info } do hold all the info }
procedure TWin32Screen.SaveConsoleScreen; procedure TWindowsScreen.SaveConsoleScreen;
begin begin
GetConsoleMode(GetStdHandle(cardinal(Std_Input_Handle)), @ConsoleMode); GetConsoleMode(GetStdHandle(cardinal(Std_Input_Handle)), @ConsoleMode);
{ set the dummy buffer as active already now PM } { set the dummy buffer as active already now PM }
@ -1278,7 +1278,7 @@ begin
UpdateFileHandles; UpdateFileHandles;
end; end;
procedure TWin32Screen.SwitchToConsoleScreen; procedure TWindowsScreen.SwitchToConsoleScreen;
begin begin
SetConsoleActiveScreenBuffer(DosScreenBufferHandle); SetConsoleActiveScreenBuffer(DosScreenBufferHandle);
SetStdHandle(cardinal(Std_Output_Handle),DosScreenBufferHandle); SetStdHandle(cardinal(Std_Output_Handle),DosScreenBufferHandle);
@ -1287,7 +1287,7 @@ begin
IDEActive:=false; IDEActive:=false;
end; end;
procedure TWin32Screen.SwitchBackToIDEScreen; procedure TWindowsScreen.SwitchBackToIDEScreen;
var var
ConsoleScreenBufferInfo : Console_screen_buffer_info; ConsoleScreenBufferInfo : Console_screen_buffer_info;
WindowPos : Small_rect; WindowPos : Small_rect;
@ -1480,8 +1480,8 @@ begin
UserScreen:=New(PLinuxScreen, Init); UserScreen:=New(PLinuxScreen, Init);
{$else} {$else}
{$ifdef Win32} {$ifdef Windows}
UserScreen:=New(PWin32Screen, Init); UserScreen:=New(PWindowsScreen, Init);
{$else} {$else}
{$ifdef OS2} {$ifdef OS2}
UserScreen:=New(POS2Screen, Init); UserScreen:=New(POS2Screen, Init);
@ -1492,7 +1492,7 @@ begin
UserScreen:=New(PScreen, Init); UserScreen:=New(PScreen, Init);
{$endif netwlibc} {$endif netwlibc}
{$endif OS2} {$endif OS2}
{$endif Win32} {$endif Windows}
{$endif Unix} {$endif Unix}
{$endif Dos} {$endif Dos}
end; end;

View File

@ -70,11 +70,13 @@
{$define HasSysMsgUnit} {$define HasSysMsgUnit}
{$endif} {$endif}
{$ifdef Win32} {$ifdef Windows}
{$undef SUPPORTVESA} {$undef SUPPORTVESA}
{$define SUPPORTREDIR} {$define SUPPORTREDIR}
{$define WinClipSupported} {$define WinClipSupported}
{$define HasSignal} {$ifdef win32}
{$define HasSignal}
{$endif}
{$define FSCaseInsensitive} {$define FSCaseInsensitive}
{$define HasSysMsgUnit} {$define HasSysMsgUnit}
{$endif} {$endif}

View File

@ -32,9 +32,9 @@ interface
{$ifdef UNIX} {$ifdef UNIX}
TermIos TermIos
{$endif UNIX} {$endif UNIX}
{$ifdef Win32} {$ifdef Windows}
dword dword
{$endif Win32} {$endif Windows}
{$ifdef go32v2} {$ifdef go32v2}
longint longint
{$endif go32v2} {$endif go32v2}
@ -46,19 +46,19 @@ Procedure SaveConsoleMode(var ConsoleMode : TConsoleMode);
Procedure RestoreConsoleMode(const ConsoleMode : TConsoleMode); Procedure RestoreConsoleMode(const ConsoleMode : TConsoleMode);
implementation implementation
{$ifdef Win32} {$ifdef Windows}
uses uses
windows; windows;
{$endif Win32} {$endif Windows}
Procedure SaveConsoleMode(var ConsoleMode : TConsoleMode); Procedure SaveConsoleMode(var ConsoleMode : TConsoleMode);
Begin Begin
{$ifdef UNIX} {$ifdef UNIX}
TCGetAttr(1,ConsoleMode); TCGetAttr(1,ConsoleMode);
{$endif UNIX} {$endif UNIX}
{$ifdef Win32} {$ifdef Windows}
GetConsoleMode(GetStdHandle(STD_INPUT_HANDLE),ConsoleMode); GetConsoleMode(GetStdHandle(STD_INPUT_HANDLE),ConsoleMode);
{$endif Win32} {$endif Windows}
{$ifdef go32v2} {$ifdef go32v2}
ConsoleMode:=0; ConsoleMode:=0;
{$endif go32v2} {$endif go32v2}
@ -72,9 +72,9 @@ Begin
{$ifdef UNIX} {$ifdef UNIX}
TCSetAttr(1,TCSANOW,ConsoleMode); TCSetAttr(1,TCSANOW,ConsoleMode);
{$endif UNIX} {$endif UNIX}
{$ifdef Win32} {$ifdef Windows}
SetConsoleMode(GetStdHandle(STD_INPUT_HANDLE),ConsoleMode); SetConsoleMode(GetStdHandle(STD_INPUT_HANDLE),ConsoleMode);
{$endif Win32} {$endif Windows}
{$ifdef go32v2} {$ifdef go32v2}
{$endif go32v2} {$endif go32v2}
End; End;

View File

@ -18,11 +18,11 @@ unit WHelp;
interface interface
uses uses
{$ifdef Win32} {$ifdef Windows}
{ placed here to avoid TRect to be found in windows unit { placed here to avoid TRect to be found in windows unit
for win32 target whereas its found in objects unit for other targets PM } for Windows target whereas its found in objects unit for other targets PM }
windows, windows,
{$endif Win32} {$endif Windows}
Objects, Objects,
WUtils; WUtils;
@ -318,11 +318,11 @@ Function GetDosTicks:longint; { returns ticks at 18.2 Hz, just like DOS }
{$endif} {$endif}
end; end;
{$endif Unix} {$endif Unix}
{$ifdef Win32} {$ifdef Windows}
begin begin
GetDosTicks:=(Windows.GetTickCount*5484) div 100; GetDosTicks:=(Windows.GetTickCount*5484) div 100;
end; end;
{$endif Win32} {$endif Windows}
{$ifdef go32v2} {$ifdef go32v2}
begin begin
GetDosTicks:=MemL[$40:$6c]; GetDosTicks:=MemL[$40:$6c];

View File

@ -41,10 +41,10 @@ implementation
dos; dos;
{$endif DOS} {$endif DOS}
{$ifdef win32} {$ifdef Windows}
uses uses
strings,windows; strings,windows;
{$endif win32} {$endif Windows}
{$ifdef DOS} {$ifdef DOS}
function WinClipboardSupported : boolean; function WinClipboardSupported : boolean;
@ -94,7 +94,7 @@ begin
end; end;
{$endif DOS} {$endif DOS}
{$ifdef win32} {$ifdef Windows}
function WinClipboardSupported : boolean; function WinClipboardSupported : boolean;
begin begin
WinClipboardSupported:=true; WinClipboardSupported:=true;
@ -127,7 +127,7 @@ begin
else else
InternGetDataSize:=0; InternGetDataSize:=0;
end; end;
{$endif win32} {$endif Windows}
function GetTextWinClipboardSize : longint; function GetTextWinClipboardSize : longint;
@ -143,10 +143,10 @@ var
r : Registers; r : Registers;
M : MemPtr; M : MemPtr;
{$endif DOS} {$endif DOS}
{$ifdef win32} {$ifdef Windows}
h : HGlobal; h : HGlobal;
pp : pchar; pp : pchar;
{$endif win32} {$endif Windows}
begin begin
p:=nil; p:=nil;
GetTextWinClipBoardData:=False; GetTextWinClipBoardData:=False;
@ -169,7 +169,7 @@ begin
RealIntr($2F,r); RealIntr($2F,r);
GetTextWinClipBoardData:=(r.ax<>0); GetTextWinClipBoardData:=(r.ax<>0);
{$endif DOS} {$endif DOS}
{$ifdef win32} {$ifdef Windows}
h:=GetClipboardData(CF_OEMTEXT); h:=GetClipboardData(CF_OEMTEXT);
if h<>0 then if h<>0 then
begin begin
@ -180,7 +180,7 @@ begin
GlobalUnlock(h); GlobalUnlock(h);
end; end;
GetTextWinClipBoardData:=h<>0; GetTextWinClipBoardData:=h<>0;
{$endif win32} {$endif Windows}
CloseWinClipBoard; CloseWinClipBoard;
{$ifdef DOS} {$ifdef DOS}
M.MoveDataFrom(l,P^); M.MoveDataFrom(l,P^);
@ -194,11 +194,11 @@ var
r : Registers; r : Registers;
M : MemPtr; M : MemPtr;
{$endif DOS} {$endif DOS}
{$ifdef win32} {$ifdef Windows}
h : HGlobal; h : HGlobal;
pp : pchar; pp : pchar;
res : boolean; res : boolean;
{$endif win32} {$endif Windows}
begin begin
SetTextWinClipBoardData:=False; SetTextWinClipBoardData:=False;
if (l=0) or (l>65520) then if (l=0) or (l>65520) then
@ -226,7 +226,7 @@ begin
RealIntr($2F,r); RealIntr($2F,r);
FreeDosMem(M); FreeDosMem(M);
{$endif DOS} {$endif DOS}
{$ifdef win32} {$ifdef Windows}
h:=GlobalAlloc(GMEM_MOVEABLE or GMEM_DDESHARE,l+1); h:=GlobalAlloc(GMEM_MOVEABLE or GMEM_DDESHARE,l+1);
pp:=pchar(GlobalLock(h)); pp:=pchar(GlobalLock(h));
move(p^,pp^,l+1); move(p^,pp^,l+1);
@ -238,7 +238,7 @@ begin
SetClipboardData(CF_TEXT,h); SetClipboardData(CF_TEXT,h);
GlobalUnlock(h); GlobalUnlock(h);
SetTextWinClipBoardData:=res; SetTextWinClipBoardData:=res;
{$endif win32} {$endif Windows}
CloseWinClipBoard; CloseWinClipBoard;
end; end;

View File

@ -2,7 +2,7 @@
This file is part of the Free Pascal Integrated Development Environment This file is part of the Free Pascal Integrated Development Environment
Copyright (c) 2000 by Pierre Muller Copyright (c) 2000 by Pierre Muller
Win32 specific debugger routines for the IDE Windows specific debugger routines for the IDE
See the file COPYING.FPC, included in this distribution, See the file COPYING.FPC, included in this distribution,
for details about the copyright. for details about the copyright.

View File

@ -20,9 +20,9 @@ interface
uses uses
{$ifdef win32} {$ifdef Windows}
windows, windows,
{$endif win32} {$endif Windows}
{$ifdef netwlibc} {$ifdef netwlibc}
libc, libc,
{$else} {$else}
@ -628,7 +628,7 @@ begin
end; end;
function GetShortName(const n:string):string; function GetShortName(const n:string):string;
{$ifdef win32} {$ifdef Windows}
var var
hs,hs2 : string; hs,hs2 : string;
i : longint; i : longint;
@ -639,7 +639,7 @@ var
{$endif} {$endif}
begin begin
GetShortName:=n; GetShortName:=n;
{$ifdef win32} {$ifdef Windows}
hs:=n+#0; hs:=n+#0;
i:=Windows.GetShortPathName(@hs[1],@hs2[1],high(hs2)); i:=Windows.GetShortPathName(@hs[1],@hs2[1],high(hs2));
if (i>0) and (i<=high(hs2)) then if (i>0) and (i<=high(hs2)) then
@ -656,7 +656,7 @@ begin
end; end;
function GetLongName(const n:string):string; function GetLongName(const n:string):string;
{$ifdef win32} {$ifdef Windows}
var var
hs : string; hs : string;
hs2 : Array [0..255] of char; hs2 : Array [0..255] of char;
@ -669,7 +669,7 @@ var
{$endif} {$endif}
begin begin
GetLongName:=n; GetLongName:=n;
{$ifdef win32} {$ifdef Windows}
hs:=n+#0; hs:=n+#0;
i:=Windows.GetFullPathName(@hs[1],256,hs2,j); i:=Windows.GetFullPathName(@hs[1],256,hs2,j);
if (i>0) and (i<=high(hs)) then if (i>0) and (i<=high(hs)) then
@ -1345,7 +1345,7 @@ begin
DosSleep (5); DosSleep (5);
end; end;
{$ENDIF} {$ENDIF}
{$ifdef Win32} {$ifdef Windows}
begin begin
{ if the return value of this call is non zero then { if the return value of this call is non zero then
it means that a ReadFileEx or WriteFileEx have completed it means that a ReadFileEx or WriteFileEx have completed