Hi,
Attached is a partial patch for 'utils/debugsvr/debugserverintf.pp'
unit. This unit is cannot be compiled at the moment, but the attached
patch at least removes many of the compiler errors.
There are still 5 remaining compiler errors that I am not sure about
how to fix. Can anybody help with these?
I tried with FPC 2.4.0-rc1 and FPC 2.5.1 and neither version of
debugserverintf.pp seems to compile.
-------------------------------
/opt/fpc_2.3.1/src/utils/debugsvr/debugserverintf.pp(30,13) Hint: Type
"Thandle" redefinition
/opt/fpc_2.3.1/src/utils/debugsvr/debugserverintf.pp(122,3) Warning:
Symbol "Str2UnixSockAddr" is deprecated
/opt/fpc_2.3.1/src/utils/debugsvr/debugserverintf.pp(122,47) Hint:
Local variable "AddrLen" does not seem to be initialized
/opt/fpc_2.3.1/src/utils/debugsvr/debugserverintf.pp(122,39) Hint:
Local variable "FUnixAddr" does not seem to be initialized
/opt/fpc_2.3.1/src/utils/debugsvr/debugserverintf.pp(123,34) Error:
Incompatible type for arg no. 2: Got "TUnixSockAddr", expected
"psockaddr"
/opt/fpc_2.3.1/src/utils/debugsvr/debugserverintf.pp(125,6) Error:
Boolean expression expected, but got "LongInt"
/opt/fpc_2.3.1/src/utils/debugsvr/debugserverintf.pp(175,34) Error:
Incompatible type for arg no. 2: Got "sockaddr_in", expected
"psockaddr"
/opt/fpc_2.3.1/src/utils/debugsvr/debugserverintf.pp(176,48) Warning:
Local variable "FFileName" does not seem to be initialized
/opt/fpc_2.3.1/src/utils/debugsvr/debugserverintf.pp(177,6) Error:
Boolean expression expected, but got "LongInt"
/opt/fpc_2.3.1/src/utils/debugsvr/debugserverintf.pp(244,42) Error:
Incompatible type for arg no. 3: Got "LongInt", expected "pSockLen"
/opt/fpc_2.3.1/src/utils/debugsvr/debugserverintf.pp(344,10) Hint:
Local variable "FDebugMessage" does not seem to be initialized
/opt/fpc_2.3.1/src/utils/debugsvr/debugserverintf.pp(358,32) Hint:
Local variable "msgSize" does not seem to be initialized
/opt/fpc_2.3.1/src/utils/debugsvr/debugserverintf.pp(376,32) Hint:
Local variable "Event" does not seem to be initialized
/opt/fpc_2.3.1/src/utils/debugsvr/debugserverintf.pp(381) Fatal: There
were 5 errors compiling module, stopping
-------------------------------
--
Regards,
- Graeme -
_______________________________________________
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/
diff --git a/utils/debugsvr/debugserverintf.pp b/utils/debugsvr/debugserverintf.pp
index eedab02..76778d4 100644
--- a/utils/debugsvr/debugserverintf.pp
+++ b/utils/debugsvr/debugserverintf.pp
@@ -113,16 +113,16 @@ var
begin
FFileName:=DebugSocket;
- FSocket:=Socket(AF_UNIX,SOCK_STREAM,0);
+ FSocket:=fpSocket(AF_UNIX,SOCK_STREAM,0);
If FSocket<0 Then
Raise Exception.Create(SErrSocketFailed);
Flags:=fpFCntl(FSOCket,F_GETFL);
Flags:=Flags or O_NONBLOCK;
fpFCntl(FSocket,F_SETFL,Flags);
Str2UnixSockAddr(FFilename,FUnixAddr,AddrLen);
- If Not Bind(FSocket,FUnixAddr,AddrLen) then
+ If Not fpBind(FSocket,FUnixAddr,AddrLen) then
Raise Exception.CreateFmt(SErrBindFailed,[FFileName]);
- If Not (Listen(FSocket,5)) then
+ If Not (fpListen(FSocket,5)) then
Raise Exception.CreateFmt(SErrListenFailed,[FSocket]);
FClients:=TList.Create;
Accepting:=True;
@@ -162,7 +162,7 @@ var
Quit : Boolean;
begin
- FSocket:=Socket(AF_INET,SOCK_STREAM,0);
+ FSocket:=fpSocket(AF_INET,SOCK_STREAM,0);
If FSocket<0 Then
Raise Exception.Create(SErrSocketFailed);
Flags:=fpFCntl(FSocket,F_GETFL);
@@ -172,9 +172,9 @@ begin
Writeln('Using port : ',APort);
FInetAddr.Port := Swap(APort);
FInetAddr.Addr := 0;
- If Not Bind(FSocket,FInetAddr,SizeOf(FInetAddr)) then
+ If Not fpBind(FSocket,FInetAddr,SizeOf(FInetAddr)) then
Raise Exception.CreateFmt(SErrBindFailed,[FFileName]);
- If Not (Listen(FSocket,5)) then
+ If Not (fpListen(FSocket,5)) then
Raise Exception.CreateFmt(SErrListenFailed,[FSocket]);
end;
@@ -241,7 +241,7 @@ begin
If Accepting then
begin
L:=SizeOf(ClientAddr);
- Result:=Accept(FSocket,ClientAddr,L);
+ Result:=fpAccept(FSocket,ClientAddr,L);
If (Result<0) Then
if (Errno<>ESYSEAgain) then
Raise Exception.CreateFmt(SErrAcceptFailed,[FSocket])
@@ -280,7 +280,7 @@ end;
Procedure CloseClientHandle(Handle : THandle);
begin
- ShutDown(Handle,2);
+ fpShutDown(Handle,2);
FileClose(Handle);
end;
_______________________________________________
fpc-devel maillist - [email protected]
http://lists.freepascal.org/mailman/listinfo/fpc-devel