diff --git a/Makefile.in b/Makefile.in index 0420f0d4ed..73c7cfbeb5 100644 --- a/Makefile.in +++ b/Makefile.in @@ -743,16 +743,17 @@ ALL_BASE_SOURCES = \ src/common/zstream.cpp \ src/common/fdiodispatcher.cpp \ src/common/selectdispatcher.cpp \ - src/unix/epolldispatcher.cpp \ src/unix/appunix.cpp \ - src/unix/evtloopunix.cpp \ src/unix/dir.cpp \ src/unix/dlunix.cpp \ + src/unix/epolldispatcher.cpp \ + src/unix/evtloopunix.cpp \ + src/unix/fdiounix.cpp \ src/unix/snglinst.cpp \ + src/unix/stackwalk.cpp \ src/unix/stdpaths.cpp \ src/unix/timerunx.cpp \ src/unix/threadpsx.cpp \ - src/unix/stackwalk.cpp \ src/unix/utilsunx.cpp \ src/unix/mimetype.cpp \ src/msw/basemsw.cpp \ @@ -1954,16 +1955,17 @@ COND_USE_STC_1___wxscintilla___depname = \ COND_TOOLKIT__BASE_OSX_SRC = \ src/common/fdiodispatcher.cpp \ src/common/selectdispatcher.cpp \ - src/unix/epolldispatcher.cpp \ src/unix/appunix.cpp \ - src/unix/evtloopunix.cpp \ src/unix/dir.cpp \ src/unix/dlunix.cpp \ + src/unix/epolldispatcher.cpp \ + src/unix/evtloopunix.cpp \ + src/unix/fdiounix.cpp \ src/unix/snglinst.cpp \ + src/unix/stackwalk.cpp \ src/unix/stdpaths.cpp \ src/unix/timerunx.cpp \ src/unix/threadpsx.cpp \ - src/unix/stackwalk.cpp \ src/unix/utilsunx.cpp \ src/unix/mimetype.cpp \ src/osx/core/cfstring.cpp \ @@ -1974,16 +1976,17 @@ COND_TOOLKIT__BASE_OSX_SRC = \ COND_TOOLKIT_COCOA_BASE_OSX_SRC = \ src/common/fdiodispatcher.cpp \ src/common/selectdispatcher.cpp \ - src/unix/epolldispatcher.cpp \ src/unix/appunix.cpp \ - src/unix/evtloopunix.cpp \ src/unix/dir.cpp \ src/unix/dlunix.cpp \ + src/unix/epolldispatcher.cpp \ + src/unix/evtloopunix.cpp \ + src/unix/fdiounix.cpp \ src/unix/snglinst.cpp \ + src/unix/stackwalk.cpp \ src/unix/stdpaths.cpp \ src/unix/timerunx.cpp \ src/unix/threadpsx.cpp \ - src/unix/stackwalk.cpp \ src/unix/utilsunx.cpp \ src/unix/mimetype.cpp \ src/osx/core/cfstring.cpp \ @@ -1994,16 +1997,17 @@ COND_TOOLKIT_COCOA_BASE_OSX_SRC = \ COND_TOOLKIT_GTK_BASE_OSX_SRC = \ src/common/fdiodispatcher.cpp \ src/common/selectdispatcher.cpp \ - src/unix/epolldispatcher.cpp \ src/unix/appunix.cpp \ - src/unix/evtloopunix.cpp \ src/unix/dir.cpp \ src/unix/dlunix.cpp \ + src/unix/epolldispatcher.cpp \ + src/unix/evtloopunix.cpp \ + src/unix/fdiounix.cpp \ src/unix/snglinst.cpp \ + src/unix/stackwalk.cpp \ src/unix/stdpaths.cpp \ src/unix/timerunx.cpp \ src/unix/threadpsx.cpp \ - src/unix/stackwalk.cpp \ src/unix/utilsunx.cpp \ src/unix/mimetype.cpp \ src/osx/core/cfstring.cpp \ @@ -2014,16 +2018,17 @@ COND_TOOLKIT_GTK_BASE_OSX_SRC = \ COND_TOOLKIT_MOTIF_BASE_OSX_SRC = \ src/common/fdiodispatcher.cpp \ src/common/selectdispatcher.cpp \ - src/unix/epolldispatcher.cpp \ src/unix/appunix.cpp \ - src/unix/evtloopunix.cpp \ src/unix/dir.cpp \ src/unix/dlunix.cpp \ + src/unix/epolldispatcher.cpp \ + src/unix/evtloopunix.cpp \ + src/unix/fdiounix.cpp \ src/unix/snglinst.cpp \ + src/unix/stackwalk.cpp \ src/unix/stdpaths.cpp \ src/unix/timerunx.cpp \ src/unix/threadpsx.cpp \ - src/unix/stackwalk.cpp \ src/unix/utilsunx.cpp \ src/unix/mimetype.cpp \ src/osx/core/cfstring.cpp \ @@ -2039,16 +2044,17 @@ COND_TOOLKIT_OSX_CARBON_BASE_OSX_SRC = \ src/osx/core/utilsexc_base.cpp \ src/common/fdiodispatcher.cpp \ src/common/selectdispatcher.cpp \ - src/unix/epolldispatcher.cpp \ src/unix/appunix.cpp \ - src/unix/evtloopunix.cpp \ src/unix/dir.cpp \ src/unix/dlunix.cpp \ + src/unix/epolldispatcher.cpp \ + src/unix/evtloopunix.cpp \ + src/unix/fdiounix.cpp \ src/unix/snglinst.cpp \ + src/unix/stackwalk.cpp \ src/unix/stdpaths.cpp \ src/unix/timerunx.cpp \ src/unix/threadpsx.cpp \ - src/unix/stackwalk.cpp \ src/unix/utilsunx.cpp @COND_TOOLKIT_OSX_CARBON@BASE_OSX_SRC = $(COND_TOOLKIT_OSX_CARBON_BASE_OSX_SRC) COND_TOOLKIT_OSX_COCOA_BASE_OSX_SRC = \ @@ -2059,31 +2065,33 @@ COND_TOOLKIT_OSX_COCOA_BASE_OSX_SRC = \ src/osx/core/utilsexc_base.cpp \ src/common/fdiodispatcher.cpp \ src/common/selectdispatcher.cpp \ - src/unix/epolldispatcher.cpp \ src/unix/appunix.cpp \ - src/unix/evtloopunix.cpp \ src/unix/dir.cpp \ src/unix/dlunix.cpp \ + src/unix/epolldispatcher.cpp \ + src/unix/evtloopunix.cpp \ + src/unix/fdiounix.cpp \ src/unix/snglinst.cpp \ + src/unix/stackwalk.cpp \ src/unix/stdpaths.cpp \ src/unix/timerunx.cpp \ src/unix/threadpsx.cpp \ - src/unix/stackwalk.cpp \ src/unix/utilsunx.cpp @COND_TOOLKIT_OSX_COCOA@BASE_OSX_SRC = $(COND_TOOLKIT_OSX_COCOA_BASE_OSX_SRC) COND_TOOLKIT_X11_BASE_OSX_SRC = \ src/common/fdiodispatcher.cpp \ src/common/selectdispatcher.cpp \ - src/unix/epolldispatcher.cpp \ src/unix/appunix.cpp \ - src/unix/evtloopunix.cpp \ src/unix/dir.cpp \ src/unix/dlunix.cpp \ + src/unix/epolldispatcher.cpp \ + src/unix/evtloopunix.cpp \ + src/unix/fdiounix.cpp \ src/unix/snglinst.cpp \ + src/unix/stackwalk.cpp \ src/unix/stdpaths.cpp \ src/unix/timerunx.cpp \ src/unix/threadpsx.cpp \ - src/unix/stackwalk.cpp \ src/unix/utilsunx.cpp \ src/unix/mimetype.cpp \ src/osx/core/cfstring.cpp \ @@ -3835,16 +3843,17 @@ COND_PLATFORM_MACOSX_1___BASE_PLATFORM_SRC_OBJECTS = \ monodll_utilsexc_base.o \ monodll_fdiodispatcher.o \ monodll_selectdispatcher.o \ - monodll_epolldispatcher.o \ monodll_appunix.o \ - monodll_evtloopunix.o \ monodll_unix_dir.o \ monodll_dlunix.o \ + monodll_epolldispatcher.o \ + monodll_evtloopunix.o \ + monodll_fdiounix.o \ monodll_unix_snglinst.o \ + monodll_unix_stackwalk.o \ monodll_unix_stdpaths.o \ monodll_timerunx.o \ monodll_threadpsx.o \ - monodll_unix_stackwalk.o \ monodll_utilsunx.o @COND_PLATFORM_MACOSX_1@__BASE_PLATFORM_SRC_OBJECTS = $(COND_PLATFORM_MACOSX_1___BASE_PLATFORM_SRC_OBJECTS) @COND_PLATFORM_MSDOS_1@__BASE_PLATFORM_SRC_OBJECTS = \ @@ -3867,16 +3876,17 @@ COND_PLATFORM_OS2_1___BASE_PLATFORM_SRC_OBJECTS = \ COND_PLATFORM_UNIX_1___BASE_PLATFORM_SRC_OBJECTS = \ monodll_fdiodispatcher.o \ monodll_selectdispatcher.o \ - monodll_epolldispatcher.o \ monodll_appunix.o \ - monodll_evtloopunix.o \ monodll_unix_dir.o \ monodll_dlunix.o \ + monodll_epolldispatcher.o \ + monodll_evtloopunix.o \ + monodll_fdiounix.o \ monodll_unix_snglinst.o \ + monodll_unix_stackwalk.o \ monodll_unix_stdpaths.o \ monodll_timerunx.o \ monodll_threadpsx.o \ - monodll_unix_stackwalk.o \ monodll_utilsunx.o \ monodll_unix_mimetype.o @COND_PLATFORM_UNIX_1@__BASE_PLATFORM_SRC_OBJECTS = $(COND_PLATFORM_UNIX_1___BASE_PLATFORM_SRC_OBJECTS) @@ -5627,16 +5637,17 @@ COND_PLATFORM_MACOSX_1___BASE_PLATFORM_SRC_OBJECTS_1 = \ monolib_utilsexc_base.o \ monolib_fdiodispatcher.o \ monolib_selectdispatcher.o \ - monolib_epolldispatcher.o \ monolib_appunix.o \ - monolib_evtloopunix.o \ monolib_unix_dir.o \ monolib_dlunix.o \ + monolib_epolldispatcher.o \ + monolib_evtloopunix.o \ + monolib_fdiounix.o \ monolib_unix_snglinst.o \ + monolib_unix_stackwalk.o \ monolib_unix_stdpaths.o \ monolib_timerunx.o \ monolib_threadpsx.o \ - monolib_unix_stackwalk.o \ monolib_utilsunx.o @COND_PLATFORM_MACOSX_1@__BASE_PLATFORM_SRC_OBJECTS_1 = $(COND_PLATFORM_MACOSX_1___BASE_PLATFORM_SRC_OBJECTS_1) @COND_PLATFORM_MSDOS_1@__BASE_PLATFORM_SRC_OBJECTS_1 \ @@ -5659,16 +5670,17 @@ COND_PLATFORM_OS2_1___BASE_PLATFORM_SRC_OBJECTS_1 = \ COND_PLATFORM_UNIX_1___BASE_PLATFORM_SRC_OBJECTS_1 = \ monolib_fdiodispatcher.o \ monolib_selectdispatcher.o \ - monolib_epolldispatcher.o \ monolib_appunix.o \ - monolib_evtloopunix.o \ monolib_unix_dir.o \ monolib_dlunix.o \ + monolib_epolldispatcher.o \ + monolib_evtloopunix.o \ + monolib_fdiounix.o \ monolib_unix_snglinst.o \ + monolib_unix_stackwalk.o \ monolib_unix_stdpaths.o \ monolib_timerunx.o \ monolib_threadpsx.o \ - monolib_unix_stackwalk.o \ monolib_utilsunx.o \ monolib_unix_mimetype.o @COND_PLATFORM_UNIX_1@__BASE_PLATFORM_SRC_OBJECTS_1 = $(COND_PLATFORM_UNIX_1___BASE_PLATFORM_SRC_OBJECTS_1) @@ -7456,16 +7468,17 @@ COND_PLATFORM_MACOSX_1___BASE_PLATFORM_SRC_OBJECTS_2 = \ basedll_utilsexc_base.o \ basedll_fdiodispatcher.o \ basedll_selectdispatcher.o \ - basedll_epolldispatcher.o \ basedll_appunix.o \ - basedll_evtloopunix.o \ basedll_unix_dir.o \ basedll_dlunix.o \ + basedll_epolldispatcher.o \ + basedll_evtloopunix.o \ + basedll_fdiounix.o \ basedll_unix_snglinst.o \ + basedll_unix_stackwalk.o \ basedll_unix_stdpaths.o \ basedll_timerunx.o \ basedll_threadpsx.o \ - basedll_unix_stackwalk.o \ basedll_utilsunx.o @COND_PLATFORM_MACOSX_1@__BASE_PLATFORM_SRC_OBJECTS_2 = $(COND_PLATFORM_MACOSX_1___BASE_PLATFORM_SRC_OBJECTS_2) @COND_PLATFORM_MSDOS_1@__BASE_PLATFORM_SRC_OBJECTS_2 \ @@ -7488,16 +7501,17 @@ COND_PLATFORM_OS2_1___BASE_PLATFORM_SRC_OBJECTS_2 = \ COND_PLATFORM_UNIX_1___BASE_PLATFORM_SRC_OBJECTS_2 = \ basedll_fdiodispatcher.o \ basedll_selectdispatcher.o \ - basedll_epolldispatcher.o \ basedll_appunix.o \ - basedll_evtloopunix.o \ basedll_unix_dir.o \ basedll_dlunix.o \ + basedll_epolldispatcher.o \ + basedll_evtloopunix.o \ + basedll_fdiounix.o \ basedll_unix_snglinst.o \ + basedll_unix_stackwalk.o \ basedll_unix_stdpaths.o \ basedll_timerunx.o \ basedll_threadpsx.o \ - basedll_unix_stackwalk.o \ basedll_utilsunx.o \ basedll_unix_mimetype.o @COND_PLATFORM_UNIX_1@__BASE_PLATFORM_SRC_OBJECTS_2 = $(COND_PLATFORM_UNIX_1___BASE_PLATFORM_SRC_OBJECTS_2) @@ -7549,16 +7563,17 @@ COND_PLATFORM_MACOSX_1___BASE_PLATFORM_SRC_OBJECTS_3 = \ baselib_utilsexc_base.o \ baselib_fdiodispatcher.o \ baselib_selectdispatcher.o \ - baselib_epolldispatcher.o \ baselib_appunix.o \ - baselib_evtloopunix.o \ baselib_unix_dir.o \ baselib_dlunix.o \ + baselib_epolldispatcher.o \ + baselib_evtloopunix.o \ + baselib_fdiounix.o \ baselib_unix_snglinst.o \ + baselib_unix_stackwalk.o \ baselib_unix_stdpaths.o \ baselib_timerunx.o \ baselib_threadpsx.o \ - baselib_unix_stackwalk.o \ baselib_utilsunx.o @COND_PLATFORM_MACOSX_1@__BASE_PLATFORM_SRC_OBJECTS_3 = $(COND_PLATFORM_MACOSX_1___BASE_PLATFORM_SRC_OBJECTS_3) @COND_PLATFORM_MSDOS_1@__BASE_PLATFORM_SRC_OBJECTS_3 \ @@ -7581,16 +7596,17 @@ COND_PLATFORM_OS2_1___BASE_PLATFORM_SRC_OBJECTS_3 = \ COND_PLATFORM_UNIX_1___BASE_PLATFORM_SRC_OBJECTS_3 = \ baselib_fdiodispatcher.o \ baselib_selectdispatcher.o \ - baselib_epolldispatcher.o \ baselib_appunix.o \ - baselib_evtloopunix.o \ baselib_unix_dir.o \ baselib_dlunix.o \ + baselib_epolldispatcher.o \ + baselib_evtloopunix.o \ + baselib_fdiounix.o \ baselib_unix_snglinst.o \ + baselib_unix_stackwalk.o \ baselib_unix_stdpaths.o \ baselib_timerunx.o \ baselib_threadpsx.o \ - baselib_unix_stackwalk.o \ baselib_utilsunx.o \ baselib_unix_mimetype.o @COND_PLATFORM_UNIX_1@__BASE_PLATFORM_SRC_OBJECTS_3 = $(COND_PLATFORM_UNIX_1___BASE_PLATFORM_SRC_OBJECTS_3) @@ -15951,12 +15967,6 @@ monodll_sound_sdl.o: $(srcdir)/src/unix/sound_sdl.cpp $(MONODLL_ODEP) @COND_PLATFORM_OS2_1@monodll_selectdispatcher.o: $(srcdir)/src/common/selectdispatcher.cpp $(MONODLL_ODEP) @COND_PLATFORM_OS2_1@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/common/selectdispatcher.cpp -@COND_PLATFORM_UNIX_1@monodll_epolldispatcher.o: $(srcdir)/src/unix/epolldispatcher.cpp $(MONODLL_ODEP) -@COND_PLATFORM_UNIX_1@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/unix/epolldispatcher.cpp - -@COND_PLATFORM_MACOSX_1@monodll_epolldispatcher.o: $(srcdir)/src/unix/epolldispatcher.cpp $(MONODLL_ODEP) -@COND_PLATFORM_MACOSX_1@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/unix/epolldispatcher.cpp - @COND_PLATFORM_UNIX_1@monodll_appunix.o: $(srcdir)/src/unix/appunix.cpp $(MONODLL_ODEP) @COND_PLATFORM_UNIX_1@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/unix/appunix.cpp @@ -15966,15 +15976,6 @@ monodll_sound_sdl.o: $(srcdir)/src/unix/sound_sdl.cpp $(MONODLL_ODEP) @COND_PLATFORM_OS2_1@monodll_appunix.o: $(srcdir)/src/unix/appunix.cpp $(MONODLL_ODEP) @COND_PLATFORM_OS2_1@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/unix/appunix.cpp -@COND_PLATFORM_UNIX_1@monodll_evtloopunix.o: $(srcdir)/src/unix/evtloopunix.cpp $(MONODLL_ODEP) -@COND_PLATFORM_UNIX_1@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/unix/evtloopunix.cpp - -@COND_PLATFORM_MACOSX_1@monodll_evtloopunix.o: $(srcdir)/src/unix/evtloopunix.cpp $(MONODLL_ODEP) -@COND_PLATFORM_MACOSX_1@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/unix/evtloopunix.cpp - -@COND_PLATFORM_OS2_1@monodll_evtloopunix.o: $(srcdir)/src/unix/evtloopunix.cpp $(MONODLL_ODEP) -@COND_PLATFORM_OS2_1@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/unix/evtloopunix.cpp - @COND_PLATFORM_UNIX_1@monodll_unix_dir.o: $(srcdir)/src/unix/dir.cpp $(MONODLL_ODEP) @COND_PLATFORM_UNIX_1@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/unix/dir.cpp @@ -15987,12 +15988,39 @@ monodll_sound_sdl.o: $(srcdir)/src/unix/sound_sdl.cpp $(MONODLL_ODEP) @COND_PLATFORM_MACOSX_1@monodll_dlunix.o: $(srcdir)/src/unix/dlunix.cpp $(MONODLL_ODEP) @COND_PLATFORM_MACOSX_1@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/unix/dlunix.cpp +@COND_PLATFORM_UNIX_1@monodll_epolldispatcher.o: $(srcdir)/src/unix/epolldispatcher.cpp $(MONODLL_ODEP) +@COND_PLATFORM_UNIX_1@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/unix/epolldispatcher.cpp + +@COND_PLATFORM_MACOSX_1@monodll_epolldispatcher.o: $(srcdir)/src/unix/epolldispatcher.cpp $(MONODLL_ODEP) +@COND_PLATFORM_MACOSX_1@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/unix/epolldispatcher.cpp + +@COND_PLATFORM_UNIX_1@monodll_evtloopunix.o: $(srcdir)/src/unix/evtloopunix.cpp $(MONODLL_ODEP) +@COND_PLATFORM_UNIX_1@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/unix/evtloopunix.cpp + +@COND_PLATFORM_MACOSX_1@monodll_evtloopunix.o: $(srcdir)/src/unix/evtloopunix.cpp $(MONODLL_ODEP) +@COND_PLATFORM_MACOSX_1@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/unix/evtloopunix.cpp + +@COND_PLATFORM_OS2_1@monodll_evtloopunix.o: $(srcdir)/src/unix/evtloopunix.cpp $(MONODLL_ODEP) +@COND_PLATFORM_OS2_1@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/unix/evtloopunix.cpp + +@COND_PLATFORM_UNIX_1@monodll_fdiounix.o: $(srcdir)/src/unix/fdiounix.cpp $(MONODLL_ODEP) +@COND_PLATFORM_UNIX_1@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/unix/fdiounix.cpp + +@COND_PLATFORM_MACOSX_1@monodll_fdiounix.o: $(srcdir)/src/unix/fdiounix.cpp $(MONODLL_ODEP) +@COND_PLATFORM_MACOSX_1@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/unix/fdiounix.cpp + @COND_PLATFORM_UNIX_1@monodll_unix_snglinst.o: $(srcdir)/src/unix/snglinst.cpp $(MONODLL_ODEP) @COND_PLATFORM_UNIX_1@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/unix/snglinst.cpp @COND_PLATFORM_MACOSX_1@monodll_unix_snglinst.o: $(srcdir)/src/unix/snglinst.cpp $(MONODLL_ODEP) @COND_PLATFORM_MACOSX_1@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/unix/snglinst.cpp +@COND_PLATFORM_UNIX_1@monodll_unix_stackwalk.o: $(srcdir)/src/unix/stackwalk.cpp $(MONODLL_ODEP) +@COND_PLATFORM_UNIX_1@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/unix/stackwalk.cpp + +@COND_PLATFORM_MACOSX_1@monodll_unix_stackwalk.o: $(srcdir)/src/unix/stackwalk.cpp $(MONODLL_ODEP) +@COND_PLATFORM_MACOSX_1@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/unix/stackwalk.cpp + @COND_PLATFORM_UNIX_1@monodll_unix_stdpaths.o: $(srcdir)/src/unix/stdpaths.cpp $(MONODLL_ODEP) @COND_PLATFORM_UNIX_1@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/unix/stdpaths.cpp @@ -16014,12 +16042,6 @@ monodll_sound_sdl.o: $(srcdir)/src/unix/sound_sdl.cpp $(MONODLL_ODEP) @COND_PLATFORM_MACOSX_1@monodll_threadpsx.o: $(srcdir)/src/unix/threadpsx.cpp $(MONODLL_ODEP) @COND_PLATFORM_MACOSX_1@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/unix/threadpsx.cpp -@COND_PLATFORM_UNIX_1@monodll_unix_stackwalk.o: $(srcdir)/src/unix/stackwalk.cpp $(MONODLL_ODEP) -@COND_PLATFORM_UNIX_1@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/unix/stackwalk.cpp - -@COND_PLATFORM_MACOSX_1@monodll_unix_stackwalk.o: $(srcdir)/src/unix/stackwalk.cpp $(MONODLL_ODEP) -@COND_PLATFORM_MACOSX_1@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/unix/stackwalk.cpp - @COND_PLATFORM_UNIX_1@monodll_utilsunx.o: $(srcdir)/src/unix/utilsunx.cpp $(MONODLL_ODEP) @COND_PLATFORM_UNIX_1@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/unix/utilsunx.cpp @@ -20655,12 +20677,6 @@ monolib_sound_sdl.o: $(srcdir)/src/unix/sound_sdl.cpp $(MONOLIB_ODEP) @COND_PLATFORM_OS2_1@monolib_selectdispatcher.o: $(srcdir)/src/common/selectdispatcher.cpp $(MONOLIB_ODEP) @COND_PLATFORM_OS2_1@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/common/selectdispatcher.cpp -@COND_PLATFORM_UNIX_1@monolib_epolldispatcher.o: $(srcdir)/src/unix/epolldispatcher.cpp $(MONOLIB_ODEP) -@COND_PLATFORM_UNIX_1@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/unix/epolldispatcher.cpp - -@COND_PLATFORM_MACOSX_1@monolib_epolldispatcher.o: $(srcdir)/src/unix/epolldispatcher.cpp $(MONOLIB_ODEP) -@COND_PLATFORM_MACOSX_1@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/unix/epolldispatcher.cpp - @COND_PLATFORM_UNIX_1@monolib_appunix.o: $(srcdir)/src/unix/appunix.cpp $(MONOLIB_ODEP) @COND_PLATFORM_UNIX_1@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/unix/appunix.cpp @@ -20670,15 +20686,6 @@ monolib_sound_sdl.o: $(srcdir)/src/unix/sound_sdl.cpp $(MONOLIB_ODEP) @COND_PLATFORM_OS2_1@monolib_appunix.o: $(srcdir)/src/unix/appunix.cpp $(MONOLIB_ODEP) @COND_PLATFORM_OS2_1@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/unix/appunix.cpp -@COND_PLATFORM_UNIX_1@monolib_evtloopunix.o: $(srcdir)/src/unix/evtloopunix.cpp $(MONOLIB_ODEP) -@COND_PLATFORM_UNIX_1@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/unix/evtloopunix.cpp - -@COND_PLATFORM_MACOSX_1@monolib_evtloopunix.o: $(srcdir)/src/unix/evtloopunix.cpp $(MONOLIB_ODEP) -@COND_PLATFORM_MACOSX_1@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/unix/evtloopunix.cpp - -@COND_PLATFORM_OS2_1@monolib_evtloopunix.o: $(srcdir)/src/unix/evtloopunix.cpp $(MONOLIB_ODEP) -@COND_PLATFORM_OS2_1@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/unix/evtloopunix.cpp - @COND_PLATFORM_UNIX_1@monolib_unix_dir.o: $(srcdir)/src/unix/dir.cpp $(MONOLIB_ODEP) @COND_PLATFORM_UNIX_1@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/unix/dir.cpp @@ -20691,12 +20698,39 @@ monolib_sound_sdl.o: $(srcdir)/src/unix/sound_sdl.cpp $(MONOLIB_ODEP) @COND_PLATFORM_MACOSX_1@monolib_dlunix.o: $(srcdir)/src/unix/dlunix.cpp $(MONOLIB_ODEP) @COND_PLATFORM_MACOSX_1@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/unix/dlunix.cpp +@COND_PLATFORM_UNIX_1@monolib_epolldispatcher.o: $(srcdir)/src/unix/epolldispatcher.cpp $(MONOLIB_ODEP) +@COND_PLATFORM_UNIX_1@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/unix/epolldispatcher.cpp + +@COND_PLATFORM_MACOSX_1@monolib_epolldispatcher.o: $(srcdir)/src/unix/epolldispatcher.cpp $(MONOLIB_ODEP) +@COND_PLATFORM_MACOSX_1@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/unix/epolldispatcher.cpp + +@COND_PLATFORM_UNIX_1@monolib_evtloopunix.o: $(srcdir)/src/unix/evtloopunix.cpp $(MONOLIB_ODEP) +@COND_PLATFORM_UNIX_1@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/unix/evtloopunix.cpp + +@COND_PLATFORM_MACOSX_1@monolib_evtloopunix.o: $(srcdir)/src/unix/evtloopunix.cpp $(MONOLIB_ODEP) +@COND_PLATFORM_MACOSX_1@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/unix/evtloopunix.cpp + +@COND_PLATFORM_OS2_1@monolib_evtloopunix.o: $(srcdir)/src/unix/evtloopunix.cpp $(MONOLIB_ODEP) +@COND_PLATFORM_OS2_1@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/unix/evtloopunix.cpp + +@COND_PLATFORM_UNIX_1@monolib_fdiounix.o: $(srcdir)/src/unix/fdiounix.cpp $(MONOLIB_ODEP) +@COND_PLATFORM_UNIX_1@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/unix/fdiounix.cpp + +@COND_PLATFORM_MACOSX_1@monolib_fdiounix.o: $(srcdir)/src/unix/fdiounix.cpp $(MONOLIB_ODEP) +@COND_PLATFORM_MACOSX_1@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/unix/fdiounix.cpp + @COND_PLATFORM_UNIX_1@monolib_unix_snglinst.o: $(srcdir)/src/unix/snglinst.cpp $(MONOLIB_ODEP) @COND_PLATFORM_UNIX_1@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/unix/snglinst.cpp @COND_PLATFORM_MACOSX_1@monolib_unix_snglinst.o: $(srcdir)/src/unix/snglinst.cpp $(MONOLIB_ODEP) @COND_PLATFORM_MACOSX_1@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/unix/snglinst.cpp +@COND_PLATFORM_UNIX_1@monolib_unix_stackwalk.o: $(srcdir)/src/unix/stackwalk.cpp $(MONOLIB_ODEP) +@COND_PLATFORM_UNIX_1@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/unix/stackwalk.cpp + +@COND_PLATFORM_MACOSX_1@monolib_unix_stackwalk.o: $(srcdir)/src/unix/stackwalk.cpp $(MONOLIB_ODEP) +@COND_PLATFORM_MACOSX_1@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/unix/stackwalk.cpp + @COND_PLATFORM_UNIX_1@monolib_unix_stdpaths.o: $(srcdir)/src/unix/stdpaths.cpp $(MONOLIB_ODEP) @COND_PLATFORM_UNIX_1@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/unix/stdpaths.cpp @@ -20718,12 +20752,6 @@ monolib_sound_sdl.o: $(srcdir)/src/unix/sound_sdl.cpp $(MONOLIB_ODEP) @COND_PLATFORM_MACOSX_1@monolib_threadpsx.o: $(srcdir)/src/unix/threadpsx.cpp $(MONOLIB_ODEP) @COND_PLATFORM_MACOSX_1@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/unix/threadpsx.cpp -@COND_PLATFORM_UNIX_1@monolib_unix_stackwalk.o: $(srcdir)/src/unix/stackwalk.cpp $(MONOLIB_ODEP) -@COND_PLATFORM_UNIX_1@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/unix/stackwalk.cpp - -@COND_PLATFORM_MACOSX_1@monolib_unix_stackwalk.o: $(srcdir)/src/unix/stackwalk.cpp $(MONOLIB_ODEP) -@COND_PLATFORM_MACOSX_1@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/unix/stackwalk.cpp - @COND_PLATFORM_UNIX_1@monolib_utilsunx.o: $(srcdir)/src/unix/utilsunx.cpp $(MONOLIB_ODEP) @COND_PLATFORM_UNIX_1@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/unix/utilsunx.cpp @@ -23775,12 +23803,6 @@ basedll_cocoa_utils.o: $(srcdir)/src/osx/cocoa/utils.mm $(BASEDLL_ODEP) @COND_PLATFORM_OS2_1@basedll_selectdispatcher.o: $(srcdir)/src/common/selectdispatcher.cpp $(BASEDLL_ODEP) @COND_PLATFORM_OS2_1@ $(CXXC) -c -o $@ $(BASEDLL_CXXFLAGS) $(srcdir)/src/common/selectdispatcher.cpp -@COND_PLATFORM_UNIX_1@basedll_epolldispatcher.o: $(srcdir)/src/unix/epolldispatcher.cpp $(BASEDLL_ODEP) -@COND_PLATFORM_UNIX_1@ $(CXXC) -c -o $@ $(BASEDLL_CXXFLAGS) $(srcdir)/src/unix/epolldispatcher.cpp - -@COND_PLATFORM_MACOSX_1@basedll_epolldispatcher.o: $(srcdir)/src/unix/epolldispatcher.cpp $(BASEDLL_ODEP) -@COND_PLATFORM_MACOSX_1@ $(CXXC) -c -o $@ $(BASEDLL_CXXFLAGS) $(srcdir)/src/unix/epolldispatcher.cpp - @COND_PLATFORM_UNIX_1@basedll_appunix.o: $(srcdir)/src/unix/appunix.cpp $(BASEDLL_ODEP) @COND_PLATFORM_UNIX_1@ $(CXXC) -c -o $@ $(BASEDLL_CXXFLAGS) $(srcdir)/src/unix/appunix.cpp @@ -23790,15 +23812,6 @@ basedll_cocoa_utils.o: $(srcdir)/src/osx/cocoa/utils.mm $(BASEDLL_ODEP) @COND_PLATFORM_OS2_1@basedll_appunix.o: $(srcdir)/src/unix/appunix.cpp $(BASEDLL_ODEP) @COND_PLATFORM_OS2_1@ $(CXXC) -c -o $@ $(BASEDLL_CXXFLAGS) $(srcdir)/src/unix/appunix.cpp -@COND_PLATFORM_UNIX_1@basedll_evtloopunix.o: $(srcdir)/src/unix/evtloopunix.cpp $(BASEDLL_ODEP) -@COND_PLATFORM_UNIX_1@ $(CXXC) -c -o $@ $(BASEDLL_CXXFLAGS) $(srcdir)/src/unix/evtloopunix.cpp - -@COND_PLATFORM_MACOSX_1@basedll_evtloopunix.o: $(srcdir)/src/unix/evtloopunix.cpp $(BASEDLL_ODEP) -@COND_PLATFORM_MACOSX_1@ $(CXXC) -c -o $@ $(BASEDLL_CXXFLAGS) $(srcdir)/src/unix/evtloopunix.cpp - -@COND_PLATFORM_OS2_1@basedll_evtloopunix.o: $(srcdir)/src/unix/evtloopunix.cpp $(BASEDLL_ODEP) -@COND_PLATFORM_OS2_1@ $(CXXC) -c -o $@ $(BASEDLL_CXXFLAGS) $(srcdir)/src/unix/evtloopunix.cpp - @COND_PLATFORM_UNIX_1@basedll_unix_dir.o: $(srcdir)/src/unix/dir.cpp $(BASEDLL_ODEP) @COND_PLATFORM_UNIX_1@ $(CXXC) -c -o $@ $(BASEDLL_CXXFLAGS) $(srcdir)/src/unix/dir.cpp @@ -23811,12 +23824,39 @@ basedll_cocoa_utils.o: $(srcdir)/src/osx/cocoa/utils.mm $(BASEDLL_ODEP) @COND_PLATFORM_MACOSX_1@basedll_dlunix.o: $(srcdir)/src/unix/dlunix.cpp $(BASEDLL_ODEP) @COND_PLATFORM_MACOSX_1@ $(CXXC) -c -o $@ $(BASEDLL_CXXFLAGS) $(srcdir)/src/unix/dlunix.cpp +@COND_PLATFORM_UNIX_1@basedll_epolldispatcher.o: $(srcdir)/src/unix/epolldispatcher.cpp $(BASEDLL_ODEP) +@COND_PLATFORM_UNIX_1@ $(CXXC) -c -o $@ $(BASEDLL_CXXFLAGS) $(srcdir)/src/unix/epolldispatcher.cpp + +@COND_PLATFORM_MACOSX_1@basedll_epolldispatcher.o: $(srcdir)/src/unix/epolldispatcher.cpp $(BASEDLL_ODEP) +@COND_PLATFORM_MACOSX_1@ $(CXXC) -c -o $@ $(BASEDLL_CXXFLAGS) $(srcdir)/src/unix/epolldispatcher.cpp + +@COND_PLATFORM_UNIX_1@basedll_evtloopunix.o: $(srcdir)/src/unix/evtloopunix.cpp $(BASEDLL_ODEP) +@COND_PLATFORM_UNIX_1@ $(CXXC) -c -o $@ $(BASEDLL_CXXFLAGS) $(srcdir)/src/unix/evtloopunix.cpp + +@COND_PLATFORM_MACOSX_1@basedll_evtloopunix.o: $(srcdir)/src/unix/evtloopunix.cpp $(BASEDLL_ODEP) +@COND_PLATFORM_MACOSX_1@ $(CXXC) -c -o $@ $(BASEDLL_CXXFLAGS) $(srcdir)/src/unix/evtloopunix.cpp + +@COND_PLATFORM_OS2_1@basedll_evtloopunix.o: $(srcdir)/src/unix/evtloopunix.cpp $(BASEDLL_ODEP) +@COND_PLATFORM_OS2_1@ $(CXXC) -c -o $@ $(BASEDLL_CXXFLAGS) $(srcdir)/src/unix/evtloopunix.cpp + +@COND_PLATFORM_UNIX_1@basedll_fdiounix.o: $(srcdir)/src/unix/fdiounix.cpp $(BASEDLL_ODEP) +@COND_PLATFORM_UNIX_1@ $(CXXC) -c -o $@ $(BASEDLL_CXXFLAGS) $(srcdir)/src/unix/fdiounix.cpp + +@COND_PLATFORM_MACOSX_1@basedll_fdiounix.o: $(srcdir)/src/unix/fdiounix.cpp $(BASEDLL_ODEP) +@COND_PLATFORM_MACOSX_1@ $(CXXC) -c -o $@ $(BASEDLL_CXXFLAGS) $(srcdir)/src/unix/fdiounix.cpp + @COND_PLATFORM_UNIX_1@basedll_unix_snglinst.o: $(srcdir)/src/unix/snglinst.cpp $(BASEDLL_ODEP) @COND_PLATFORM_UNIX_1@ $(CXXC) -c -o $@ $(BASEDLL_CXXFLAGS) $(srcdir)/src/unix/snglinst.cpp @COND_PLATFORM_MACOSX_1@basedll_unix_snglinst.o: $(srcdir)/src/unix/snglinst.cpp $(BASEDLL_ODEP) @COND_PLATFORM_MACOSX_1@ $(CXXC) -c -o $@ $(BASEDLL_CXXFLAGS) $(srcdir)/src/unix/snglinst.cpp +@COND_PLATFORM_UNIX_1@basedll_unix_stackwalk.o: $(srcdir)/src/unix/stackwalk.cpp $(BASEDLL_ODEP) +@COND_PLATFORM_UNIX_1@ $(CXXC) -c -o $@ $(BASEDLL_CXXFLAGS) $(srcdir)/src/unix/stackwalk.cpp + +@COND_PLATFORM_MACOSX_1@basedll_unix_stackwalk.o: $(srcdir)/src/unix/stackwalk.cpp $(BASEDLL_ODEP) +@COND_PLATFORM_MACOSX_1@ $(CXXC) -c -o $@ $(BASEDLL_CXXFLAGS) $(srcdir)/src/unix/stackwalk.cpp + @COND_PLATFORM_UNIX_1@basedll_unix_stdpaths.o: $(srcdir)/src/unix/stdpaths.cpp $(BASEDLL_ODEP) @COND_PLATFORM_UNIX_1@ $(CXXC) -c -o $@ $(BASEDLL_CXXFLAGS) $(srcdir)/src/unix/stdpaths.cpp @@ -23838,12 +23878,6 @@ basedll_cocoa_utils.o: $(srcdir)/src/osx/cocoa/utils.mm $(BASEDLL_ODEP) @COND_PLATFORM_MACOSX_1@basedll_threadpsx.o: $(srcdir)/src/unix/threadpsx.cpp $(BASEDLL_ODEP) @COND_PLATFORM_MACOSX_1@ $(CXXC) -c -o $@ $(BASEDLL_CXXFLAGS) $(srcdir)/src/unix/threadpsx.cpp -@COND_PLATFORM_UNIX_1@basedll_unix_stackwalk.o: $(srcdir)/src/unix/stackwalk.cpp $(BASEDLL_ODEP) -@COND_PLATFORM_UNIX_1@ $(CXXC) -c -o $@ $(BASEDLL_CXXFLAGS) $(srcdir)/src/unix/stackwalk.cpp - -@COND_PLATFORM_MACOSX_1@basedll_unix_stackwalk.o: $(srcdir)/src/unix/stackwalk.cpp $(BASEDLL_ODEP) -@COND_PLATFORM_MACOSX_1@ $(CXXC) -c -o $@ $(BASEDLL_CXXFLAGS) $(srcdir)/src/unix/stackwalk.cpp - @COND_PLATFORM_UNIX_1@basedll_utilsunx.o: $(srcdir)/src/unix/utilsunx.cpp $(BASEDLL_ODEP) @COND_PLATFORM_UNIX_1@ $(CXXC) -c -o $@ $(BASEDLL_CXXFLAGS) $(srcdir)/src/unix/utilsunx.cpp @@ -24237,12 +24271,6 @@ baselib_cocoa_utils.o: $(srcdir)/src/osx/cocoa/utils.mm $(BASELIB_ODEP) @COND_PLATFORM_OS2_1@baselib_selectdispatcher.o: $(srcdir)/src/common/selectdispatcher.cpp $(BASELIB_ODEP) @COND_PLATFORM_OS2_1@ $(CXXC) -c -o $@ $(BASELIB_CXXFLAGS) $(srcdir)/src/common/selectdispatcher.cpp -@COND_PLATFORM_UNIX_1@baselib_epolldispatcher.o: $(srcdir)/src/unix/epolldispatcher.cpp $(BASELIB_ODEP) -@COND_PLATFORM_UNIX_1@ $(CXXC) -c -o $@ $(BASELIB_CXXFLAGS) $(srcdir)/src/unix/epolldispatcher.cpp - -@COND_PLATFORM_MACOSX_1@baselib_epolldispatcher.o: $(srcdir)/src/unix/epolldispatcher.cpp $(BASELIB_ODEP) -@COND_PLATFORM_MACOSX_1@ $(CXXC) -c -o $@ $(BASELIB_CXXFLAGS) $(srcdir)/src/unix/epolldispatcher.cpp - @COND_PLATFORM_UNIX_1@baselib_appunix.o: $(srcdir)/src/unix/appunix.cpp $(BASELIB_ODEP) @COND_PLATFORM_UNIX_1@ $(CXXC) -c -o $@ $(BASELIB_CXXFLAGS) $(srcdir)/src/unix/appunix.cpp @@ -24252,15 +24280,6 @@ baselib_cocoa_utils.o: $(srcdir)/src/osx/cocoa/utils.mm $(BASELIB_ODEP) @COND_PLATFORM_OS2_1@baselib_appunix.o: $(srcdir)/src/unix/appunix.cpp $(BASELIB_ODEP) @COND_PLATFORM_OS2_1@ $(CXXC) -c -o $@ $(BASELIB_CXXFLAGS) $(srcdir)/src/unix/appunix.cpp -@COND_PLATFORM_UNIX_1@baselib_evtloopunix.o: $(srcdir)/src/unix/evtloopunix.cpp $(BASELIB_ODEP) -@COND_PLATFORM_UNIX_1@ $(CXXC) -c -o $@ $(BASELIB_CXXFLAGS) $(srcdir)/src/unix/evtloopunix.cpp - -@COND_PLATFORM_MACOSX_1@baselib_evtloopunix.o: $(srcdir)/src/unix/evtloopunix.cpp $(BASELIB_ODEP) -@COND_PLATFORM_MACOSX_1@ $(CXXC) -c -o $@ $(BASELIB_CXXFLAGS) $(srcdir)/src/unix/evtloopunix.cpp - -@COND_PLATFORM_OS2_1@baselib_evtloopunix.o: $(srcdir)/src/unix/evtloopunix.cpp $(BASELIB_ODEP) -@COND_PLATFORM_OS2_1@ $(CXXC) -c -o $@ $(BASELIB_CXXFLAGS) $(srcdir)/src/unix/evtloopunix.cpp - @COND_PLATFORM_UNIX_1@baselib_unix_dir.o: $(srcdir)/src/unix/dir.cpp $(BASELIB_ODEP) @COND_PLATFORM_UNIX_1@ $(CXXC) -c -o $@ $(BASELIB_CXXFLAGS) $(srcdir)/src/unix/dir.cpp @@ -24273,12 +24292,39 @@ baselib_cocoa_utils.o: $(srcdir)/src/osx/cocoa/utils.mm $(BASELIB_ODEP) @COND_PLATFORM_MACOSX_1@baselib_dlunix.o: $(srcdir)/src/unix/dlunix.cpp $(BASELIB_ODEP) @COND_PLATFORM_MACOSX_1@ $(CXXC) -c -o $@ $(BASELIB_CXXFLAGS) $(srcdir)/src/unix/dlunix.cpp +@COND_PLATFORM_UNIX_1@baselib_epolldispatcher.o: $(srcdir)/src/unix/epolldispatcher.cpp $(BASELIB_ODEP) +@COND_PLATFORM_UNIX_1@ $(CXXC) -c -o $@ $(BASELIB_CXXFLAGS) $(srcdir)/src/unix/epolldispatcher.cpp + +@COND_PLATFORM_MACOSX_1@baselib_epolldispatcher.o: $(srcdir)/src/unix/epolldispatcher.cpp $(BASELIB_ODEP) +@COND_PLATFORM_MACOSX_1@ $(CXXC) -c -o $@ $(BASELIB_CXXFLAGS) $(srcdir)/src/unix/epolldispatcher.cpp + +@COND_PLATFORM_UNIX_1@baselib_evtloopunix.o: $(srcdir)/src/unix/evtloopunix.cpp $(BASELIB_ODEP) +@COND_PLATFORM_UNIX_1@ $(CXXC) -c -o $@ $(BASELIB_CXXFLAGS) $(srcdir)/src/unix/evtloopunix.cpp + +@COND_PLATFORM_MACOSX_1@baselib_evtloopunix.o: $(srcdir)/src/unix/evtloopunix.cpp $(BASELIB_ODEP) +@COND_PLATFORM_MACOSX_1@ $(CXXC) -c -o $@ $(BASELIB_CXXFLAGS) $(srcdir)/src/unix/evtloopunix.cpp + +@COND_PLATFORM_OS2_1@baselib_evtloopunix.o: $(srcdir)/src/unix/evtloopunix.cpp $(BASELIB_ODEP) +@COND_PLATFORM_OS2_1@ $(CXXC) -c -o $@ $(BASELIB_CXXFLAGS) $(srcdir)/src/unix/evtloopunix.cpp + +@COND_PLATFORM_UNIX_1@baselib_fdiounix.o: $(srcdir)/src/unix/fdiounix.cpp $(BASELIB_ODEP) +@COND_PLATFORM_UNIX_1@ $(CXXC) -c -o $@ $(BASELIB_CXXFLAGS) $(srcdir)/src/unix/fdiounix.cpp + +@COND_PLATFORM_MACOSX_1@baselib_fdiounix.o: $(srcdir)/src/unix/fdiounix.cpp $(BASELIB_ODEP) +@COND_PLATFORM_MACOSX_1@ $(CXXC) -c -o $@ $(BASELIB_CXXFLAGS) $(srcdir)/src/unix/fdiounix.cpp + @COND_PLATFORM_UNIX_1@baselib_unix_snglinst.o: $(srcdir)/src/unix/snglinst.cpp $(BASELIB_ODEP) @COND_PLATFORM_UNIX_1@ $(CXXC) -c -o $@ $(BASELIB_CXXFLAGS) $(srcdir)/src/unix/snglinst.cpp @COND_PLATFORM_MACOSX_1@baselib_unix_snglinst.o: $(srcdir)/src/unix/snglinst.cpp $(BASELIB_ODEP) @COND_PLATFORM_MACOSX_1@ $(CXXC) -c -o $@ $(BASELIB_CXXFLAGS) $(srcdir)/src/unix/snglinst.cpp +@COND_PLATFORM_UNIX_1@baselib_unix_stackwalk.o: $(srcdir)/src/unix/stackwalk.cpp $(BASELIB_ODEP) +@COND_PLATFORM_UNIX_1@ $(CXXC) -c -o $@ $(BASELIB_CXXFLAGS) $(srcdir)/src/unix/stackwalk.cpp + +@COND_PLATFORM_MACOSX_1@baselib_unix_stackwalk.o: $(srcdir)/src/unix/stackwalk.cpp $(BASELIB_ODEP) +@COND_PLATFORM_MACOSX_1@ $(CXXC) -c -o $@ $(BASELIB_CXXFLAGS) $(srcdir)/src/unix/stackwalk.cpp + @COND_PLATFORM_UNIX_1@baselib_unix_stdpaths.o: $(srcdir)/src/unix/stdpaths.cpp $(BASELIB_ODEP) @COND_PLATFORM_UNIX_1@ $(CXXC) -c -o $@ $(BASELIB_CXXFLAGS) $(srcdir)/src/unix/stdpaths.cpp @@ -24300,12 +24346,6 @@ baselib_cocoa_utils.o: $(srcdir)/src/osx/cocoa/utils.mm $(BASELIB_ODEP) @COND_PLATFORM_MACOSX_1@baselib_threadpsx.o: $(srcdir)/src/unix/threadpsx.cpp $(BASELIB_ODEP) @COND_PLATFORM_MACOSX_1@ $(CXXC) -c -o $@ $(BASELIB_CXXFLAGS) $(srcdir)/src/unix/threadpsx.cpp -@COND_PLATFORM_UNIX_1@baselib_unix_stackwalk.o: $(srcdir)/src/unix/stackwalk.cpp $(BASELIB_ODEP) -@COND_PLATFORM_UNIX_1@ $(CXXC) -c -o $@ $(BASELIB_CXXFLAGS) $(srcdir)/src/unix/stackwalk.cpp - -@COND_PLATFORM_MACOSX_1@baselib_unix_stackwalk.o: $(srcdir)/src/unix/stackwalk.cpp $(BASELIB_ODEP) -@COND_PLATFORM_MACOSX_1@ $(CXXC) -c -o $@ $(BASELIB_CXXFLAGS) $(srcdir)/src/unix/stackwalk.cpp - @COND_PLATFORM_UNIX_1@baselib_utilsunx.o: $(srcdir)/src/unix/utilsunx.cpp $(BASELIB_ODEP) @COND_PLATFORM_UNIX_1@ $(CXXC) -c -o $@ $(BASELIB_CXXFLAGS) $(srcdir)/src/unix/utilsunx.cpp diff --git a/build/bakefiles/files.bkl b/build/bakefiles/files.bkl index 1d010c2e89..308355868d 100644 --- a/build/bakefiles/files.bkl +++ b/build/bakefiles/files.bkl @@ -63,6 +63,7 @@ IMPORTANT: please read docs/tech/tn0016.txt before modifying this file! src/unix/evtloopunix.cpp src/unix/dir.cpp src/unix/dlunix.cpp + src/unix/fdiounix.cpp src/unix/snglinst.cpp src/unix/stdpaths.cpp src/unix/timerunx.cpp diff --git a/include/wx/os2/apptbase.h b/include/wx/os2/apptbase.h index 5916fda07d..d1b9b494bd 100644 --- a/include/wx/os2/apptbase.h +++ b/include/wx/os2/apptbase.h @@ -27,11 +27,9 @@ public: // Clean up message queue. virtual void TerminateGui(unsigned long ulHab); + #if wxUSE_SOCKETS - // returns the select()-based socket manager for console applications which - // is also used by some ports (wxX11, wxDFB) in the GUI build (hence it is - // here and not in wxConsoleAppTraits) - virtual wxSocketManager *GetSocketManager(); + virtual wxFDIOManager *GetFDIOManager(); #endif }; diff --git a/include/wx/os2/apptrait.h b/include/wx/os2/apptrait.h index 4038e88094..2cdb32a4a8 100644 --- a/include/wx/os2/apptrait.h +++ b/include/wx/os2/apptrait.h @@ -50,7 +50,7 @@ public: virtual wxString GetDesktopEnvironment() const; #endif #if wxUSE_SOCKETS - virtual wxSocketManager *GetSocketManager(); + virtual wxFDIOManager *GetFDIOManager(); #endif }; diff --git a/include/wx/private/fdiodispatcher.h b/include/wx/private/fdiodispatcher.h index f37e0217a4..e3fad1cc79 100644 --- a/include/wx/private/fdiodispatcher.h +++ b/include/wx/private/fdiodispatcher.h @@ -12,23 +12,7 @@ #define _WX_PRIVATE_FDIODISPATCHER_H_ #include "wx/hashmap.h" - -// handler used to process events on descriptors -class wxFDIOHandler -{ -public: - // called when descriptor is available for non-blocking read - virtual void OnReadWaiting() = 0; - - // called when descriptor is available for non-blocking write - virtual void OnWriteWaiting() = 0; - - // called when there is exception on descriptor - virtual void OnExceptionWaiting() = 0; - - // virtual dtor for the base class - virtual ~wxFDIOHandler() { } -}; +#include "wx/private/fdiohandler.h" // those flags describes sets where descriptor should be added enum wxFDIODispatcherEntryFlags diff --git a/include/wx/private/fdiohandler.h b/include/wx/private/fdiohandler.h new file mode 100644 index 0000000000..ad5f6b8f71 --- /dev/null +++ b/include/wx/private/fdiohandler.h @@ -0,0 +1,54 @@ +/////////////////////////////////////////////////////////////////////////////// +// Name: wx/private/fdiohandler.h +// Purpose: declares wxFDIOHandler class +// Author: Vadim Zeitlin +// Created: 2009-08-17 +// RCS-ID: $Id: wxhead.h,v 1.11 2009-06-29 10:23:04 zeitlin Exp $ +// Copyright: (c) 2009 Vadim Zeitlin +// Licence: wxWindows licence +/////////////////////////////////////////////////////////////////////////////// + +#ifndef _WX_PRIVATE_FDIOHANDLER_H_ +#define _WX_PRIVATE_FDIOHANDLER_H_ + +// ---------------------------------------------------------------------------- +// wxFDIOHandler: interface used to process events on file descriptors +// ---------------------------------------------------------------------------- + +class wxFDIOHandler +{ +public: + wxFDIOHandler() { m_regmask = 0; } + + // called when descriptor is available for non-blocking read + virtual void OnReadWaiting() = 0; + + // called when descriptor is available for non-blocking write + virtual void OnWriteWaiting() = 0; + + // called when there is exception on descriptor + virtual void OnExceptionWaiting() = 0; + + // called to check if the handler is still valid, only used by + // wxSocketImplUnix currently + virtual bool IsOk() const { return true; } + + + // get/set the mask of events for which we're currently registered for: + // it's a combination of wxFDIO_{INPUT,OUTPUT,EXCEPTION} + int GetRegisteredEvents() const { return m_regmask; } + void SetRegisteredEvent(int flag) { m_regmask |= flag; } + void ClearRegisteredEvent(int flag) { m_regmask &= ~flag; } + + + // virtual dtor for the base class + virtual ~wxFDIOHandler() { } + +private: + int m_regmask; + + wxDECLARE_NO_COPY_CLASS(wxFDIOHandler); +}; + +#endif // _WX_PRIVATE_FDIOHANDLER_H_ + diff --git a/include/wx/private/fdiomanager.h b/include/wx/private/fdiomanager.h new file mode 100644 index 0000000000..764f4bdc46 --- /dev/null +++ b/include/wx/private/fdiomanager.h @@ -0,0 +1,43 @@ +/////////////////////////////////////////////////////////////////////////////// +// Name: wx/private/fdiomanager.h +// Purpose: declaration of wxFDIOManager +// Author: Vadim Zeitlin +// Created: 2009-08-17 +// RCS-ID: $Id: wxhead.h,v 1.11 2009-06-29 10:23:04 zeitlin Exp $ +// Copyright: (c) 2009 Vadim Zeitlin +// Licence: wxWindows licence +/////////////////////////////////////////////////////////////////////////////// + +#ifndef _WX_PRIVATE_FDIOMANAGER_H_ +#define _WX_PRIVATE_FDIOMANAGER_H_ + +#include "wx/private/fdiohandler.h" + +// ---------------------------------------------------------------------------- +// wxFDIOManager: register or unregister wxFDIOHandlers +// ---------------------------------------------------------------------------- + +// currently only used in wxGTK and wxMotif, see wx/unix/apptrait.h + +class wxFDIOManager +{ +public: + // identifies either input or output direction + // + // NB: the values of this enum shouldn't change + enum Direction + { + INPUT, + OUTPUT + }; + + // start or stop monitoring the events on the given file descriptor + virtual int AddInput(wxFDIOHandler *handler, int fd, Direction d) = 0; + virtual void RemoveInput(wxFDIOHandler *handler, int fd, Direction d) = 0; + + // empty but virtual dtor for the base class + virtual ~wxFDIOManager() { } +}; + +#endif // _WX_PRIVATE_FDIOMANAGER_H_ + diff --git a/include/wx/private/socket.h b/include/wx/private/socket.h index 936eb13b5e..89a5bd0004 100644 --- a/include/wx/private/socket.h +++ b/include/wx/private/socket.h @@ -139,6 +139,9 @@ public: virtual void OnExit() = 0; + // create the socket implementation object matching this manager + virtual wxSocketImpl *CreateSocket(wxSocketBase& wxsocket) = 0; + // these functions enable or disable monitoring of the given socket for the // specified events inside the currently running event loop (but notice // that both BSD and Winsock implementations actually use socket->m_server @@ -167,16 +170,12 @@ private: Base class for all socket implementations providing functionality common to BSD and Winsock sockets. - Objects of this class are not created directly but only via its static - Create() method which is implemented in port-specific code. + Objects of this class are not created directly but only via the factory + function wxSocketManager::CreateSocket(). */ class wxSocketImpl { public: - // static factory function: creates the low-level socket associated with - // the given wxSocket (and inherits its attributes such as timeout) - static wxSocketImpl *Create(wxSocketBase& wxsocket); - virtual ~wxSocketImpl(); // set various socket properties: all of those can only be called before diff --git a/include/wx/unix/apptbase.h b/include/wx/unix/apptbase.h index 4ec132c140..8bf6b4cb97 100644 --- a/include/wx/unix/apptbase.h +++ b/include/wx/unix/apptbase.h @@ -14,6 +14,7 @@ struct wxEndProcessData; struct wxExecuteData; +class wxFDIOManager; // ---------------------------------------------------------------------------- // wxAppTraits: the Unix version adds extra hooks needed by Unix code @@ -42,6 +43,18 @@ public: // loop virtual int AddProcessCallback(wxEndProcessData *data, int fd); +#if wxUSE_SOCKETS + // return a pointer to the object which should be used to integrate + // monitoring of the file descriptors to the event loop (currently this is + // used for the sockets only but should be used for arbitrary event loop + // sources in the future) + // + // this object may be different for the console and GUI applications + // + // the pointer is not deleted by the caller as normally it points to a + // static variable + virtual wxFDIOManager *GetFDIOManager(); +#endif // wxUSE_SOCKETS protected: // a helper for the implementation of WaitForChild() in wxGUIAppTraits: diff --git a/include/wx/unix/apptrait.h b/include/wx/unix/apptrait.h index b8dd8e4abf..5242f493d8 100644 --- a/include/wx/unix/apptrait.h +++ b/include/wx/unix/apptrait.h @@ -35,16 +35,17 @@ public: // // TODO: Should we use XtAddInput() for wxX11 too? Or, vice versa, if there is // no advantage in doing this compared to the generic way currently used -// by wxX11, should we continue to use GTK/Motif- specific stuff? +// by wxX11, should we continue to use GTK/Motif-specific stuff? #if defined(__WXGTK__) || defined(__WXMOTIF__) + #define wxHAS_GUI_FDIOMANAGER + #define wxHAS_GUI_PROCESS_CALLBACKS +#endif // ports using wxFDIOManager + +#if defined(__WXMAC__) #define wxHAS_GUI_PROCESS_CALLBACKS #define wxHAS_GUI_SOCKET_MANAGER #endif -#ifdef __DARWIN__ - #define wxHAS_GUI_PROCESS_CALLBACKS -#endif - class WXDLLIMPEXP_CORE wxGUIAppTraits : public wxGUIAppTraitsBase { public: @@ -80,9 +81,17 @@ public: virtual bool ShowAssertDialog(const wxString& msg); #endif -#if wxUSE_SOCKETS && defined(wxHAS_GUI_SOCKET_MANAGER) +#if wxUSE_SOCKETS + +#ifdef wxHAS_GUI_SOCKET_MANAGER virtual wxSocketManager *GetSocketManager(); #endif + +#ifdef wxHAS_GUI_FDIOMANAGER + virtual wxFDIOManager *GetFDIOManager(); +#endif + +#endif // wxUSE_SOCKETS }; #endif // wxUSE_GUI diff --git a/include/wx/unix/private/fdiounix.h b/include/wx/unix/private/fdiounix.h new file mode 100644 index 0000000000..fa864486f3 --- /dev/null +++ b/include/wx/unix/private/fdiounix.h @@ -0,0 +1,28 @@ +/////////////////////////////////////////////////////////////////////////////// +// Name: wx/unix/private/fdiounix.h +// Purpose: wxFDIOManagerUnix class used by console Unix applications +// Author: Vadim Zeitlin +// Created: 2009-08-17 +// RCS-ID: $Id: wxhead.h,v 1.11 2009-06-29 10:23:04 zeitlin Exp $ +// Copyright: (c) 2009 Vadim Zeitlin +// Licence: wxWindows licence +/////////////////////////////////////////////////////////////////////////////// + +#ifndef _UNIX_PRIVATE_FDIOUNIX_H_ +#define _UNIX_PRIVATE_FDIOUNIX_H_ + +#include "wx/private/fdiomanager.h" + +// ---------------------------------------------------------------------------- +// wxFDIOManagerUnix: implement wxFDIOManager interface using wxFDIODispatcher +// ---------------------------------------------------------------------------- + +class wxFDIOManagerUnix : public wxFDIOManager +{ +public: + virtual int AddInput(wxFDIOHandler *handler, int fd, Direction d); + virtual void RemoveInput(wxFDIOHandler *handler, int fd, Direction d); +}; + +#endif // _UNIX_PRIVATE_FDIOUNIX_H_ + diff --git a/include/wx/unix/private/sockunix.h b/include/wx/unix/private/sockunix.h index 2531060364..63fc0d885d 100644 --- a/include/wx/unix/private/sockunix.h +++ b/include/wx/unix/private/sockunix.h @@ -14,7 +14,7 @@ #include #include -#include "wx/private/fdiodispatcher.h" +#include "wx/private/fdiomanager.h" class wxSocketImplUnix : public wxSocketImpl, public wxFDIOHandler @@ -25,8 +25,6 @@ public: { m_fds[0] = m_fds[1] = -1; - - m_enabledCallbacks = 0; } virtual wxSocketError GetLastError() const; @@ -52,14 +50,7 @@ public: virtual void OnReadWaiting(); virtual void OnWriteWaiting(); virtual void OnExceptionWaiting(); - - // Unix-specific functions used by wxSocketFDIOManager only - bool HasAnyEnabledCallbacks() const { return m_enabledCallbacks != 0; } - void EnableCallback(wxFDIODispatcherEntryFlags flag) - { m_enabledCallbacks |= flag; } - void DisableCallback(wxFDIODispatcherEntryFlags flag) - { m_enabledCallbacks &= ~flag; } - int GetEnabledCallbacks() const { return m_enabledCallbacks; } + virtual bool IsOk() const { return m_fd != INVALID_SOCKET; } private: virtual void DoClose() @@ -91,10 +82,6 @@ protected: // with the socket int m_fds[2]; - // the events which are currently enabled for this socket, combination of - // wxFDIO_INPUT and wxFDIO_OUTPUT values - int m_enabledCallbacks; - private: // notify the associated wxSocket about a change in socket state and shut // down the socket if the event is wxSOCKET_LOST @@ -109,103 +96,42 @@ private: friend class wxSocketFDBasedManager; }; -// A version of wxSocketManager which uses FDs for socket IO +// A version of wxSocketManager which uses FDs for socket IO: it is used by +// Unix console applications and some X11-like ports (wxGTK and wxMotif but not +// wxX11 currently) which implement their own port-specific wxFDIOManagers class wxSocketFDBasedManager : public wxSocketManager { public: - // no special initialization/cleanup needed when using FDs - virtual bool OnInit() { return true; } - virtual void OnExit() { } - -protected: - // identifies either input or output direction - // - // NB: the values of this enum shouldn't change - enum SocketDir + wxSocketFDBasedManager() { - FD_INPUT, - FD_OUTPUT - }; - - // get the FD index corresponding to the given wxSocketNotify - SocketDir GetDirForEvent(wxSocketImpl *socket, wxSocketNotify event) - { - switch ( event ) - { - default: - wxFAIL_MSG( "unknown socket event" ); - return FD_INPUT; // we must return something - - case wxSOCKET_LOST: - wxFAIL_MSG( "unexpected socket event" ); - return FD_INPUT; // as above - - case wxSOCKET_INPUT: - return FD_INPUT; - - case wxSOCKET_OUTPUT: - return FD_OUTPUT; - - case wxSOCKET_CONNECTION: - // for server sockets we're interested in events indicating - // that a new connection is pending, i.e. that accept() will - // succeed and this is indicated by socket becoming ready for - // reading, while for the other ones we're interested in the - // completion of non-blocking connect() which is indicated by - // the socket becoming ready for writing - return socket->IsServer() ? FD_INPUT : FD_OUTPUT; - } + m_fdioManager = NULL; } + virtual bool OnInit(); + virtual void OnExit() { } + + virtual wxSocketImpl *CreateSocket(wxSocketBase& wxsocket) + { + return new wxSocketImplUnix(wxsocket); + } + + virtual void Install_Callback(wxSocketImpl *socket_, wxSocketNotify event); + virtual void Uninstall_Callback(wxSocketImpl *socket_, wxSocketNotify event); + +protected: + // get the FD index corresponding to the given wxSocketNotify + wxFDIOManager::Direction + GetDirForEvent(wxSocketImpl *socket, wxSocketNotify event); + // access the FDs we store - int& FD(wxSocketImplUnix *socket, SocketDir d) + int& FD(wxSocketImplUnix *socket, wxFDIOManager::Direction d) { return socket->m_fds[d]; } -}; -// Common base class for all ports using X11-like (and hence implemented in -// X11, Motif and GTK) AddInput() and RemoveInput() functions -class wxSocketInputBasedManager : public wxSocketFDBasedManager -{ -public: - virtual void Install_Callback(wxSocketImpl *socket_, wxSocketNotify event) - { - wxSocketImplUnix * const - socket = static_cast(socket_); + wxFDIOManager *m_fdioManager; - wxCHECK_RET( socket->m_fd != -1, - "shouldn't be called on invalid socket" ); - - const SocketDir d = GetDirForEvent(socket, event); - - int& fd = FD(socket, d); - if ( fd != -1 ) - RemoveInput(fd); - - fd = AddInput(socket, socket->m_fd, d); - } - - virtual void Uninstall_Callback(wxSocketImpl *socket_, wxSocketNotify event) - { - wxSocketImplUnix * const - socket = static_cast(socket_); - - const SocketDir d = GetDirForEvent(socket, event); - - int& fd = FD(socket, d); - if ( fd != -1 ) - { - RemoveInput(fd); - fd = -1; - } - } - -private: - // these functions map directly to XtAdd/RemoveInput() or - // gdk_input_add/remove() - virtual int AddInput(wxFDIOHandler *handler, int fd, SocketDir d) = 0; - virtual void RemoveInput(int fd) = 0; + wxDECLARE_NO_COPY_CLASS(wxSocketFDBasedManager); }; #endif /* _WX_UNIX_GSOCKUNX_H_ */ diff --git a/samples/sockets/server.cpp b/samples/sockets/server.cpp index b7063e93d0..0e06ea8914 100644 --- a/samples/sockets/server.cpp +++ b/samples/sockets/server.cpp @@ -2,10 +2,10 @@ // Name: server.cpp // Purpose: Server for wxSocket demo // Author: Guillermo Rodriguez Garcia -// Modified by: // Created: 1999/09/19 // RCS-ID: $Id$ // Copyright: (c) 1999 Guillermo Rodriguez Garcia +// (c) 2009 Vadim Zeitlin // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// @@ -29,6 +29,7 @@ # include "wx/wx.h" #endif +#include "wx/busyinfo.h" #include "wx/socket.h" // -------------------------------------------------------------------------- @@ -57,6 +58,8 @@ public: ~MyFrame(); // event handlers (these functions should _not_ be virtual) + void OnUDPTest(wxCommandEvent& event); + void OnWaitForAccept(wxCommandEvent& event); void OnQuit(wxCommandEvent& event); void OnAbout(wxCommandEvent& event); void OnServerEvent(wxSocketEvent& event); @@ -107,6 +110,8 @@ private: enum { // menu items + SERVER_UDPTEST = 10, + SERVER_WAITFORACCEPT, SERVER_QUIT = wxID_EXIT, SERVER_ABOUT = wxID_ABOUT, @@ -122,6 +127,8 @@ enum BEGIN_EVENT_TABLE(MyFrame, wxFrame) EVT_MENU(SERVER_QUIT, MyFrame::OnQuit) EVT_MENU(SERVER_ABOUT, MyFrame::OnAbout) + EVT_MENU(SERVER_UDPTEST, MyFrame::OnUDPTest) + EVT_MENU(SERVER_WAITFORACCEPT, MyFrame::OnWaitForAccept) EVT_SOCKET(SERVER_ID, MyFrame::OnServerEvent) EVT_SOCKET(SOCKET_ID, MyFrame::OnSocketEvent) END_EVENT_TABLE() @@ -168,6 +175,9 @@ MyFrame::MyFrame() : wxFrame((wxFrame *)NULL, wxID_ANY, // Make menus m_menuFile = new wxMenu(); + m_menuFile->Append(SERVER_WAITFORACCEPT, "&Wait for connection\tCtrl-W"); + m_menuFile->Append(SERVER_UDPTEST, "&UDP test\tCtrl-U"); + m_menuFile->AppendSeparator(); m_menuFile->Append(SERVER_ABOUT, _("&About...\tCtrl-A"), _("Show about dialog")); m_menuFile->AppendSeparator(); m_menuFile->Append(SERVER_QUIT, _("E&xit\tAlt-X"), _("Quit server")); @@ -242,6 +252,57 @@ void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event)) wxOK | wxICON_INFORMATION, this); } +void MyFrame::OnUDPTest(wxCommandEvent& WXUNUSED(event)) +{ + TestLogger logtest("UDP test"); + +#if wxUSE_IPV6 + wxIPV6address addr; +#else + wxIPV4address addr; +#endif + addr.Service(3000); + wxDatagramSocket sock(addr); + + char buf[1024]; + size_t n = sock.RecvFrom(addr, buf, sizeof(buf)).LastCount(); + if ( !n ) + { + wxLogMessage("ERROR: failed to receive data"); + return; + } + + wxLogMessage("Received \"%s\" from %s:%u.", + wxString::From8BitData(buf, n), + addr.IPAddress(), addr.Service()); + + for ( size_t i = 0; i < n; i++ ) + { + char& c = buf[i]; + if ( (c >= 'A' && c <= 'M') || (c >= 'a' && c <= 'm') ) + c += 13; + else if ( (c >= 'N' && c <= 'Z') || (c >= 'n' && c <= 'z') ) + c -= 13; + } + + if ( sock.SendTo(addr, buf, n).LastCount() != n ) + { + wxLogMessage("ERROR: failed to send data"); + return; + } +} + +void MyFrame::OnWaitForAccept(wxCommandEvent& WXUNUSED(event)) +{ + TestLogger logtest("WaitForAccept() test"); + + wxBusyInfo("Waiting for connection for 10 seconds...", this); + if ( m_server->WaitForAccept(10) ) + wxLogMessage("Accepted client connection."); + else + wxLogMessage("Connection error or timeout expired."); +} + void MyFrame::Test1(wxSocketBase *sock) { TestLogger logtest("Test 1"); diff --git a/src/common/socket.cpp b/src/common/socket.cpp index 3227bdb429..b196fc0121 100644 --- a/src/common/socket.cpp +++ b/src/common/socket.cpp @@ -527,7 +527,14 @@ wxSocketImpl *wxSocketImpl::Accept(wxSocketBase& wxsocket) if ( fd == INVALID_SOCKET ) return NULL; - wxSocketImpl * const sock = Create(wxsocket); + wxSocketManager * const manager = wxSocketManager::Get(); + if ( !manager ) + return NULL; + + wxSocketImpl * const sock = manager->CreateSocket(wxsocket); + if ( !sock ) + return NULL; + sock->m_fd = fd; sock->m_peer = wxSockAddressImpl(from.addr, fromlen); @@ -1348,8 +1355,10 @@ wxSocketBase::DoWait(long timeout, wxSocketEventFlags flags) { wxCHECK_MSG( m_impl, -1, "can't wait on invalid socket" ); - // we're never going to become ready if we're not connected (any more) - if ( !m_connected && !m_establishing ) + // we're never going to become ready in a client if we're not connected any + // more (OTOH a server can call this to precisely wait for a connection so + // do wait for it in this case) + if ( !m_impl->IsServer() && !m_connected && !m_establishing ) return -1; // This can be set to true from Interrupt() to exit this function a.s.a.p. @@ -1730,7 +1739,8 @@ wxSocketServer::wxSocketServer(const wxSockAddress& addr, { wxLogTrace( wxTRACE_Socket, _T("Opening wxSocketServer") ); - m_impl = wxSocketImpl::Create(*this); + wxSocketManager * const manager = wxSocketManager::Get(); + m_impl = manager ? manager->CreateSocket(*this) : NULL; if (!m_impl) { @@ -1888,7 +1898,8 @@ bool wxSocketClient::DoConnect(const wxSockAddress& remote, m_establishing = false; // Create and set up the new one - m_impl = wxSocketImpl::Create(*this); + wxSocketManager * const manager = wxSocketManager::Get(); + m_impl = manager ? manager->CreateSocket(*this) : NULL; if ( !m_impl ) return false; @@ -1970,7 +1981,8 @@ wxDatagramSocket::wxDatagramSocket( const wxSockAddress& addr, : wxSocketBase( flags, wxSOCKET_DATAGRAM ) { // Create the socket - m_impl = wxSocketImpl::Create(*this); + wxSocketManager * const manager = wxSocketManager::Get(); + m_impl = manager ? manager->CreateSocket(*this) : NULL; if (!m_impl) return; @@ -2055,4 +2067,14 @@ IMPLEMENT_DYNAMIC_CLASS(wxSocketModule, wxModule) wxFORCE_LINK_MODULE( socketiohandler ) #endif +// same for ManagerSetter in the MSW file +#ifdef __WXMSW__ + wxFORCE_LINK_MODULE( mswsocket ) +#endif + +// and for OSXManagerSetter in the OS X one +#ifdef __WXMAC__ + wxFORCE_LINK_MODULE( osxsocket ) +#endif + #endif // wxUSE_SOCKETS diff --git a/src/common/socketiohandler.cpp b/src/common/socketiohandler.cpp index 080532be0f..977b9fd027 100644 --- a/src/common/socketiohandler.cpp +++ b/src/common/socketiohandler.cpp @@ -20,83 +20,95 @@ // for compilers that support precompilation, includes "wx.h". #include "wx/wxprec.h" -#if wxUSE_SOCKETS && wxUSE_SELECT_DISPATCHER +#ifdef __BORLANDC__ + #pragma hdrstop +#endif +#if wxUSE_SOCKETS + +#include "wx/app.h" #include "wx/apptrait.h" #include "wx/private/socket.h" #include "wx/link.h" // ============================================================================ -// implementation +// wxSocketFDBasedManager implementation // ============================================================================ -// ---------------------------------------------------------------------------- -// wxSocketFDIOManager: socket manager using wxFDIODispatcher -// ---------------------------------------------------------------------------- - -class wxSocketFDIOManager : public wxSocketFDBasedManager +bool wxSocketFDBasedManager::OnInit() { -public: - virtual void Install_Callback(wxSocketImpl *socket, wxSocketNotify event); - virtual void Uninstall_Callback(wxSocketImpl *socket, wxSocketNotify event); -}; + wxAppTraits * const traits = wxApp::GetTraitsIfExists(); + if ( !traits ) + return false; -void wxSocketFDIOManager::Install_Callback(wxSocketImpl *socket_, - wxSocketNotify event) -{ - wxSocketImplUnix * const socket = static_cast(socket_); - - const int fd = socket->m_fd; - - if ( fd == -1 ) - return; - - const SocketDir d = GetDirForEvent(socket, event); - - wxFDIODispatcher * const dispatcher = wxFDIODispatcher::Get(); - if ( !dispatcher ) - return; - - FD(socket, d) = fd; - - // register it when it's used for the first time, update it if it had been - // previously registered - const bool alreadyRegistered = socket->HasAnyEnabledCallbacks(); - - socket->EnableCallback(d == FD_INPUT ? wxFDIO_INPUT : wxFDIO_OUTPUT); - - if ( alreadyRegistered ) - dispatcher->ModifyFD(fd, socket, socket->GetEnabledCallbacks()); - else - dispatcher->RegisterFD(fd, socket, socket->GetEnabledCallbacks()); + m_fdioManager = traits->GetFDIOManager(); + return m_fdioManager != NULL; } -void wxSocketFDIOManager::Uninstall_Callback(wxSocketImpl *socket_, - wxSocketNotify event) +void wxSocketFDBasedManager::Install_Callback(wxSocketImpl *socket_, + wxSocketNotify event) { - wxSocketImplUnix * const socket = static_cast(socket_); + wxSocketImplUnix * const + socket = static_cast(socket_); - const SocketDir d = GetDirForEvent(socket, event); + wxCHECK_RET( socket->m_fd != -1, + "shouldn't be called on invalid socket" ); - const int fd = FD(socket, d); - if ( fd == -1 ) - return; + const wxFDIOManager::Direction d = GetDirForEvent(socket, event); - FD(socket, d) = -1; + int& fd = FD(socket, d); + if ( fd != -1 ) + m_fdioManager->RemoveInput(socket, fd, d); - const wxFDIODispatcherEntryFlags - flag = d == FD_INPUT ? wxFDIO_INPUT : wxFDIO_OUTPUT; + fd = m_fdioManager->AddInput(socket, socket->m_fd, d); +} - wxFDIODispatcher * const dispatcher = wxFDIODispatcher::Get(); - if ( !dispatcher ) - return; +void wxSocketFDBasedManager::Uninstall_Callback(wxSocketImpl *socket_, + wxSocketNotify event) +{ + wxSocketImplUnix * const + socket = static_cast(socket_); - socket->DisableCallback(flag); + const wxFDIOManager::Direction d = GetDirForEvent(socket, event); - if ( !socket->HasAnyEnabledCallbacks() ) - dispatcher->UnregisterFD(fd); - else - dispatcher->ModifyFD(fd, socket, socket->GetEnabledCallbacks()); + int& fd = FD(socket, d); + if ( fd != -1 ) + { + m_fdioManager->RemoveInput(socket, fd, d); + fd = -1; + } +} + +wxFDIOManager::Direction +wxSocketFDBasedManager::GetDirForEvent(wxSocketImpl *socket, + wxSocketNotify event) +{ + switch ( event ) + { + default: + wxFAIL_MSG( "unknown socket event" ); + return wxFDIOManager::INPUT; // we must return something + + case wxSOCKET_LOST: + wxFAIL_MSG( "unexpected socket event" ); + return wxFDIOManager::INPUT; // as above + + case wxSOCKET_INPUT: + return wxFDIOManager::INPUT; + + case wxSOCKET_OUTPUT: + return wxFDIOManager::OUTPUT; + + case wxSOCKET_CONNECTION: + // for server sockets we're interested in events indicating + // that a new connection is pending, i.e. that accept() will + // succeed and this is indicated by socket becoming ready for + // reading, while for the other ones we're interested in the + // completion of non-blocking connect() which is indicated by + // the socket becoming ready for writing + return socket->IsServer() ? wxFDIOManager::INPUT + : wxFDIOManager::OUTPUT; + } } // set the wxBase variable to point to our wxSocketManager implementation @@ -107,7 +119,7 @@ static struct ManagerSetter { ManagerSetter() { - static wxSocketFDIOManager s_manager; + static wxSocketFDBasedManager s_manager; wxAppTraits::SetDefaultSocketManager(&s_manager); } } gs_managerSetter; diff --git a/src/gtk/sockgtk.cpp b/src/gtk/sockgtk.cpp index ae2225a6a1..71d26ace50 100644 --- a/src/gtk/sockgtk.cpp +++ b/src/gtk/sockgtk.cpp @@ -5,6 +5,7 @@ // Created: 1999 // RCS-ID: $Id$ // Copyright: (c) 1999, 2007 wxWidgets dev team +// (c) 2009 Vadim Zeitlin // Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////// @@ -13,14 +14,11 @@ #if wxUSE_SOCKETS -#include -#include - #include #include -#include "wx/private/socket.h" #include "wx/apptrait.h" +#include "wx/private/fdiomanager.h" extern "C" { static @@ -31,35 +29,45 @@ void wxSocket_GDK_Input(gpointer data, wxFDIOHandler * const handler = static_cast(data); if ( condition & GDK_INPUT_READ ) + { handler->OnReadWaiting(); + + // we could have lost connection while reading in which case we + // shouldn't call OnWriteWaiting() as the socket is now closed and it + // would assert + if ( !handler->IsOk() ) + return; + } + if ( condition & GDK_INPUT_WRITE ) handler->OnWriteWaiting(); } } -class GTKSocketManager : public wxSocketInputBasedManager +class GTKFDIOManager : public wxFDIOManager { public: - virtual int AddInput(wxFDIOHandler *handler, int fd, SocketDir d) + virtual int AddInput(wxFDIOHandler *handler, int fd, Direction d) { return gdk_input_add ( fd, - d == FD_OUTPUT ? GDK_INPUT_WRITE : GDK_INPUT_READ, + d == OUTPUT ? GDK_INPUT_WRITE : GDK_INPUT_READ, wxSocket_GDK_Input, handler ); } - virtual void RemoveInput(int fd) + virtual void + RemoveInput(wxFDIOHandler* WXUNUSED(handler), int fd, Direction WXUNUSED(d)) { gdk_input_remove(fd); } }; -wxSocketManager *wxGUIAppTraits::GetSocketManager() +wxFDIOManager *wxGUIAppTraits::GetFDIOManager() { - static GTKSocketManager s_manager; + static GTKFDIOManager s_manager; return &s_manager; } diff --git a/src/gtk1/sockgtk.cpp b/src/gtk1/sockgtk.cpp index ae2225a6a1..71d26ace50 100644 --- a/src/gtk1/sockgtk.cpp +++ b/src/gtk1/sockgtk.cpp @@ -5,6 +5,7 @@ // Created: 1999 // RCS-ID: $Id$ // Copyright: (c) 1999, 2007 wxWidgets dev team +// (c) 2009 Vadim Zeitlin // Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////// @@ -13,14 +14,11 @@ #if wxUSE_SOCKETS -#include -#include - #include #include -#include "wx/private/socket.h" #include "wx/apptrait.h" +#include "wx/private/fdiomanager.h" extern "C" { static @@ -31,35 +29,45 @@ void wxSocket_GDK_Input(gpointer data, wxFDIOHandler * const handler = static_cast(data); if ( condition & GDK_INPUT_READ ) + { handler->OnReadWaiting(); + + // we could have lost connection while reading in which case we + // shouldn't call OnWriteWaiting() as the socket is now closed and it + // would assert + if ( !handler->IsOk() ) + return; + } + if ( condition & GDK_INPUT_WRITE ) handler->OnWriteWaiting(); } } -class GTKSocketManager : public wxSocketInputBasedManager +class GTKFDIOManager : public wxFDIOManager { public: - virtual int AddInput(wxFDIOHandler *handler, int fd, SocketDir d) + virtual int AddInput(wxFDIOHandler *handler, int fd, Direction d) { return gdk_input_add ( fd, - d == FD_OUTPUT ? GDK_INPUT_WRITE : GDK_INPUT_READ, + d == OUTPUT ? GDK_INPUT_WRITE : GDK_INPUT_READ, wxSocket_GDK_Input, handler ); } - virtual void RemoveInput(int fd) + virtual void + RemoveInput(wxFDIOHandler* WXUNUSED(handler), int fd, Direction WXUNUSED(d)) { gdk_input_remove(fd); } }; -wxSocketManager *wxGUIAppTraits::GetSocketManager() +wxFDIOManager *wxGUIAppTraits::GetFDIOManager() { - static GTKSocketManager s_manager; + static GTKFDIOManager s_manager; return &s_manager; } diff --git a/src/motif/sockmot.cpp b/src/motif/sockmot.cpp index 7aaf341d51..7b5802743b 100644 --- a/src/motif/sockmot.cpp +++ b/src/motif/sockmot.cpp @@ -15,7 +15,7 @@ #include // XtAppAdd/RemoveInput() #include "wx/motif/private.h" // wxGetAppContext() -#include "wx/private/socket.h" +#include "wx/private/fdiomanager.h" #include "wx/apptrait.h" extern "C" { @@ -38,32 +38,33 @@ static void wxSocket_Motif_Output(XtPointer data, int *WXUNUSED(fid), } -class MotifSocketManager : public wxSocketInputBasedManager +class MotifFDIOManager : public wxFDIOManager { public: - virtual int AddInput(wxFDIOHandler *handler, int fd, SocketDir d) + virtual int AddInput(wxFDIOHandler *handler, int fd, Direction d) { return XtAppAddInput ( wxGetAppContext(), fd, - (XtPointer)(d == FD_OUTPUT ? XtInputWriteMask - : XtInputReadMask), - d == FD_OUTPUT ? wxSocket_Motif_Output - : wxSocket_Motif_Input, + (XtPointer)(d == OUTPUT ? XtInputWriteMask + : XtInputReadMask), + d == OUTPUT ? wxSocket_Motif_Output + : wxSocket_Motif_Input, handler ); } - virtual void RemoveInput(int fd) + virtual void + RemoveInput(wxFDIOHandler* WXUNUSED(handler), int fd, Direction WXUNUSED(d)) { XtRemoveInput(fd); } }; -wxSocketManager *wxGUIAppTraits::GetSocketManager() +wxFDIOManager *wxGUIAppTraits::GetFDIOManager() { - static MotifSocketManager s_manager; + static MotifFDIOManager s_manager; return &s_manager; } diff --git a/src/msw/sockmsw.cpp b/src/msw/sockmsw.cpp index bfac07191c..2712ccbbef 100644 --- a/src/msw/sockmsw.cpp +++ b/src/msw/sockmsw.cpp @@ -33,6 +33,7 @@ #include "wx/apptrait.h" #include "wx/thread.h" #include "wx/dynlib.h" +#include "wx/link.h" #ifdef __WXWINCE__ /* @@ -437,16 +438,13 @@ static struct ManagerSetter } } gs_managerSetter; +// see the relative linker macro in socket.cpp +wxFORCE_LINK_THIS_MODULE( mswsocket ); + // ============================================================================ // wxSocketImpl implementation // ============================================================================ -/* static */ -wxSocketImpl *wxSocketImpl::Create(wxSocketBase& wxsocket) -{ - return new wxSocketImplMSW(wxsocket); -} - void wxSocketImplMSW::DoClose() { wxSocketManager::Get()->Uninstall_Callback(this); diff --git a/src/os2/sockpm.cpp b/src/os2/sockpm.cpp index 341aedb239..53faa9522d 100644 --- a/src/os2/sockpm.cpp +++ b/src/os2/sockpm.cpp @@ -35,10 +35,12 @@ static void wxSocket_PM_Output(void *data) handler->OnWriteWaiting(); } -class PMSocketManager : public wxSocketInputBasedManager +class PMFDIOManager : public wxFDIOManager { public: - virtual int AddInput(wxFDIOHandler *handler, int fd, SocketDir d) + virtual int AddInput(wxFDIOHandler *handler, + int fd, + wxFDIOManager::Direction d) { if (d == FD_OUTPUT) return wxTheApp->AddSocketHandler(fd, wxSockWriteMask, @@ -48,15 +50,18 @@ public: wxSocket_PM_Input, handler); } - virtual void RemoveInput(int fd) + virtual void + RemoveInput(wxFDIOHandler * WXUNUSED(handler), + int fd, + wxFDIOManager::Direction WXUNUSED(dir)) { wxTheApp->RemoveSocketHandler(fd); } }; -wxSocketManager *wxGUIAppTraits::GetSocketManager() +wxFDIOManager *wxGUIAppTraits::GetFDIOManager() { - static PMSocketManager s_manager; + static PMFDIOManager s_manager; return &s_manager; } diff --git a/src/osx/cocoa/utils.mm b/src/osx/cocoa/utils.mm index 3fdecac375..194abcd750 100644 --- a/src/osx/cocoa/utils.mm +++ b/src/osx/cocoa/utils.mm @@ -52,7 +52,9 @@ void wxBell() void wxMacWakeUp() { - // TODO + NSEvent* wakeupEvent = [NSEvent otherEventWithType:NSApplicationDefined location:NSZeroPoint + modifierFlags:NSAnyEventMask timestamp:0 windowNumber:0 context:nil subtype:0 data1:0 data2:0]; + [NSApp postEvent:wakeupEvent atStart:NO]; } #endif // wxUSE_BASE diff --git a/src/osx/core/sockosx.cpp b/src/osx/core/sockosx.cpp index 917b821ce1..0b6b77d0e1 100644 --- a/src/osx/core/sockosx.cpp +++ b/src/osx/core/sockosx.cpp @@ -16,6 +16,9 @@ #include "wx/private/socket.h" #include "wx/unix/private/sockunix.h" #include "wx/apptrait.h" +#include "wx/link.h" + +#include "wx/osx/core/cfstring.h" // for wxMacWakeUp() only #include @@ -75,7 +78,10 @@ private: CFSocketInvalidate(m_socket); CFRelease(m_source); + m_source = NULL; + CFRelease(m_socket); + m_socket = NULL; } // initialize the data associated with the given socket @@ -110,6 +116,8 @@ private: if ( !m_source ) { CFRelease(m_socket); + m_socket = NULL; + return false; } @@ -151,6 +159,13 @@ private: default: wxFAIL_MSG( "unexpected socket callback" ); } + + // receiving a socket event does _not_ make ReceiveNextEvent() (or the + // equivalent NSApp:nextEventMatchingMask:untilDate:inMode:dequeue) + // return control, i.e. apparently it doesn't count as a real event, so + // we need to generate a wake up to return control to the code waiting + // for something to happen and process this socket event + wxMacWakeUp(); } CFSocketRef m_socket; @@ -254,17 +269,24 @@ void wxSocketManagerMac::Uninstall_Callback(wxSocketImpl *socket_, CFSocketDisableCallBacks(socket->GetSocket(), GetCFCallback(socket, event)); } -// set the wxBase variable to point to our wxSocketManager implementation +// set the wxBase variable to point to CF wxSocketManager implementation so +// that the GUI code in utilsexc_cf.cpp could return it from its traits method // -// see comments in wx/apptrait.h for the explanation of why do we do it -// like this -static struct ManagerSetter +// this is very roundabout but necessary to allow us to have different +// behaviours in console and GUI applications while avoiding dependencies of +// GUI library on the network one +extern WXDLLIMPEXP_BASE wxSocketManager *wxOSXSocketManagerCF; + +static struct OSXManagerSetter { - ManagerSetter() + OSXManagerSetter() { static wxSocketManagerMac s_manager; - wxAppTraits::SetDefaultSocketManager(&s_manager); + wxOSXSocketManagerCF = &s_manager; } -} gs_managerSetter; +} gs_OSXManagerSetter; + +// see the relative linker macro in socket.cpp +wxFORCE_LINK_THIS_MODULE( osxsocket ); #endif // wxUSE_SOCKETS diff --git a/src/osx/core/utilsexc_base.cpp b/src/osx/core/utilsexc_base.cpp index 38fe12a12d..27dea48f43 100644 --- a/src/osx/core/utilsexc_base.cpp +++ b/src/osx/core/utilsexc_base.cpp @@ -45,6 +45,15 @@ // Default path style #define kDefaultPathStyle kCFURLPOSIXPathStyle +#if wxUSE_SOCKETS +// global pointer which lives in the base library, set from the net one (see +// sockosx.cpp) and used from the GUI code (see utilsexc_cf.cpp) -- ugly but +// needed hack, see the above-mentioned files for more information +class wxSocketManager; +extern WXDLLIMPEXP_BASE wxSocketManager *wxOSXSocketManagerCF; +wxSocketManager *wxOSXSocketManagerCF = NULL; +#endif // wxUSE_SOCKETS + extern bool WXDLLEXPORT wxIsDebuggerRunning() { // TODO : try to find out ... diff --git a/src/osx/core/utilsexc_cf.cpp b/src/osx/core/utilsexc_cf.cpp index be96bcfb36..6653a9f466 100644 --- a/src/osx/core/utilsexc_cf.cpp +++ b/src/osx/core/utilsexc_cf.cpp @@ -116,3 +116,19 @@ wxStandardPathsBase& wxGUIAppTraits::GetStandardPaths() } #endif +#if wxUSE_SOCKETS + +// we need to implement this method in a file of the core library as it should +// only be used for the GUI applications but we can't use socket stuff from it +// directly as this would create unwanted dependencies of core on net library +// +// so we have this global pointer which is set from sockosx.cpp when it is +// linked in and we simply return it from here +extern WXDLLIMPEXP_BASE wxSocketManager *wxOSXSocketManagerCF; +wxSocketManager *wxGUIAppTraits::GetSocketManager() +{ + return wxOSXSocketManagerCF ? wxOSXSocketManagerCF + : wxGUIAppTraitsBase::GetSocketManager(); +} + +#endif // wxUSE_SOCKETS diff --git a/src/unix/fdiounix.cpp b/src/unix/fdiounix.cpp new file mode 100644 index 0000000000..efe7b8d4a0 --- /dev/null +++ b/src/unix/fdiounix.cpp @@ -0,0 +1,101 @@ +/////////////////////////////////////////////////////////////////////////////// +// Name: src/unix/fdiounix.cpp +// Purpose: wxFDIOManager implementation for console Unix applications +// Author: Vadim Zeitlin +// Created: 2009-08-17 +// RCS-ID: $Id: wxhead.cpp,v 1.10 2009-06-29 10:23:04 zeitlin Exp $ +// Copyright: (c) 2009 Vadim Zeitlin +// Licence: wxWindows licence +/////////////////////////////////////////////////////////////////////////////// + +// ============================================================================ +// declarations +// ============================================================================ + +// ---------------------------------------------------------------------------- +// headers +// ---------------------------------------------------------------------------- + +// for compilers that support precompilation, includes "wx.h". +#include "wx/wxprec.h" + +#ifdef __BORLANDC__ + #pragma hdrstop +#endif + +#include "wx/apptrait.h" +#include "wx/log.h" +#include "wx/private/fdiodispatcher.h" +#include "wx/unix/private/fdiounix.h" + +// ============================================================================ +// wxFDIOManagerUnix implementation +// ============================================================================ + +int wxFDIOManagerUnix::AddInput(wxFDIOHandler *handler, int fd, Direction d) +{ + wxFDIODispatcher * const dispatcher = wxFDIODispatcher::Get(); + wxCHECK_MSG( dispatcher, -1, "can't monitor FDs without FD IO dispatcher" ); + + // translate our direction to dispatcher flags + const int flag = d == INPUT ? wxFDIO_INPUT : wxFDIO_OUTPUT; + + // we need to either register this FD with the dispatcher or update an + // existing registration depending on whether it had been previously + // registered for anything or not + bool ok; + const int regmask = handler->GetRegisteredEvents(); + if ( !regmask ) + { + ok = dispatcher->RegisterFD(fd, handler, flag); + } + else + { + ok = dispatcher->ModifyFD(fd, handler, regmask | flag); + } + + if ( !ok ) + return -1; + + // update the stored mask of registered events + handler->SetRegisteredEvent(flag); + + return fd; +} + +void wxFDIOManagerUnix::RemoveInput(wxFDIOHandler *handler, int fd, Direction d) +{ + wxFDIODispatcher * const dispatcher = wxFDIODispatcher::Get(); + if ( !dispatcher ) + return; + + const int flag = d == INPUT ? wxFDIO_INPUT : wxFDIO_OUTPUT; + + // just as in AddInput() above we may need to either just modify the FD or + // remove it completely if we don't need to monitor it any more + bool ok; + const int regmask = handler->GetRegisteredEvents(); + if ( regmask == flag ) + { + ok = dispatcher->UnregisterFD(fd); + } + else + { + ok = dispatcher->ModifyFD(fd, handler, regmask & ~flag); + } + + if ( !ok ) + { + wxLogDebug("Failed to unregister %d in direction %d", fd, d); + } + + // do this even after a failure to unregister it, we still tried... + handler->ClearRegisteredEvent(flag); +} + +wxFDIOManager *wxAppTraits::GetFDIOManager() +{ + static wxFDIOManagerUnix s_manager; + return &s_manager; +} + diff --git a/src/unix/sockunix.cpp b/src/unix/sockunix.cpp index 51a158cab6..b2e298d83f 100644 --- a/src/unix/sockunix.cpp +++ b/src/unix/sockunix.cpp @@ -66,13 +66,6 @@ // wxSocketImpl implementation // ============================================================================ -/* static */ -wxSocketImpl *wxSocketImpl::Create(wxSocketBase& wxsocket) -{ - return new wxSocketImplUnix(wxsocket); -} - - wxSocketError wxSocketImplUnix::GetLastError() const { switch ( errno )