> Actually, the real problem is that the Cygwin-targeted version of gnat > shouldn't need those definitions in the first place. Cygwin provides a > fairly complete Linux/Posix feature-set, and doing an end-run around it by > using the underlying winsock API isn't usually a good idea, so I think that > the better solution is to switch over to the standard berksock > implementation.
This sounds fine. > * gcc-interface/Makefile.in (WIN_TARG_SUFFIX): New variable, used by > windows targets only to differentiate between MinGW and Cygwin. > (LIBGNAT_TARGET_PAIRS [windows targets]): Correctly detect cygwin, > which no longer has the '32' suffix, and use WIN_TARG_SUFFIX to choose > appropriate implementations of the sockets and memory packages. Ouch. :-) Please do something like this: # On Cygwin, we use the default version of s-memory and g-socthi because # <insert some (sketch of a) reason here>. ifeq ($(strip $(filter-out cygwin%,$(osys))),) LIBGNAT_TARGET_PAIRS = \ s-memory.adb<s-memory.adb \ g-socthi.ads<g-socthi.ads \ g-socthi.adb<g-socthi.adb else LIBGNAT_TARGET_PAIRS = \ s-memory.adb<s-memory-mingw.adb \ g-socthi.ads<g-socthi-mingw.ads \ g-socthi.adb<g-socthi-mingw.adb endif LIBGNAT_TARGET_PAIRS += \ a-dirval.adb<a-dirval-mingw.adb \ [...] g-soliop.ads<g-soliop-mingw.ads \ $(ATOMICS_TARGET_PAIRS) > * sysdep.c (WIN_SETMODE): New define to choose the correct spelling of > setmode/_setmode for MinGW and Cygwin, respectively. > (__gnat_set_binary_mode [windows targets]): Use the above, and enable > the windows version for Cygwin as well as MinGW. > (__gnat_set_text_mode [windows targets]): Likewise. > (__gnat_ttyname [windows targets]): Provide a Cygwin implementation > in addition to the MinGW version. > (__gnat_is_windows_xp): Make available to Cygwin as well as MinGW. > (__gnat_get_stack_bounds): Likewise. OK with the above change, thanks for fixing this. -- Eric Botcazou