mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-21 18:09:30 +02:00
* compilation for i386-wince was fixed.
* some warnings and DirectoryExists were fixed in sysutils git-svn-id: trunk@1336 -
This commit is contained in:
parent
9a1052e1be
commit
48b75a0608
@ -1,6 +1,6 @@
|
||||
/*
|
||||
Startup code for WinCE port of Free Pascal
|
||||
Written by Yury Sidorov 2005
|
||||
Written by Yury Sidorov, 2005.
|
||||
*/
|
||||
|
||||
.section .text
|
||||
@ -27,6 +27,7 @@ do_start:
|
||||
ldr r1, _PISCONSOLE
|
||||
strb r0,[r1]
|
||||
bl _FPC_EXE_Entry
|
||||
mov r0,#0
|
||||
|
||||
.globl asm_exit
|
||||
asm_exit:
|
||||
|
@ -6,8 +6,8 @@
|
||||
_mainCRTStartup:
|
||||
movb $1,U_SYSTEM_ISCONSOLE
|
||||
call _FPC_EXE_Entry
|
||||
.globl _WinMainCRTStartup
|
||||
_WinMainCRTStartup:
|
||||
.globl __WinMainCRTStartup
|
||||
__WinMainCRTStartup:
|
||||
movb $0,U_SYSTEM_ISCONSOLE
|
||||
call _FPC_EXE_Entry
|
||||
|
||||
|
@ -1,12 +1,16 @@
|
||||
WinCE port
|
||||
==========
|
||||
|
||||
The WinCE port is quite complete and usable. The port was started and maintained by Yury Sidorov. Oliver (Oro06) ported WinCE API headers.
|
||||
WinCE port is quite complete and usable. The port was started and maintained by Yury Sidorov. Oliver (Oro06) ported WinCE API headers.
|
||||
|
||||
Status
|
||||
------
|
||||
* The 2.1.x compiler has compiler support WinCE.
|
||||
* ARM and i386 (old WinCE emulator) CPUs are supported.
|
||||
* The following platforms are supported:
|
||||
* Pocket PC 2002 – WinCE version: 3.0
|
||||
* Pocket PC 2003 – WinCE version: 4.20
|
||||
* Pocket PC 2003 Second Edition – WinCE version: 4.21
|
||||
* Base units are complete.
|
||||
* Windows unit is almost complete. Delphi compatible declarations is not ready.
|
||||
|
||||
@ -15,13 +19,14 @@ Building
|
||||
* You need cross binutils for arm-wince, get them fromftp://ftp.freepascal.org/pub/fpc/contrib/cross/arm-wince-binutils.zip for Win32.
|
||||
* Extract them to some dir in the path on your machine.
|
||||
* Get the 2.1 source repository from SVN: http://www.freepascal.org/develop.html#svn
|
||||
* Go to fpc/compiler and execute make cycle CPU_TARGET=arm OS_TARGET=wince
|
||||
* Go to fpc/compiler and execute:
|
||||
make cycle CPU_TARGET=arm OS_TARGET=wince CROSSBINDIR=<path_to_cross_binutils>
|
||||
|
||||
You should end with the units compiled to fpc/rtl/units/arm-wince and a ppccrossarm.exe in fpc/compiler. Copy them to locations fitting your fpc installation.
|
||||
|
||||
WinCE port notes
|
||||
----------------
|
||||
* chdir always produces an error (WinCE does not support setting of current directory).
|
||||
* chdir procedure always produces an error (WinCE does not support setting of current directory).
|
||||
* All file/dir paths must be absolute (started with \).
|
||||
* WinCE is unicode OS. All string parameters to API calls must be PWideChar.
|
||||
* WinCE does not have support for environment strings.
|
||||
|
@ -97,6 +97,8 @@ function CreateFile(lpFileName:pchar; dwDesiredAccess:DWORD; dwShareMode:DWORD;
|
||||
function CreateDirectory(name : pointer;sec : pointer) : longbool; stdcall;
|
||||
function RemoveDirectory(name:pointer):longbool; stdcall;
|
||||
|
||||
|
||||
{$ifdef CPUARM}
|
||||
{ the external directive isn't really necessary here because it is overriden by external (FK) }
|
||||
|
||||
function addd(d1,d2 : double) : double; compilerproc;
|
||||
@ -177,6 +179,7 @@ function adds(s1,s2 : single) : single; compilerproc;
|
||||
function subs(s1,s2 : single) : single; compilerproc;
|
||||
function muls(s1,s2 : single) : single; compilerproc;
|
||||
function divs(s1,s2 : single) : single; compilerproc;
|
||||
{$endif CPUARM}
|
||||
|
||||
implementation
|
||||
|
||||
@ -209,24 +212,26 @@ begin
|
||||
CompareByte := memcmp(@buf1, @buf2, len);
|
||||
end;
|
||||
|
||||
{$ifdef CPUARM}
|
||||
|
||||
{$define FPC_SYSTEM_HAS_INT}
|
||||
function fpc_int_real(d: double): double;compilerproc;
|
||||
function fpc_int_real(d: ValReal): ValReal;compilerproc;
|
||||
begin
|
||||
fpc_int_real := i64tod(trunc(d));
|
||||
end;
|
||||
|
||||
{$define FPC_SYSTEM_HAS_TRUNC}
|
||||
function fpc_trunc_real(d : double) : int64;compilerproc;
|
||||
function fpc_trunc_real(d : ValReal) : int64;compilerproc;
|
||||
external 'coredll' name '__dtoi64';
|
||||
|
||||
{$define FPC_SYSTEM_HAS_ABS}
|
||||
function fpc_abs_real(d : double) : double;compilerproc;
|
||||
function fpc_abs_real(d : ValReal) : ValReal;compilerproc;
|
||||
external 'coredll' name 'fabs';
|
||||
|
||||
{$define FPC_SYSTEM_HAS_SQRT}
|
||||
function fpc_sqrt_real(d : double) : double;compilerproc;
|
||||
function fpc_sqrt_real(d : ValReal) : ValReal;compilerproc;
|
||||
external 'coredll' name 'sqrt';
|
||||
|
||||
|
||||
function adds(s1,s2 : single) : single;
|
||||
begin
|
||||
adds := addd(s1, s2);
|
||||
@ -247,6 +252,8 @@ begin
|
||||
divs := divd(s1, s2);
|
||||
end;
|
||||
|
||||
{$endif CPUARM}
|
||||
|
||||
{*****************************************************************************}
|
||||
|
||||
{ include system independent routines }
|
||||
|
@ -58,7 +58,7 @@ implementation
|
||||
{ Include platform independent implementation part }
|
||||
{$i sysutils.inc}
|
||||
|
||||
procedure PWideCharToString(const str: PWideChar; var Result: string; strlen: longint = -1);
|
||||
procedure PWideCharToString(const str: PWideChar; out Result: string; strlen: longint = -1);
|
||||
var
|
||||
len: longint;
|
||||
begin
|
||||
@ -93,7 +93,7 @@ var
|
||||
s : widestring;
|
||||
size : dword;
|
||||
rc : dword;
|
||||
p,buf : pwidechar;
|
||||
buf : pwidechar;
|
||||
begin
|
||||
s := ExpandFileName (filename);
|
||||
|
||||
@ -214,13 +214,13 @@ begin
|
||||
end;
|
||||
|
||||
|
||||
Function DosToWinTime (DTime:longint;Var Wtime : TFileTime):longbool;
|
||||
Function DosToWinTime (DTime:longint; out Wtime : TFileTime):longbool;
|
||||
begin
|
||||
DosToWinTime:=False; //!!! fixme
|
||||
end;
|
||||
|
||||
|
||||
Function WinToDosTime (Const Wtime : TFileTime;var DTime:longint):longbool;
|
||||
Function WinToDosTime (Const Wtime : TFileTime; out DTime:longint):longbool;
|
||||
begin
|
||||
WinToDosTime:=False; //!!! fixme
|
||||
end;
|
||||
@ -263,19 +263,16 @@ end;
|
||||
|
||||
Function DirectoryExists (Const Directory : String) : Boolean;
|
||||
var
|
||||
Handle: THandle;
|
||||
FindData: TWin32FindData;
|
||||
Attr:Dword;
|
||||
fn: PWideChar;
|
||||
begin
|
||||
fn:=StringToPWideChar(Directory);
|
||||
Result:=False;
|
||||
Handle := FindFirstFile(PWideChar(widestring(Directory)), FindData);
|
||||
Attr:=GetFileAttributes(fn);
|
||||
FreeMem(fn);
|
||||
If (Handle <> INVALID_HANDLE_VALUE) then
|
||||
begin
|
||||
Result:=((FindData.dwFileAttributes and FILE_ATTRIBUTE_DIRECTORY) = FILE_ATTRIBUTE_DIRECTORY);
|
||||
Windows.FindClose(Handle);
|
||||
end;
|
||||
if Attr <> $ffffffff then
|
||||
Result:= (Attr and FILE_ATTRIBUTE_DIRECTORY) > 0
|
||||
else
|
||||
Result:=False;
|
||||
end;
|
||||
|
||||
|
||||
|
@ -5535,7 +5535,7 @@ Const
|
||||
#endif
|
||||
*)
|
||||
|
||||
{$ifdef _X86_} //+winnt
|
||||
{$ifdef i386} //+winnt
|
||||
|
||||
{ x86 }
|
||||
{ The doc refered me to winnt.h, so I had to look... }
|
||||
@ -5556,7 +5556,7 @@ Const
|
||||
{ our own invention }
|
||||
FLAG_TRACE_BIT = $100;
|
||||
CONTEXT_DEBUGGER = CONTEXT_FULL or CONTEXT_FLOATING_POINT;
|
||||
{$endif _X86_}
|
||||
{$endif i386}
|
||||
|
||||
{$ifdef _MIPS_} //+winnt all block added
|
||||
//
|
||||
|
@ -1118,7 +1118,7 @@
|
||||
TCONSOLESCREENBUFFERINFO = CONSOLE_SCREEN_BUFFER_INFO;
|
||||
PCONSOLESCREENBUFFERINFO = ^CONSOLE_SCREEN_BUFFER_INFO;
|
||||
|
||||
{$ifdef _X86_} //+winnt
|
||||
{$ifdef i386} //+winnt
|
||||
type
|
||||
FLOATING_SAVE_AREA = record //~winnt
|
||||
ControlWord : DWORD;
|
||||
@ -1194,7 +1194,7 @@
|
||||
TLDTENTRY = LDT_ENTRY;
|
||||
PLDTENTRY = ^LDT_ENTRY;
|
||||
|
||||
{$endif _X86_} //+winnt
|
||||
{$endif i386} //+winnt
|
||||
|
||||
{$ifdef _MIPS_} //+winnt all block added
|
||||
//
|
||||
|
Loading…
Reference in New Issue
Block a user