diff options
author | bstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-08-06 15:26:42 +0000 |
---|---|---|
committer | bstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-08-06 15:26:42 +0000 |
commit | 04fa393515487bde6dc2a0bc318398d983825365 (patch) | |
tree | b0c2fbe3bb30a4c2bdfe6c42b5a41adf0f13bdd7 /gcc/ada/g-socket.ads | |
parent | b74be4501645c0e07e4e468058ebfc4b711196c2 (diff) | |
download | gcc-04fa393515487bde6dc2a0bc318398d983825365.tar.gz |
2008-08-06 Basile Starynkevitch <basile@starynkevitch.net>
MELT branch merged with trunk r138800
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/melt-branch@138805 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/g-socket.ads')
-rw-r--r-- | gcc/ada/g-socket.ads | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/gcc/ada/g-socket.ads b/gcc/ada/g-socket.ads index 58255f0880e..5ec84056423 100644 --- a/gcc/ada/g-socket.ads +++ b/gcc/ada/g-socket.ads @@ -52,6 +52,8 @@ with Ada.Exceptions; with Ada.Streams; with Ada.Unchecked_Deallocation; +with System.OS_Constants; + package GNAT.Sockets is -- Sockets are designed to provide a consistent communication facility @@ -367,6 +369,12 @@ package GNAT.Sockets is -- Finalize; -- end PingPong; + package Constants renames System.OS_Constants; + -- Renaming used to provide short-hand notations thoughout the sockets + -- binding. Note that System.OS_Constants is an internal unit, and the + -- entities declared therein are not meant for direct access by users, + -- including through this renaming. + procedure Initialize; -- Initialize must be called before using any other socket routines. -- Note that this operation is a no-op on UNIX platforms, but applications @@ -404,9 +412,12 @@ package GNAT.Sockets is -- structure. Moreover, negative values are not allowed to avoid system -- incompatibilities. - Immediate : constant := 0.0; - Forever : constant := Duration (Integer'Last) * 1.0; - -- Should be Duration 2 ** (Constants.SIZEOF_tv_sec * 8 - 1) - 1 ??? + Immediate : constant Duration := 0.0; + + Timeval_Forever : constant := + 2.0 ** (Constants.SIZEOF_tv_sec * 8 - 1) - 1.0; + Forever : constant Duration := + Duration'Min (Duration'Last, Timeval_Forever); subtype Timeval_Duration is Duration range Immediate .. Forever; |