diff options
author | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-11-30 09:31:28 +0000 |
---|---|---|
committer | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-11-30 09:31:28 +0000 |
commit | bd908a9c3d73c964dd5311ca70baf1d62c83168e (patch) | |
tree | 9a67a2e2419bf357e4dd63ff87001bddf3abf00f /gcc/ada/g-socket.adb | |
parent | f815785447ca40b7a70d7c7dff311f9b14e0e22a (diff) | |
download | gcc-bd908a9c3d73c964dd5311ca70baf1d62c83168e.tar.gz |
2009-11-30 Thomas Quinot <quinot@adacore.com>
* s-commun.adb, s-commun.ads: New internal support unit,
allowing code sharing between GNAT.Sockets and
GNAT.Serial_Communication.
* g-sercom.ads, g-sercom-mingw.adb, g-sercom-linux.adb,
g-socket.adb (GNAT.Sockets.Last_Index): Move to System.Communication.
(GNAT.Serial_Communication.Read): Handle correctly the case where no
data was read, and Buffer'First = Stream_Element_Offset'First.
* Makefile.rtl: Add entry for s-commun
* g-socthi-vms.adb, g-socthi-vms.ads, g-socthi-vxworks.adb,
g-socthi-vxworks.ads, g-stseme.adb, g-socthi-mingw.ads,
g-socthi.adb, g-socthi.ads (GNAT.Sockets.Thin.Socket_Error_Message):
Reimplement in terms of System.CRTL.strerror.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@154758 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/g-socket.adb')
-rw-r--r-- | gcc/ada/g-socket.adb | 27 |
1 files changed, 2 insertions, 25 deletions
diff --git a/gcc/ada/g-socket.adb b/gcc/ada/g-socket.adb index 7741dc0c76d..5cf623a1602 100644 --- a/gcc/ada/g-socket.adb +++ b/gcc/ada/g-socket.adb @@ -46,7 +46,8 @@ with GNAT.Sockets.Linker_Options; pragma Warnings (Off, GNAT.Sockets.Linker_Options); -- Need to include pragma Linker_Options which is platform dependent -with System; use System; +with System; use System; +with System.Communication; use System.Communication; package body GNAT.Sockets is @@ -249,14 +250,6 @@ package body GNAT.Sockets is function Err_Code_Image (E : Integer) return String; -- Return the value of E surrounded with brackets - function Last_Index - (First : Stream_Element_Offset; - Count : C.int) return Stream_Element_Offset; - -- Compute the Last OUT parameter for the various Receive_Socket - -- subprograms: returns First + Count - 1, except for the case - -- where First = Stream_Element_Offset'First and Res = 0, in which - -- case Stream_Element_Offset'Last is returned instead. - procedure Initialize (X : in out Sockets_Library_Controller); procedure Finalize (X : in out Sockets_Library_Controller); @@ -1416,22 +1409,6 @@ package body GNAT.Sockets is and then Is_Socket_In_Set (Item.Set'Access, C.int (Socket)) /= 0; end Is_Set; - ---------------- - -- Last_Index -- - ---------------- - - function Last_Index - (First : Stream_Element_Offset; - Count : C.int) return Stream_Element_Offset - is - begin - if First = Stream_Element_Offset'First and then Count = 0 then - return Stream_Element_Offset'Last; - else - return First + Stream_Element_Offset (Count - 1); - end if; - end Last_Index; - ------------------- -- Listen_Socket -- ------------------- |