diff options
author | Dmitriy Anisimkov <anisimko@adacore.com> | 2020-08-08 18:49:27 +0600 |
---|---|---|
committer | Pierre-Marie de Rodat <derodat@adacore.com> | 2020-10-23 04:25:07 -0400 |
commit | d08d481912b9a2dc3388f8e1183cea0bf3ffae9f (patch) | |
tree | 22e513c76801fa433fcc0445892f3b47d4c7a0bf /gcc/ada/Makefile.rtl | |
parent | 66e97274cef35ed40584c7a09096fffa061fddf0 (diff) | |
download | gcc-d08d481912b9a2dc3388f8e1183cea0bf3ffae9f.tar.gz |
[Ada] Sockets.Poll implementation
gcc/ada/
* Makefile.rtl (GNATRTL_SOCKETS_OBJS): New object
g-socpol$(objext) New source files noted: g-socpol.adb,
g-socpol.ads, g-socpol__dummy.adb, g-socpol__dummy.ads,
g-sopowa.adb, g-sopowa__posix.adb, g-sopowa__mingw.adb,
g-spogwa.adb, g-spogwa.ads.
* impunit.adb (Non_Imp_File_Names_95): New base filename
g-socpol in "GNAT Library Units" section for GNAT.Sockets.Poll
unit.
* libgnat/g-socket.ads, libgnat/g-socket.adb:
(Raise_Socket_Error): Moved from body to private part of
specification to use in GNAT.Sockets.Poll.
* libgnat/g-socpol.ads, libgnat/g-socpol.adb: Main unit of the
implementation.
* libgnat/g-socpol__dummy.ads, libgnat/g-socpol__dummy.adb:
Empty unit for the systems without sockets support.
* libgnat/g-spogwa.ads, libgnat/g-spogwa.adb: Generic unit
implementing sockets poll on top of select system call.
* libgnat/g-sopowa.adb (Wait): Separate implementation for
operation systems with poll system call support.
* libgnat/g-sopowa__posix.adb (Wait): Separate implementation
for POSIX select system call.
* libgnat/g-sopowa__mingw.adb (Wait): Separate implementation
for Windows select system call.
* gsocket.h (_WIN32_WINNT): Increase to 0x0600 for winsock2.h to
allow WSAPoll related definitions.
* s-oscons-tmplt.c: Fix comment next to #endif for
#if defined (__linux__) || defined (__ANDROID__) line. Include
<poll.h> for all except VxWorks and Windows.
(SIZEOF_nfds_t): New definition.
(SIZEOF_fd_type): New definition.
(SIZEOF_pollfd_events): New definition.
(POLLIN, POLLPRI, POLLOUT, POLLERR, POLLHUP, POLLNVAL): New
definitions for VxWorks to be able to emulate poll on top of
select in it. Define POLLPRI as zero on Windows as it is not
supported there.
(Poll_Linkname): New definition, because the poll system call
has different name in Windows and POSIX.
Diffstat (limited to 'gcc/ada/Makefile.rtl')
-rw-r--r-- | gcc/ada/Makefile.rtl | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/gcc/ada/Makefile.rtl b/gcc/ada/Makefile.rtl index 7a0c05b423d..ac222cb1b80 100644 --- a/gcc/ada/Makefile.rtl +++ b/gcc/ada/Makefile.rtl @@ -820,7 +820,7 @@ GNATLIB_SHARED = gnatlib # to LIBGNAT_TARGET_PAIRS. GNATRTL_SOCKETS_OBJS = g-soccon$(objext) g-socket$(objext) g-socthi$(objext) \ - g-soliop$(objext) g-sothco$(objext) + g-soliop$(objext) g-sothco$(objext) g-socpol$(objext) DUMMY_SOCKETS_TARGET_PAIRS = \ g-socket.adb<libgnat/g-socket__dummy.adb \ @@ -828,7 +828,9 @@ DUMMY_SOCKETS_TARGET_PAIRS = \ g-socthi.adb<libgnat/g-socthi__dummy.adb \ g-socthi.ads<libgnat/g-socthi__dummy.ads \ g-sothco.adb<libgnat/g-sothco__dummy.adb \ - g-sothco.ads<libgnat/g-sothco__dummy.ads + g-sothco.ads<libgnat/g-sothco__dummy.ads \ + g-socpol.adb<libgnat/g-socpol__dummy.adb \ + g-socpol.ads<libgnat/g-socpol__dummy.ads # On platforms where atomic increment/decrement operations are supported, # special version of Ada.Strings.Unbounded package can be used. @@ -1043,6 +1045,7 @@ ifeq ($(strip $(filter-out powerpc% wrs vxworks vxworksspe vxworks7% vxworks7spe s-vxwork.ads<libgnarl/s-vxwork__ppc.ads \ g-socthi.ads<libgnat/g-socthi__vxworks.ads \ g-socthi.adb<libgnat/g-socthi__vxworks.adb \ + g-sopowa.adb<libgnat/g-sopowa__posix.adb \ g-stsifd.adb<libgnat/g-stsifd__sockets.adb \ $(ATOMICS_TARGET_PAIRS) \ $(ATOMICS_BUILTINS_TARGET_PAIRS) @@ -1203,6 +1206,7 @@ ifeq ($(strip $(filter-out powerpc% wrs vxworksae vxworksaespe,$(target_cpu) $(t LIBGNAT_TARGET_PAIRS += \ g-socthi.ads<libgnat/g-socthi__vxworks.ads \ g-socthi.adb<libgnat/g-socthi__vxworks.adb \ + g-sopowa.adb<libgnat/g-sopowa__posix.adb \ g-stsifd.adb<libgnat/g-stsifd__sockets.adb endif @@ -1261,6 +1265,7 @@ ifeq ($(strip $(filter-out %86 wrs vxworksae,$(target_cpu) $(target_vendor) $(ta LIBGNAT_TARGET_PAIRS += \ g-socthi.ads<libgnat/g-socthi__vxworks.ads \ g-socthi.adb<libgnat/g-socthi__vxworks.adb \ + g-sopowa.adb<libgnat/g-sopowa__posix.adb \ g-stsifd.adb<libgnat/g-stsifd__sockets.adb endif @@ -1291,6 +1296,7 @@ ifeq ($(strip $(filter-out %86 x86_64 wrs vxworks vxworks7%,$(target_cpu) $(targ s-vxwork.ads<libgnarl/s-vxwork__x86.ads \ g-socthi.ads<libgnat/g-socthi__vxworks.ads \ g-socthi.adb<libgnat/g-socthi__vxworks.adb \ + g-sopowa.adb<libgnat/g-sopowa__posix.adb \ g-stsifd.adb<libgnat/g-stsifd__sockets.adb \ $(ATOMICS_TARGET_PAIRS) @@ -1435,6 +1441,7 @@ ifeq ($(strip $(filter-out aarch64 arm% coff wrs vx%,$(target_cpu) $(target_vend s-taspri.ads<libgnarl/s-taspri__vxworks.ads \ g-socthi.ads<libgnat/g-socthi__vxworks.ads \ g-socthi.adb<libgnat/g-socthi__vxworks.adb \ + g-sopowa.adb<libgnat/g-sopowa__posix.adb \ g-stsifd.adb<libgnat/g-stsifd__sockets.adb ifeq ($(strip $(filter-out aarch64, $(target_cpu))),) @@ -2166,7 +2173,8 @@ ifeq ($(strip $(filter-out cygwin% mingw32% pe,$(target_os))),) else LIBGNAT_TARGET_PAIRS = \ g-socthi.ads<libgnat/g-socthi__mingw.ads \ - g-socthi.adb<libgnat/g-socthi__mingw.adb + g-socthi.adb<libgnat/g-socthi__mingw.adb \ + g-sopowa.adb<libgnat/g-sopowa__mingw.adb endif LIBGNAT_TARGET_PAIRS += \ a-dirval.adb<libgnat/a-dirval__mingw.adb \ |