]> git.ipfire.org Git - thirdparty/gcc.git/commit
ada: Fix LTO type mismatches in GNAT.Sockets.Thin
authorEric Botcazou <ebotcazou@adacore.com>
Tue, 9 Jan 2024 15:25:09 +0000 (16:25 +0100)
committerMarc Poulhiès <poulhies@adacore.com>
Tue, 7 May 2024 07:55:54 +0000 (09:55 +0200)
commitd59f383a90487d081e1754e529a8ed41837767ec
tree568993e580f31985f39c1486fcda49ea8b2aa0f7
parentceaae63a4b4bae36eb2b693ee862f91267dfb62a
ada: Fix LTO type mismatches in GNAT.Sockets.Thin

The default implementation of GNAT.Sockets.Thin is mainly used on Linux and
the socklen_t type used in various routines of the BSD sockets C API is a
typedef for unsigned int there, so importing it as Interface.C.int will be
flagged as a type mismatch during LTO compilation.

gcc/ada/

* libgnat/g-socthi.ads (C_Bind): Turn into inline function.
(C_Getpeername): Likewise.
(C_Getsockname): Likewise.
(C_Getsockopt): Likewise.
(C_Setsockopt): Likewise.
(Nonreentrant_Gethostbyaddr): Likewise.
* libgnat/g-socthi.adb (Syscall_Accept): Adjust profile.
(Syscall_Connect): Likewise.
(Syscall_Recvfrom): Likewise.
(Syscall_Sendto): Likewise.
(C_Bind): New function.
(C_Accept): Adjust to above change for profiles.
(C_Connect): Likewise.
(C_Getpeername): New function.
(C_Getsockname): Likewise.
(C_Getsockopt): Likewise.
(C_Recvfrom):  Adjust to above change for profiles.
(C_Setsockopt): New function.
(Nonreentrant_Gethostbyaddr): Likewise.
gcc/ada/libgnat/g-socthi.adb
gcc/ada/libgnat/g-socthi.ads