<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-15"
http-equiv="Content-Type">
<title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
Marc Weustink wrote:
<blockquote cite="mid4544C9CA.5000503@dommelstein.net" type="cite">
<pre wrap="">Hi,
</pre>
</blockquote>
hi,<br>
<blockquote cite="mid4544C9CA.5000503@dommelstein.net" type="cite">
<pre wrap="">This patch fixes CE compilation.
I would have applied it myself, but I've some questions about the common
win dir and the wince implementation in the rtl.
</pre>
</blockquote>
you can apply it<br>
<blockquote cite="mid4544C9CA.5000503@dommelstein.net" type="cite">
<pre wrap="">The main fix was changing the definition of TCHAR=Word into a
TCHAR=WideChar for UNICODE
This is declared in both wince/wininc/base.inc and win/wininc/base.inc
I changed them both, since IMO win32/64 would have the same problem if
UNICODE was defined.
At the same time I wondered why there are 2 declarations. Why isn't
wince ising the win definition as well ?
</pre>
</blockquote>
<br>
<blockquote cite="mid4544C9CA.5000503@dommelstein.net" type="cite">
<pre wrap="">Same counts for instance for socket.pp, why are there 2 ?
Further, not related to this fix, but just noticed it, I commented the
declatarion of WCHAR in both base.inc.
AFAICS, WCHAR is defined in systemh and IMO there is no reason to define
it elsewhere again. I guess more cases are present.
Is there a reason for this (other than a leftover form the past) ?
</pre>
</blockquote>
from ealry stage of arm/wince port api fork was decided moslty for 2
reasons :<br>
1- not polluting win32 api with too much ifdefs<br>
2- wince sysgen is not the same for wince and win32 (so even for ms
it's forked)<br>
<br>
now , after one year feedback<br>
the fact is that there not so much differences (few consts and records,
calling convention)<br>
so maybe some cleaning could be done in that way<br>
arm/wince compiler is now running very well, i guess a priorised todo
for next release could be done :)<br>
<br>
<blockquote cite="mid4544C9CA.5000503@dommelstein.net" type="cite">
<pre wrap="">Marc
</pre>
<pre wrap="">
<hr size="4" width="90%">
Index: wince/wininc/base.inc
===================================================================
--- wince/wininc/base.inc (revision 5038)
+++ wince/wininc/base.inc (working copy)
@@ -256,7 +256,7 @@
SIZE_T = Cardinal; //+winnt
{$ifdef UNICODE}
TBYTE = word;
- TCHAR = word;
+ TCHAR = widechar;
BCHAR = word;
{$else}
TBYTE = byte;
@@ -265,7 +265,7 @@
{$endif}
UCHAR = byte; //windef
- WCHAR = WideChar; //winnt
+// WCHAR = WideChar; //winnt
UINT = Cardinal; //windef
ULONG = Cardinal; //windef
Index: wince/sockets.pp
===================================================================
--- wince/sockets.pp (revision 5038)
+++ wince/sockets.pp (working copy)
@@ -284,7 +284,7 @@
Function SocketPair(Domain,SocketType,Protocol:Longint;var Pair:TSockArray):Longint;
begin
- SocketPair:=fpsocketpair(domain,sockettype,protocol,@pair);
+ SocketPair:=fpsocketpair(domain,sockettype,protocol,@pair[1]);
end;
{ mimic the linux fpWrite/fpRead calls for the file/text socket wrapper }
Index: wince/dos.pp
===================================================================
--- wince/dos.pp (revision 5038)
+++ wince/dos.pp (working copy)
@@ -256,7 +256,7 @@
repeat
if fd.dwFileAttributes and dev_attr = dev_attr then begin
len:=0;
- while fd.cFileName[len] <> 0 do
+ while fd.cFileName[len] <> #0 do
Inc(len);
len:=(len + 2)*SizeOf(WideChar);
GetMem(DriveNames[i], len);
Index: wince/sysutils.pp
===================================================================
--- wince/sysutils.pp (revision 5038)
+++ wince/sysutils.pp (working copy)
@@ -290,7 +290,7 @@
WinToDosTime(F.FindData.ftLastWriteTime,F.Time);
f.size:=F.FindData.NFileSizeLow;
f.attr:=F.FindData.dwFileAttributes;
- PWideCharToString(@F.FindData.cFileName, f.Name);
+ PWideCharToString(@F.FindData.cFileName[0], f.Name);
Result:=0;
end;
@@ -631,7 +631,7 @@
nil,
ErrorCode,
0,
- @MsgBuffer, { This function allocs the memory }
+ PWideChar(@MsgBuffer), { This function allocs the memory (in this case you pass a PPwidechar)}
0,
nil);
while (len > 0) and (MsgBuffer[len - 1] <= #32) do
@@ -737,7 +737,7 @@
WinCEMajorVersion:=versionInfo.dwMajorVersion;
WinCEMinorVersion:=versionInfo.dwMinorVersion;
WinCEBuildNumber:=versionInfo.dwBuildNumber;
- i:=WideToAnsiBuf(@versioninfo.szCSDVersion, -1, @WinCECSDVersion[1], SizeOf(WinCECSDVersion) - 1);
+ i:=WideToAnsiBuf(@versioninfo.szCSDVersion[0], -1, @WinCECSDVersion[1], SizeOf(WinCECSDVersion) - 1);
if i <> 0 then
WinCECSDVersion[0]:=chr(i - 1);
end;
Index: win/wininc/base.inc
===================================================================
--- win/wininc/base.inc (revision 5038)
+++ win/wininc/base.inc (working copy)
@@ -243,7 +243,7 @@
{$ifdef UNICODE}
TBYTE = word;
- TCHAR = word;
+ TCHAR = widechar;
BCHAR = word;
{$else}
TBYTE = byte;
@@ -252,7 +252,7 @@
{$endif}
UCHAR = byte;
- WCHAR = WideChar;
+// WCHAR = WideChar;
UINT = cardinal;
ULONG = cardinal;
</pre>
<pre wrap="">
<hr size="4" width="90%">
_______________________________________________
fpc-devel maillist - <a class="moz-txt-link-abbreviated" href="mailto:fpc-devel@lists.freepascal.org">fpc-devel@lists.freepascal.org</a>
<a class="moz-txt-link-freetext" href="http://lists.freepascal.org/mailman/listinfo/fpc-devel">http://lists.freepascal.org/mailman/listinfo/fpc-devel</a>
</pre>
</blockquote>
<br>
</body>
</html>