diff options
33 files changed, 450 insertions, 139 deletions
diff --git a/ChangeLog b/ChangeLog index 75f4c4a5217..051bff538e3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,73 @@ +Sat Jun 2 13:05:20 2001 Douglas C. Schmidt <schmidt@tango.doc.wustl.edu> + + * ace/Timer_Wheel_T.cpp: Since we removed the call to + is_empty() from earliest_time() we need to modify the code in + reschedule() to test for is_empty. + + * tests/Cached_Accept_Conn_Test.cpp (accept_svc_handler): Use the + ACE_Accept_Strategy::acceptor() accessor method rather than + accessing the acceptor_ directly. + + * TAO/rules.tao.GNU (TAO_IDL_DEP), + * include/makeinclude/rules.local.GNU: Added support for the new EXEEXT + Makefile macro. Thanks to Cristian Ferretti + <cristian_ferretti@yahoo.com> for pointing this out. + + * include/makeinclude/platform_gnuwin32_common.GNU: Added a number of + fixes for the mingw platform. Thanks to Cristian Ferretti + <cristian_ferretti@yahoo.com> for pointing this out. + + * ace/Configuration.{h,cpp}: "Un-inlined" the == and != operators for + the ACE_Configuration_Win32Registry class. + + * ace/Configuration.cpp (get_binary_value): Changed the type of "data" + from "unsigned char" to "BYTE". Thanks to Cristian Ferretti + <cristian_ferretti@yahoo.com> for pointing this out. + + * ace/config-win32-mingw.h: Removed the #define ACE_AS_STATIC_LIBS + macro. Thanks to Cristian Ferretti + <cristian_ferretti@yahoo.com> for pointing this out. + + * ace/config-win32-common.h: Protect certain DLL export macros with + #if !defined (__MINGW32__). Thanks to Cristian Ferretti + <cristian_ferretti@yahoo.com> for pointing this out. + + * ace/ACE.cpp (handle_timed_complete): Added an ACE_UNUSED_ARG + for the is_tli flag for ACE_WIN32 to keep the compiler happy. + Thanks to Cristian Ferretti <cristian_ferretti@yahoo.com> for + pointing this out. + + * ace/Acceptor.cpp: Fixed the comment and logic in + accept_svc_handler() so that it now cleans up the svc handler + whenever accept() returns -1. Thanks to Boris Temkin + <borist@allcharge.com> for suggesting this and to Irfan for + helping clarify what needed to be done. + + * ace/Strategies_T.cpp: When the number of clients + connecting to a server exceeds the process handle limit the + server would busy loop. The ACE_Accept_Strategy + accept_svc_handler() method is called which (1) constructs a + handler and (2) attempts to accept the connection, which fails + (because there is no available handle). The handler is + destructed, but the connect request is still queued and so the + acceptor gets called back again.... and so on until one of the + client which is already connected disconnects and frees up a + descriptor. Changed the accept_svc_handler() method in + ACE_Accept_Strategy to close and reopen the connection when + accept() fails. A check is done to make sure address reuse is + set. So this fix will only work in case where it is set. Thanks + to Dominic Hughes <dominic@aersoft.ie> for this fix and to Irfan + for recognizing that it ought to be added to ACE_Accpt_Strategy. + + * ace/Strategies_T.cpp (open): Fixed the strategy acceptor so that it + uses non-blocking semantics to handle certain failure cases + correctly. This is a safe-guard against the race condition that + can otherwise occur between the time when <select> indicates + that a passive-mode socket handle is "ready" and when we call + <accept>. During this interval, the client can shutdown the + connection, in which case, the <accept> call can hang! Thanks + to Irfan for pointing this out. + Fri Jun 1 13:04:31 2001 Douglas C. Schmidt <schmidt@tango.doc.wustl.edu> * ace/Makefile: diff --git a/ChangeLogs/ChangeLog-02a b/ChangeLogs/ChangeLog-02a index 75f4c4a5217..051bff538e3 100644 --- a/ChangeLogs/ChangeLog-02a +++ b/ChangeLogs/ChangeLog-02a @@ -1,3 +1,73 @@ +Sat Jun 2 13:05:20 2001 Douglas C. Schmidt <schmidt@tango.doc.wustl.edu> + + * ace/Timer_Wheel_T.cpp: Since we removed the call to + is_empty() from earliest_time() we need to modify the code in + reschedule() to test for is_empty. + + * tests/Cached_Accept_Conn_Test.cpp (accept_svc_handler): Use the + ACE_Accept_Strategy::acceptor() accessor method rather than + accessing the acceptor_ directly. + + * TAO/rules.tao.GNU (TAO_IDL_DEP), + * include/makeinclude/rules.local.GNU: Added support for the new EXEEXT + Makefile macro. Thanks to Cristian Ferretti + <cristian_ferretti@yahoo.com> for pointing this out. + + * include/makeinclude/platform_gnuwin32_common.GNU: Added a number of + fixes for the mingw platform. Thanks to Cristian Ferretti + <cristian_ferretti@yahoo.com> for pointing this out. + + * ace/Configuration.{h,cpp}: "Un-inlined" the == and != operators for + the ACE_Configuration_Win32Registry class. + + * ace/Configuration.cpp (get_binary_value): Changed the type of "data" + from "unsigned char" to "BYTE". Thanks to Cristian Ferretti + <cristian_ferretti@yahoo.com> for pointing this out. + + * ace/config-win32-mingw.h: Removed the #define ACE_AS_STATIC_LIBS + macro. Thanks to Cristian Ferretti + <cristian_ferretti@yahoo.com> for pointing this out. + + * ace/config-win32-common.h: Protect certain DLL export macros with + #if !defined (__MINGW32__). Thanks to Cristian Ferretti + <cristian_ferretti@yahoo.com> for pointing this out. + + * ace/ACE.cpp (handle_timed_complete): Added an ACE_UNUSED_ARG + for the is_tli flag for ACE_WIN32 to keep the compiler happy. + Thanks to Cristian Ferretti <cristian_ferretti@yahoo.com> for + pointing this out. + + * ace/Acceptor.cpp: Fixed the comment and logic in + accept_svc_handler() so that it now cleans up the svc handler + whenever accept() returns -1. Thanks to Boris Temkin + <borist@allcharge.com> for suggesting this and to Irfan for + helping clarify what needed to be done. + + * ace/Strategies_T.cpp: When the number of clients + connecting to a server exceeds the process handle limit the + server would busy loop. The ACE_Accept_Strategy + accept_svc_handler() method is called which (1) constructs a + handler and (2) attempts to accept the connection, which fails + (because there is no available handle). The handler is + destructed, but the connect request is still queued and so the + acceptor gets called back again.... and so on until one of the + client which is already connected disconnects and frees up a + descriptor. Changed the accept_svc_handler() method in + ACE_Accept_Strategy to close and reopen the connection when + accept() fails. A check is done to make sure address reuse is + set. So this fix will only work in case where it is set. Thanks + to Dominic Hughes <dominic@aersoft.ie> for this fix and to Irfan + for recognizing that it ought to be added to ACE_Accpt_Strategy. + + * ace/Strategies_T.cpp (open): Fixed the strategy acceptor so that it + uses non-blocking semantics to handle certain failure cases + correctly. This is a safe-guard against the race condition that + can otherwise occur between the time when <select> indicates + that a passive-mode socket handle is "ready" and when we call + <accept>. During this interval, the client can shutdown the + connection, in which case, the <accept> call can hang! Thanks + to Irfan for pointing this out. + Fri Jun 1 13:04:31 2001 Douglas C. Schmidt <schmidt@tango.doc.wustl.edu> * ace/Makefile: diff --git a/ChangeLogs/ChangeLog-03a b/ChangeLogs/ChangeLog-03a index 75f4c4a5217..051bff538e3 100644 --- a/ChangeLogs/ChangeLog-03a +++ b/ChangeLogs/ChangeLog-03a @@ -1,3 +1,73 @@ +Sat Jun 2 13:05:20 2001 Douglas C. Schmidt <schmidt@tango.doc.wustl.edu> + + * ace/Timer_Wheel_T.cpp: Since we removed the call to + is_empty() from earliest_time() we need to modify the code in + reschedule() to test for is_empty. + + * tests/Cached_Accept_Conn_Test.cpp (accept_svc_handler): Use the + ACE_Accept_Strategy::acceptor() accessor method rather than + accessing the acceptor_ directly. + + * TAO/rules.tao.GNU (TAO_IDL_DEP), + * include/makeinclude/rules.local.GNU: Added support for the new EXEEXT + Makefile macro. Thanks to Cristian Ferretti + <cristian_ferretti@yahoo.com> for pointing this out. + + * include/makeinclude/platform_gnuwin32_common.GNU: Added a number of + fixes for the mingw platform. Thanks to Cristian Ferretti + <cristian_ferretti@yahoo.com> for pointing this out. + + * ace/Configuration.{h,cpp}: "Un-inlined" the == and != operators for + the ACE_Configuration_Win32Registry class. + + * ace/Configuration.cpp (get_binary_value): Changed the type of "data" + from "unsigned char" to "BYTE". Thanks to Cristian Ferretti + <cristian_ferretti@yahoo.com> for pointing this out. + + * ace/config-win32-mingw.h: Removed the #define ACE_AS_STATIC_LIBS + macro. Thanks to Cristian Ferretti + <cristian_ferretti@yahoo.com> for pointing this out. + + * ace/config-win32-common.h: Protect certain DLL export macros with + #if !defined (__MINGW32__). Thanks to Cristian Ferretti + <cristian_ferretti@yahoo.com> for pointing this out. + + * ace/ACE.cpp (handle_timed_complete): Added an ACE_UNUSED_ARG + for the is_tli flag for ACE_WIN32 to keep the compiler happy. + Thanks to Cristian Ferretti <cristian_ferretti@yahoo.com> for + pointing this out. + + * ace/Acceptor.cpp: Fixed the comment and logic in + accept_svc_handler() so that it now cleans up the svc handler + whenever accept() returns -1. Thanks to Boris Temkin + <borist@allcharge.com> for suggesting this and to Irfan for + helping clarify what needed to be done. + + * ace/Strategies_T.cpp: When the number of clients + connecting to a server exceeds the process handle limit the + server would busy loop. The ACE_Accept_Strategy + accept_svc_handler() method is called which (1) constructs a + handler and (2) attempts to accept the connection, which fails + (because there is no available handle). The handler is + destructed, but the connect request is still queued and so the + acceptor gets called back again.... and so on until one of the + client which is already connected disconnects and frees up a + descriptor. Changed the accept_svc_handler() method in + ACE_Accept_Strategy to close and reopen the connection when + accept() fails. A check is done to make sure address reuse is + set. So this fix will only work in case where it is set. Thanks + to Dominic Hughes <dominic@aersoft.ie> for this fix and to Irfan + for recognizing that it ought to be added to ACE_Accpt_Strategy. + + * ace/Strategies_T.cpp (open): Fixed the strategy acceptor so that it + uses non-blocking semantics to handle certain failure cases + correctly. This is a safe-guard against the race condition that + can otherwise occur between the time when <select> indicates + that a passive-mode socket handle is "ready" and when we call + <accept>. During this interval, the client can shutdown the + connection, in which case, the <accept> call can hang! Thanks + to Irfan for pointing this out. + Fri Jun 1 13:04:31 2001 Douglas C. Schmidt <schmidt@tango.doc.wustl.edu> * ace/Makefile: diff --git a/TAO/ChangeLogs/ChangeLog-02a b/TAO/ChangeLogs/ChangeLog-02a index d0100a0f7c1..e862e46cde3 100644 --- a/TAO/ChangeLogs/ChangeLog-02a +++ b/TAO/ChangeLogs/ChangeLog-02a @@ -1,3 +1,46 @@ +Sat Jun 2 13:41:50 2001 Douglas C. Schmidt <schmidt@tango.doc.wustl.edu> + + * tests/IDL_Test/generic_object.idl: Changed "THIS" and "THAT" to + "OT_THIS" and "OT_THAT" to avoid problems with mingw. Thanks to + Cristian Ferretti <cristian_ferretti@yahoo.com> for pointing + this out. + + * TAO_IDL/Makefile.FE: Added ACE_SHLIBS = -lACE. Thanks to + Cristian Ferretti <cristian_ferretti@yahoo.com> for pointing + this out. + + * TAO_IDL/Makefile.EXE: Changed the definition of + TAO_IDL_PREPROCESSOR so that it'll work on mingw. Thanks to + Cristian Ferretti <cristian_ferretti@yahoo.com> for pointing + this out. + + * TAO_IDL/Makefile.dependencies (tao_idl): Added support for the + new EXEEXT macro. Thanks to Cristian Ferretti + <cristian_ferretti@yahoo.com> for pointing this out. + + * TAO_IDL/include/idl.h: #undef "interface" so that mingw will + work correctly. Thanks to Cristian Ferretti + <cristian_ferretti@yahoo.com> for pointing this out. + + * TAO_IDL/be_include/be_extern.h: Added a forward decl of the + function set_be_global(). Thanks to Cristian Ferretti + <cristian_ferretti@yahoo.com> for pointing this out. + + * tao/tao/IIOP_Connector.cpp, + * tao/Strategies/SHMIOP_Connector.cpp: Replaced template instantiation + of "int" with "ACE_HANDLE" to work around problems with mingw. + Thanks to Cristian Ferretti <cristian_ferretti@yahoo.com> for + pointing this out. + + * tao/orbconf.h: Changed a check for _WIN32 to be a check for + _MSC_VER so that mingw will work properly. Thanks to Cristian + Ferretti <cristian_ferretti@yahoo.com> for pointing this out. + + * tao/DynamicInterface/Dynamic_Implementation.cpp (_create_stub): + Changed "interface" to "pinterface" to work around problems with + mingw. Thanks to Cristian Ferretti + <cristian_ferretti@yahoo.com> for pointing this out. + Sat Jun 2 09:23:11 2001 Balachandran Natarajan <bala@cs.wustl.edu> * orbsvcs/IFR_Service/ifr_adding_visitor.cpp: Fixed a Fuzz error. diff --git a/TAO/TAO_IDL/Makefile.EXE b/TAO/TAO_IDL/Makefile.EXE index 1dcf268c017..01be37353f2 100644 --- a/TAO/TAO_IDL/Makefile.EXE +++ b/TAO/TAO_IDL/Makefile.EXE @@ -49,7 +49,8 @@ CPPFLAGS += -Iinclude -Ibe_include -Ife ifeq ($(TAO_IDL_PREPROCESSOR),) CPPFLAGS += -DTAO_IDL_PREPROCESSOR=\"$(strip $(CXX))\" else - CPPFLAGS += -DTAO_IDL_PREPROCESSOR=\"$(TAO_IDL_PREPROCESSOR)\" + CPPFLAGS += \ + -DTAO_IDL_PREPROCESSOR=\"$(subst \,\\\\,$(TAO_IDL_PREPROCESSOR))\" endif # !def TAO_IDL_PREPROCESSOR #---------------------------------------------------------------------------- diff --git a/TAO/TAO_IDL/Makefile.FE b/TAO/TAO_IDL/Makefile.FE index 14cef61f21d..17a73c78ed8 100644 --- a/TAO/TAO_IDL/Makefile.FE +++ b/TAO/TAO_IDL/Makefile.FE @@ -79,6 +79,8 @@ FILES = fe/fe_declarator \ LSRC = $(addsuffix .cpp, $(FILES)) +ACE_SHLIBS = -lACE + #---------------------------------------------------------------------------- # Include macros and targets #---------------------------------------------------------------------------- diff --git a/TAO/TAO_IDL/Makefile.dependencies b/TAO/TAO_IDL/Makefile.dependencies index 9e0f6382ef6..5cb74a9cb22 100644 --- a/TAO/TAO_IDL/Makefile.dependencies +++ b/TAO/TAO_IDL/Makefile.dependencies @@ -28,7 +28,7 @@ endif ifeq ($(static_libs_only),0) tao_idl: libTAO_IDL_FE_DLL.$(SOEXT) libTAO_IDL_BE_DLL.$(SOEXT) - touch tao_idl; + touch tao_idl$(EXEEXT); libTAO_IDL_FE_DLL.$(SOEXT): @@ -37,7 +37,7 @@ libTAO_IDL_BE_DLL.$(SOEXT): else # static_libs_only == 1 tao_idl: libTAO_IDL_FE_DLL.a libTAO_IDL_BE_DLL.a - touch tao_idl; + touch tao_idl$(EXEEXT); libTAO_IDL_FE_DLL.a: diff --git a/TAO/TAO_IDL/be_include/be_extern.h b/TAO/TAO_IDL/be_include/be_extern.h index 7061766f553..db5cf3a479a 100644 --- a/TAO/TAO_IDL/be_include/be_extern.h +++ b/TAO/TAO_IDL/be_include/be_extern.h @@ -72,6 +72,7 @@ trademarks or registered trademarks of Sun Microsystems, Inc. // be_extern.h - Defines the BE part of the BE<->FE protocol extern TAO_IDL_BE_Export BE_GlobalData *be_global; +extern TAO_IDL_BE_Export BE_GlobalData *set_be_global (BE_GlobalData *bg); // Functions: diff --git a/TAO/TAO_IDL/include/idl.h b/TAO/TAO_IDL/include/idl.h index b605ece7194..fb687464205 100644 --- a/TAO/TAO_IDL/include/idl.h +++ b/TAO/TAO_IDL/include/idl.h @@ -91,4 +91,9 @@ trademarks or registered trademarks of Sun Microsystems, Inc. #include "ast.h" // AST classes #include "util.h" // Utility classes +if defined (interface) +// Mingw needs this. +# undef interface +#endif /* defined (interface) */ + #endif // _IDL_IDL_HH diff --git a/TAO/rules.tao.GNU b/TAO/rules.tao.GNU index b8394519db7..8f43b180c58 100644 --- a/TAO/rules.tao.GNU +++ b/TAO/rules.tao.GNU @@ -2,7 +2,7 @@ # # $Id$ # -# Common rules for all of TAO +# Common Makefile rules for all of TAO # #---------------------------------------------------------------------------- @@ -17,6 +17,8 @@ ifndef TAO_IDL TAO_IDL = $(TAO_ROOT)/TAO_IDL/tao_idl endif +TAO_IDL_DEP = $(TAO_IDL)$(EXEEXT) + ifndef COMSPEC ifdef ComSpec #### ACE+TAO use COMSPEC, but ComSpec is defined. @@ -30,7 +32,12 @@ ifdef COMSPEC #### Assume we have Bourne shell and sed. Otherwise, the user #### should find out here that the TAO_IDL_PREPROCESSOR environment #### variable must be set explicitly! - TAO_IDL_PREPROCESSOR := $(shell type $(CXX) | sed 's/.* is //') + ifneq ($(mingw32),1) + TAO_IDL_PREPROCESSOR := $(shell type $(CXX) | sed 's/.* is //') + else + TAO_IDL_PREPROCESSOR := \ + $(shell cygpath -w $(shell type $(CXX) | sed 's/.* is //')) + endif # !mingw32 endif # ! TAO_IDL_PREPROCESSOR endif # COMSPEC @@ -188,7 +195,7 @@ $(foreach ext, $(IDL_EXT_MINUS), %$(ext)): %$(IDL_CLIENT_HDR_EXT) @ ifneq ($(tao_dont_use_idl_make_rule),1) -%C.h: %.idl $(TAO_IDL) +%C.h: %.idl $(TAO_IDL_DEP) $(TAO_IDL) $(TAO_IDLFLAGS) $< endif @@ -196,7 +203,7 @@ $(foreach ext, $(IDL_EXT2_MINUS), %$(ext)): %Cli.h @ ifneq ($(tao_dont_use_idl_make_rule),1) -%Cli.h: %.idl $(TAO_IDL) +%Cli.h: %.idl $(TAO_IDL_DEP) $(TAO_IDL) $(TAO_IDLFLAGS) $< endif diff --git a/TAO/tao/DynamicInterface/Dynamic_Implementation.cpp b/TAO/tao/DynamicInterface/Dynamic_Implementation.cpp index 5f17a5598c8..3234ee996a3 100644 --- a/TAO/tao/DynamicInterface/Dynamic_Implementation.cpp +++ b/TAO/tao/DynamicInterface/Dynamic_Implementation.cpp @@ -68,25 +68,21 @@ TAO_DynamicImplementation::_create_stub (CORBA::Environment &ACE_TRY_ENV) PortableServer::POA_var poa = poa_current_impl->get_POA (ACE_TRY_ENV); ACE_CHECK_RETURN (0); - CORBA::RepositoryId interface = + CORBA::RepositoryId pinterface = this->_primary_interface (poa_current_impl->object_id (), poa.in (), ACE_TRY_ENV); ACE_CHECK_RETURN (0); CORBA::PolicyList_var client_exposed_policies = - poa_current_impl->poa ()->client_exposed_policies ( - poa_current_impl->priority (), - ACE_TRY_ENV - ); + poa_current_impl->poa ()->client_exposed_policies + (poa_current_impl->priority (), ACE_TRY_ENV); ACE_CHECK_RETURN (0); - return poa_current_impl->poa ()->key_to_stub ( - poa_current_impl->object_key (), - interface, - poa_current_impl->priority (), - ACE_TRY_ENV - ); + return poa_current_impl->poa ()->key_to_stub (poa_current_impl->object_key (), + pinterface, + poa_current_impl->priority (), + ACE_TRY_ENV); } void diff --git a/TAO/tao/IIOP_Connector.cpp b/TAO/tao/IIOP_Connector.cpp index 6b61524507c..e3ca21482b6 100644 --- a/TAO/tao/IIOP_Connector.cpp +++ b/TAO/tao/IIOP_Connector.cpp @@ -1,8 +1,6 @@ // This may look like C, but it's really -*- C++ -*- // $Id$ - - #include "tao/IIOP_Connector.h" #include "tao/IIOP_Profile.h" #include "tao/debug.h" @@ -34,11 +32,11 @@ template class ACE_Connect_Strategy<TAO_IIOP_Connection_Handler, ACE_SOCK_CONNEC template class ACE_Connector<TAO_IIOP_Connection_Handler, ACE_SOCK_CONNECTOR>; template class ACE_Svc_Tuple<TAO_IIOP_Connection_Handler>; -template class ACE_Map_Manager<int, ACE_Svc_Tuple<TAO_IIOP_Connection_Handler> *, TAO_SYNCH_RW_MUTEX>; -template class ACE_Map_Iterator_Base<int, ACE_Svc_Tuple<TAO_IIOP_Connection_Handler> *, TAO_SYNCH_RW_MUTEX>; -template class ACE_Map_Entry<int,ACE_Svc_Tuple<TAO_IIOP_Connection_Handler>*>; -template class ACE_Map_Iterator<int,ACE_Svc_Tuple<TAO_IIOP_Connection_Handler>*,TAO_SYNCH_RW_MUTEX>; -template class ACE_Map_Reverse_Iterator<int,ACE_Svc_Tuple<TAO_IIOP_Connection_Handler>*,TAO_SYNCH_RW_MUTEX>; +template class ACE_Map_Manager<ACE_HANDLE, ACE_Svc_Tuple<TAO_IIOP_Connection_Handler> *, TAO_SYNCH_RW_MUTEX>; +template class ACE_Map_Iterator_Base<ACE_HANDLE, ACE_Svc_Tuple<TAO_IIOP_Connection_Handler> *, TAO_SYNCH_RW_MUTEX>; +template class ACE_Map_Entry<ACE_HANDLE,ACE_Svc_Tuple<TAO_IIOP_Connection_Handler>*>; +template class ACE_Map_Iterator<ACE_HANDLE,ACE_Svc_Tuple<TAO_IIOP_Connection_Handler>*,TAO_SYNCH_RW_MUTEX>; +template class ACE_Map_Reverse_Iterator<ACE_HANDLE,ACE_Svc_Tuple<TAO_IIOP_Connection_Handler>*,TAO_SYNCH_RW_MUTEX>; template class ACE_Auto_Basic_Array_Ptr<TAO_IIOP_Connection_Handler*>; #elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA) @@ -54,11 +52,11 @@ template class ACE_Auto_Basic_Array_Ptr<TAO_IIOP_Connection_Handler*>; #pragma instantiate ACE_Connector<TAO_IIOP_Connection_Handler, ACE_SOCK_CONNECTOR> #pragma instantiate ACE_Svc_Tuple<TAO_IIOP_Connection_Handler> -#pragma instantiate ACE_Map_Manager<int, ACE_Svc_Tuple<TAO_IIOP_Connection_Handler> *, TAO_SYNCH_RW_MUTEX> -#pragma instantiate ACE_Map_Iterator_Base<int, ACE_Svc_Tuple<TAO_IIOP_Connection_Handler> *, TAO_SYNCH_RW_MUTEX> -#pragma instantiate ACE_Map_Entry<int,ACE_Svc_Tuple<TAO_IIOP_Connection_Handler>*> -#pragma instantiate ACE_Map_Iterator<int,ACE_Svc_Tuple<TAO_IIOP_Connection_Handler>*,TAO_SYNCH_RW_MUTEX> -#pragma instantiate ACE_Map_Reverse_Iterator<int,ACE_Svc_Tuple<TAO_IIOP_Connection_Handler>*,TAO_SYNCH_RW_MUTEX> +#pragma instantiate ACE_Map_Manager<ACE_HANDLE, ACE_Svc_Tuple<TAO_IIOP_Connection_Handler> *, TAO_SYNCH_RW_MUTEX> +#pragma instantiate ACE_Map_Iterator_Base<ACE_HANDLE, ACE_Svc_Tuple<TAO_IIOP_Connection_Handler> *, TAO_SYNCH_RW_MUTEX> +#pragma instantiate ACE_Map_Entry<ACE_HANDLE,ACE_Svc_Tuple<TAO_IIOP_Connection_Handler>*> +#pragma instantiate ACE_Map_Iterator<ACE_HANDLE,ACE_Svc_Tuple<TAO_IIOP_Connection_Handler>*,TAO_SYNCH_RW_MUTEX> +#pragma instantiate ACE_Map_Reverse_Iterator<ACE_HANDLE,ACE_Svc_Tuple<TAO_IIOP_Connection_Handler>*,TAO_SYNCH_RW_MUTEX> #pragma instantiate ACE_Auto_Basic_Array_Ptr<TAO_IIOP_Connection_Handler*> #endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */ diff --git a/TAO/tao/Strategies/SHMIOP_Connector.cpp b/TAO/tao/Strategies/SHMIOP_Connector.cpp index 238d1fe4ad1..0a80bc80dcb 100644 --- a/TAO/tao/Strategies/SHMIOP_Connector.cpp +++ b/TAO/tao/Strategies/SHMIOP_Connector.cpp @@ -29,11 +29,11 @@ template class ACE_Connect_Strategy<TAO_SHMIOP_Connection_Handler, ACE_MEM_CONNE template class ACE_Connector<TAO_SHMIOP_Connection_Handler, ACE_MEM_CONNECTOR>; template class ACE_Svc_Tuple<TAO_SHMIOP_Connection_Handler>; -template class ACE_Map_Manager<int, ACE_Svc_Tuple<TAO_SHMIOP_Connection_Handler> *, TAO_SYNCH_RW_MUTEX>; -template class ACE_Map_Iterator_Base<int, ACE_Svc_Tuple<TAO_SHMIOP_Connection_Handler> *, TAO_SYNCH_RW_MUTEX>; -template class ACE_Map_Entry<int,ACE_Svc_Tuple<TAO_SHMIOP_Connection_Handler>*>; -template class ACE_Map_Iterator<int,ACE_Svc_Tuple<TAO_SHMIOP_Connection_Handler>*,TAO_SYNCH_RW_MUTEX>; -template class ACE_Map_Reverse_Iterator<int,ACE_Svc_Tuple<TAO_SHMIOP_Connection_Handler>*,TAO_SYNCH_RW_MUTEX>; +template class ACE_Map_Manager<ACE_HANDLE, ACE_Svc_Tuple<TAO_SHMIOP_Connection_Handler> *, TAO_SYNCH_RW_MUTEX>; +template class ACE_Map_Iterator_Base<ACE_HANDLE, ACE_Svc_Tuple<TAO_SHMIOP_Connection_Handler> *, TAO_SYNCH_RW_MUTEX>; +template class ACE_Map_Entry<ACE_HANDLE,ACE_Svc_Tuple<TAO_SHMIOP_Connection_Handler>*>; +template class ACE_Map_Iterator<ACE_HANDLE,ACE_Svc_Tuple<TAO_SHMIOP_Connection_Handler>*,TAO_SYNCH_RW_MUTEX>; +template class ACE_Map_Reverse_Iterator<ACE_HANDLE,ACE_Svc_Tuple<TAO_SHMIOP_Connection_Handler>*,TAO_SYNCH_RW_MUTEX>; template class ACE_Auto_Basic_Array_Ptr<TAO_SHMIOP_Connection_Handler*>; #elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA) @@ -45,14 +45,13 @@ template class ACE_Auto_Basic_Array_Ptr<TAO_SHMIOP_Connection_Handler*>; #pragma instantiate ACE_Connector<TAO_SHMIOP_Connection_Handler, ACE_MEM_CONNECTOR> #pragma instantiate ACE_Svc_Tuple<TAO_SHMIOP_Connection_Handler> -#pragma instantiate ACE_Map_Manager<int, ACE_Svc_Tuple<TAO_SHMIOP_Connection_Handler> *, TAO_SYNCH_RW_MUTEX> -#pragma instantiate ACE_Map_Iterator_Base<int, ACE_Svc_Tuple<TAO_SHMIOP_Connection_Handler> *, TAO_SYNCH_RW_MUTEX> -#pragma instantiate ACE_Map_Entry<int,ACE_Svc_Tuple<TAO_SHMIOP_Connection_Handler>*> -#pragma instantiate ACE_Map_Iterator<int,ACE_Svc_Tuple<TAO_SHMIOP_Connection_Handler>*,TAO_SYNCH_RW_MUTEX> -#pragma instantiate ACE_Map_Reverse_Iterator<int,ACE_Svc_Tuple<TAO_SHMIOP_Connection_Handler>*,TAO_SYNCH_RW_MUTEX> +#pragma instantiate ACE_Map_Manager<ACE_HANDLE, ACE_Svc_Tuple<TAO_SHMIOP_Connection_Handler> *, TAO_SYNCH_RW_MUTEX> +#pragma instantiate ACE_Map_Iterator_Base<ACE_HANDLE, ACE_Svc_Tuple<TAO_SHMIOP_Connection_Handler> *, TAO_SYNCH_RW_MUTEX> +#pragma instantiate ACE_Map_Entry<ACE_HANDLE,ACE_Svc_Tuple<TAO_SHMIOP_Connection_Handler>*> +#pragma instantiate ACE_Map_Iterator<ACE_HANDLE,ACE_Svc_Tuple<TAO_SHMIOP_Connection_Handler>*,TAO_SYNCH_RW_MUTEX> +#pragma instantiate ACE_Map_Reverse_Iterator<ACE_HANDLE,ACE_Svc_Tuple<TAO_SHMIOP_Connection_Handler>*,TAO_SYNCH_RW_MUTEX> #pragma instantiate ACE_Auto_Basic_Array_Ptr<TAO_SHMIOP_Connection_Handler*> - #endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */ diff --git a/TAO/tao/orbconf.h b/TAO/tao/orbconf.h index 46ac17022b4..10ef67935b0 100644 --- a/TAO/tao/orbconf.h +++ b/TAO/tao/orbconf.h @@ -317,10 +317,10 @@ // Assume DOS/Windows if "configure" didn't get run. -#if defined (_WIN32) +#if defined (_MSC_VER) // "C4355: 'this' : used in base member initializer list" # pragma warning (disable:4355) /* disable C4355 warning */ -#endif /* defined (_WIN32) */ +#endif /* defined (_MSC_VER) */ // The IDL compiler can generate the classes corresponding to IDL // sequences in two ways: diff --git a/TAO/tests/IDL_Test/generic_object.idl b/TAO/tests/IDL_Test/generic_object.idl index 7d09255d6ee..62325f3df2a 100644 --- a/TAO/tests/IDL_Test/generic_object.idl +++ b/TAO/tests/IDL_Test/generic_object.idl @@ -19,27 +19,26 @@ // // ============================================================================ -// The IDL compiler deals with these in a completely -// different way that it deals with a derived object, -// i.e., an interface. +// The IDL compiler deals with these in a completely different way +// that it deals with a derived object, i.e., an interface. enum ObjectType - { - THIS, - THAT - }; +{ + OT_THIS, + OT_THAT +}; union Selecter switch (ObjectType) - { - case THIS: Object this_object; - case THAT: Object that_object; - }; +{ +case OT_THIS: Object this_object; +case OT_THAT: Object that_object; +}; // Test stub code for generic object parameters. interface generic - { - Object op (in Object inarg, - inout Object inoutarg, - out Object outarg); - }; +{ + Object op (in Object inarg, + inout Object inoutarg, + out Object outarg); +}; diff --git a/ace/ACE.cpp b/ace/ACE.cpp index f71eb8e4dd5..2004252c332 100644 --- a/ace/ACE.cpp +++ b/ace/ACE.cpp @@ -2580,6 +2580,8 @@ ACE::handle_timed_complete (ACE_HANDLE h, // any platform where we can't tell just from select() (e.g. AIX), // we also need to check for success/fail. #if defined (ACE_WIN32) + ACE_UNUSED_ARG (is_tli); + // On Win32, ex_handle set indicates a failure. We'll do the check // to try and get an errno value, but the connect failed regardless of // what getsockopt says about the error. diff --git a/ace/Acceptor.cpp b/ace/Acceptor.cpp index d5b9f4c12da..7ad847eb71e 100644 --- a/ace/Acceptor.cpp +++ b/ace/Acceptor.cpp @@ -89,9 +89,8 @@ ACE_Acceptor<SVC_HANDLER, ACE_PEER_ACCEPTOR_2>::open // the <accept> call can hang! this->peer_acceptor_.enable (ACE_NONBLOCK); - int result = reactor->register_handler - (this, - ACE_Event_Handler::ACCEPT_MASK); + int result = reactor->register_handler (this, + ACE_Event_Handler::ACCEPT_MASK); if (result != -1) this->reactor (reactor); @@ -276,21 +275,17 @@ ACE_Acceptor<SVC_HANDLER, ACE_PEER_ACCEPTOR_2>::accept_svc_handler // associations. int reset_new_handle = this->reactor ()->uses_event_associations (); - // Note that it's not really an error if <accept> returns -1 and - // <errno> == EWOULDBLOCK because we have set the peer acceptor's - // handle into non-blocking mode to prevent the <accept> call from - // "hanging" if the connection has been shutdown. if (this->peer_acceptor_.accept (svc_handler->peer (), // stream 0, // remote address 0, // timeout 1, // restart reset_new_handle // reset new handler - ) == -1 && errno != EWOULDBLOCK) + ) == -1) { // Close down handler to avoid memory leaks. svc_handler->close (0); - // If <reuse_addr> is true then we will close the socket and + // If <reuse_addr_> is true then we will close the socket and // open it again... if (this->reuse_addr_) { diff --git a/ace/Acceptor.h b/ace/Acceptor.h index 0c9fb6dc934..10d03894bae 100644 --- a/ace/Acceptor.h +++ b/ace/Acceptor.h @@ -6,11 +6,10 @@ * * $Id$ * - * @author Doug Schmidt + * @author Doug Schmidt <schmidt@cs.wustl.edu> */ //============================================================================= - #ifndef ACE_ACCEPTOR_H #define ACE_ACCEPTOR_H #include "ace/pre.h" diff --git a/ace/Configuration.cpp b/ace/Configuration.cpp index ed5ef7899c1..cb9678efa93 100644 --- a/ace/Configuration.cpp +++ b/ace/Configuration.cpp @@ -451,6 +451,20 @@ ACE_Section_Key_Win32::~ACE_Section_Key_Win32 (void) ////////////////////////////////////////////////////////////////////////////// +int +ACE_Configuration_Win32Registry::operator== (const ACE_Configuration_Win32Registry &rhs) const +{ + ACE_UNUSED_ARG (rhs); + return 1; +} + +int +ACE_Configuration_Win32Registry::operator!=(const ACE_Configuration_Win32Registry &rhs) const +{ + ACE_UNUSED_ARG (rhs); + return 1; +} + ACE_Configuration_Win32Registry::ACE_Configuration_Win32Registry (HKEY hKey) { ACE_Section_Key_Win32 *temp; @@ -773,10 +787,10 @@ ACE_Configuration_Win32Registry::get_integer_value (const ACE_Configuration_Sect } int -ACE_Configuration_Win32Registry::get_binary_value (const ACE_Configuration_Section_Key& key, - const ACE_TCHAR* name, - void*& data, - u_int& length) +ACE_Configuration_Win32Registry::get_binary_value (const ACE_Configuration_Section_Key &key, + const ACE_TCHAR *name, + void *&data, + u_int &length) { if (validate_name (name)) return -1; @@ -801,7 +815,7 @@ ACE_Configuration_Win32Registry::get_binary_value (const ACE_Configuration_Secti length = buffer_length; - ACE_NEW_RETURN (data, unsigned char[length], -4); + ACE_NEW_RETURN (data, BYTE[length], -4); if (ACE_TEXT_RegQueryValueEx (base_key, name, @@ -810,7 +824,7 @@ ACE_Configuration_Win32Registry::get_binary_value (const ACE_Configuration_Secti (BYTE *) data, &buffer_length) != ERROR_SUCCESS) { - delete[] data; + delete [] (BYTE *) data; data = 0; return -5; } diff --git a/ace/Configuration.h b/ace/Configuration.h index 1c5214a895a..4c08ccded12 100644 --- a/ace/Configuration.h +++ b/ace/Configuration.h @@ -400,9 +400,8 @@ public: static HKEY resolve_key (HKEY hKey, const ACE_TCHAR* path, int create = 1); - - virtual int operator==(const ACE_Configuration_Win32Registry& rhs) const{return true;} - virtual int operator!=(const ACE_Configuration_Win32Registry& rhs) const{return true;} + virtual int operator== (const ACE_Configuration_Win32Registry &rhs) const; + virtual int operator!= (const ACE_Configuration_Win32Registry &rhs) const; protected: diff --git a/ace/SOCK_Acceptor.h b/ace/SOCK_Acceptor.h index d1ffcd7c36e..080692c35a8 100644 --- a/ace/SOCK_Acceptor.h +++ b/ace/SOCK_Acceptor.h @@ -6,11 +6,10 @@ * * $Id$ * - * @author Doug Schmidt + * @author Douglas C. Schmidt <schmidt@cs.wustl.edu> */ //============================================================================= - #ifndef ACE_SOCK_ACCEPTOR_H #define ACE_SOCK_ACCEPTOR_H #include "ace/pre.h" diff --git a/ace/Strategies_T.cpp b/ace/Strategies_T.cpp index d8e23698014..7c65a57fe1a 100644 --- a/ace/Strategies_T.cpp +++ b/ace/Strategies_T.cpp @@ -241,16 +241,36 @@ ACE_Thread_Strategy<SVC_HANDLER>::activate_svc_handler (SVC_HANDLER *svc_handler this->n_threads_); } +template <class SVC_HANDLER, ACE_PEER_ACCEPTOR_1> int +ACE_Accept_Strategy<SVC_HANDLER, ACE_PEER_ACCEPTOR_2>::open + (const ACE_PEER_ACCEPTOR_ADDR &local_addr, int reuse_addr) +{ + this->reuse_addr_ = reuse_addr; + this->peer_acceptor_addr_ = local_addr; + if (this->peer_acceptor_.open (local_addr, + reuse_addr) == -1) + return -1; + + // Set the peer acceptor's handle into non-blocking mode. This is a + // safe-guard against the race condition that can otherwise occur + // between the time when <select> indicates that a passive-mode + // socket handle is "ready" and when we call <accept>. During this + // interval, the client can shutdown the connection, in which case, + // the <accept> call can hang! + this->peer_acceptor_.enable (ACE_NONBLOCK); + return 0; +} + template <class SVC_HANDLER, ACE_PEER_ACCEPTOR_1> ACE_Accept_Strategy<SVC_HANDLER, ACE_PEER_ACCEPTOR_2>::ACE_Accept_Strategy (const ACE_PEER_ACCEPTOR_ADDR &local_addr, - int restart, + int reuse_addr, ACE_Reactor *reactor) : reactor_ (reactor) { ACE_TRACE ("ACE_Accept_Strategy<SVC_HANDLER, ACE_PEER_ACCEPTOR_2>::ACE_Accept_Strategy"); - if (this->open (local_addr, restart) == -1) + if (this->open (local_addr, reuse_addr) == -1) ACE_ERROR ((LM_ERROR, ACE_LIB_TEXT ("%p\n"), ACE_LIB_TEXT ("open"))); @@ -258,7 +278,7 @@ ACE_Accept_Strategy<SVC_HANDLER, ACE_PEER_ACCEPTOR_2>::ACE_Accept_Strategy template <class SVC_HANDLER, ACE_PEER_ACCEPTOR_1> int ACE_Accept_Strategy<SVC_HANDLER, ACE_PEER_ACCEPTOR_2>::accept_svc_handler -(SVC_HANDLER *svc_handler) + (SVC_HANDLER *svc_handler) { ACE_TRACE ("ACE_Accept_Strategy<SVC_HANDLER, ACE_PEER_ACCEPTOR_2>::accept_svc_handler"); @@ -269,15 +289,25 @@ ACE_Accept_Strategy<SVC_HANDLER, ACE_PEER_ACCEPTOR_2>::accept_svc_handler // associations. int reset_new_handle = this->reactor_->uses_event_associations (); - if (this->acceptor_.accept (svc_handler->peer (), // stream - 0, // remote address - 0, // timeout - 1, // restart - reset_new_handle // reset new handler - ) == -1) + if (this->peer_acceptor_.accept (svc_handler->peer (), // stream + 0, // remote address + 0, // timeout + 1, // restart + reset_new_handle // reset new handler + ) == -1) { // Close down handler to avoid memory leaks. svc_handler->close (0); + + // If <reuse_addr_> is true then we will close the socket and + // open it again... + if (this->reuse_addr_) + { + this->peer_acceptor_.close (); + this->peer_acceptor_.open (this->peer_acceptor_addr_, + this->reuse_addr_); + } + return -1; } else diff --git a/ace/Strategies_T.h b/ace/Strategies_T.h index 673d45e0e71..15c4d859fc1 100644 --- a/ace/Strategies_T.h +++ b/ace/Strategies_T.h @@ -6,11 +6,10 @@ * * $Id$ * - * @author Doug Schmidt + * @author Douglas C. Schmidt <schmidt@cs.wustl.edu> */ //============================================================================= - #ifndef ACE_STRATEGIES_T_H #define ACE_STRATEGIES_T_H #include "ace/pre.h" @@ -456,9 +455,10 @@ public: int restart = 0, ACE_Reactor *reactor = ACE_Reactor::instance ()); - /// Initialize the <peer_acceptor_> with <local_addr>. + /// Initialize the <peer_acceptor_> with <local_addr>, indicating + /// whether to <reuse_addr> if it's already in use. virtual int open (const ACE_PEER_ACCEPTOR_ADDR &local_addr, - int restart = 0); + int reuse_addr = 0); /// Return the underlying ACE_HANDLE of the <peer_acceptor_>. virtual ACE_HANDLE get_handle (void) const; @@ -481,10 +481,16 @@ public: protected: /// Factory that establishes connections passively. - ACE_PEER_ACCEPTOR acceptor_; + ACE_PEER_ACCEPTOR peer_acceptor_; /// Pointer to the reactor used by the Acceptor. ACE_Reactor *reactor_; + + /// Needed to reopen the socket if <accept> fails. + int reuse_addr_; + + /// Needed to reopen the socket if <accept> fails. + ACE_PEER_ACCEPTOR_ADDR peer_acceptor_addr_; }; /** diff --git a/ace/Strategies_T.i b/ace/Strategies_T.i index 6c87fe984ec..e6376aee006 100644 --- a/ace/Strategies_T.i +++ b/ace/Strategies_T.i @@ -61,7 +61,6 @@ ACE_Creation_Strategy<SVC_HANDLER>::open (ACE_Thread_Manager *thr_mgr) return 0; } - template <class SVC_HANDLER> ASYS_INLINE ACE_Creation_Strategy<SVC_HANDLER>::ACE_Creation_Strategy (ACE_Thread_Manager *thr_mgr) { @@ -191,13 +190,6 @@ ACE_Thread_Strategy<SVC_HANDLER>::~ACE_Thread_Strategy (void) ACE_TRACE ("ACE_Thread_Strategy<SVC_HANDLER>::~ACE_Thread_Strategy"); } -template <class SVC_HANDLER, ACE_PEER_ACCEPTOR_1> ASYS_INLINE int -ACE_Accept_Strategy<SVC_HANDLER, ACE_PEER_ACCEPTOR_2>::open - (const ACE_PEER_ACCEPTOR_ADDR &local_addr, int restart) -{ - return this->acceptor_.open (local_addr, restart); -} - template <class SVC_HANDLER, ACE_PEER_ACCEPTOR_1> ASYS_INLINE ACE_Accept_Strategy<SVC_HANDLER, ACE_PEER_ACCEPTOR_2>::ACE_Accept_Strategy (ACE_Reactor *reactor) : reactor_ (reactor) @@ -209,14 +201,14 @@ template <class SVC_HANDLER, ACE_PEER_ACCEPTOR_1> ASYS_INLINE ACE_HANDLE ACE_Accept_Strategy<SVC_HANDLER, ACE_PEER_ACCEPTOR_2>::get_handle (void) const { ACE_TRACE ("ACE_Accept_Strategy<SVC_HANDLER, ACE_PEER_ACCEPTOR_2>::get_handle"); - return this->acceptor_.get_handle (); + return this->peer_acceptor_.get_handle (); } template <class SVC_HANDLER, ACE_PEER_ACCEPTOR_1> ASYS_INLINE ACE_PEER_ACCEPTOR & ACE_Accept_Strategy<SVC_HANDLER, ACE_PEER_ACCEPTOR_2>::acceptor (void) const { ACE_TRACE ("ACE_Accept_Strategy<SVC_HANDLER, ACE_PEER_ACCEPTOR_2>::acceptor"); - return (ACE_PEER_ACCEPTOR &) this->acceptor_; + return (ACE_PEER_ACCEPTOR &) this->peer_acceptor_; } template <class SVC_HANDLER, ACE_PEER_ACCEPTOR_1> ASYS_INLINE @@ -225,8 +217,7 @@ ACE_Accept_Strategy<SVC_HANDLER, ACE_PEER_ACCEPTOR_2>::~ACE_Accept_Strategy (voi ACE_TRACE ("ACE_Accept_Strategy<SVC_HANDLER, ACE_PEER_ACCEPTOR_2>::~ACE_Accept_Strategy"); // Close the underlying acceptor. - this->acceptor_.close (); - + this->peer_acceptor_.close (); } template <class SVC_HANDLER, ACE_PEER_CONNECTOR_1> ASYS_INLINE ACE_PEER_CONNECTOR & diff --git a/ace/Timer_Wheel_T.cpp b/ace/Timer_Wheel_T.cpp index c1620d633ff..7b0ed2c30a2 100644 --- a/ace/Timer_Wheel_T.cpp +++ b/ace/Timer_Wheel_T.cpp @@ -628,7 +628,6 @@ ACE_Timer_Wheel_T<TYPE, FUNCTOR, ACE_LOCK>::get_first (void) return this->wheel_[this->earliest_pos_]->get_next (); } - /** * Takes an ACE_Timer_Node and inserts it into the correct position in * the correct list. Also makes sure to update the earliest time. @@ -646,7 +645,7 @@ ACE_Timer_Wheel_T<TYPE, FUNCTOR, ACE_LOCK>::reschedule ( % this->wheel_size_; // See if we need to update the earliest time - if (this->earliest_time () == ACE_Time_Value::zero + if (this->is_empty () || expired->get_timer_value () < this->earliest_time ()) this->earliest_pos_ = pos; diff --git a/ace/config-win32-common.h b/ace/config-win32-common.h index 863269bea2f..029db65fc83 100644 --- a/ace/config-win32-common.h +++ b/ace/config-win32-common.h @@ -82,6 +82,7 @@ // #endif // Define the special export macros needed to export symbols outside a dll +#if !defined (__MINGW32__) #define ACE_HAS_CUSTOM_EXPORT_MACROS #define ACE_Proper_Export_Flag __declspec (dllexport) #define ACE_Proper_Import_Flag __declspec (dllimport) @@ -89,6 +90,7 @@ #define ACE_IMPORT_SINGLETON_DECLARATION(T) extern template class T #define ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) template class __declspec (dllexport) SINGLETON_TYPE<CLASS, LOCK>; #define ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) extern template class SINGLETON_TYPE <CLASS, LOCK>; +#endif /* !__MINGW32__ */ // Define ACE_HAS_WINSOCK2 to 0 in your config.h file if you do *not* // want to compile with WinSock 2.0. diff --git a/ace/config-win32-mingw.h b/ace/config-win32-mingw.h index 340db18c0d3..b18af0d49ac 100644 --- a/ace/config-win32-mingw.h +++ b/ace/config-win32-mingw.h @@ -27,8 +27,6 @@ # error You do not seem to be using mingw32 #endif -#define ACE_AS_STATIC_LIBS - #include "ace/config-g++-common.h" #include /**/ <_mingw.h> diff --git a/apps/gperf/ChangeLog b/apps/gperf/ChangeLog index 6397aa7c955..bbab33d99c4 100644 --- a/apps/gperf/ChangeLog +++ b/apps/gperf/ChangeLog @@ -1,3 +1,10 @@ +Sat Jun 2 13:30:30 2001 Douglas C. Schmidt <schmidt@tango.doc.wustl.edu> + + * src/Makefile (INSTALL): Fixed several minor problems with the + Makefile so that this will build correctly on mingw. Thanks to + Cristian Ferretti <cristian_ferretti@yahoo.com> for pointing + this out. + Fri Mar 30 11:30:54 2001 Carlos O'Ryan <coryan@uci.edu> * tests/Makefile: diff --git a/apps/gperf/src/Makefile b/apps/gperf/src/Makefile index 186c1c4bada..d672400b02e 100644 --- a/apps/gperf/src/Makefile +++ b/apps/gperf/src/Makefile @@ -5,7 +5,7 @@ #---------------------------------------------------------------------------- BIN = gperf -INSBIN = $ACE_ROOT/bin/gperf +INSBIN = $(ACE_ROOT)/bin/gperf FILES = Options \ Iterator \ @@ -22,7 +22,7 @@ OBJ = $(addsuffix .o,$(FILES)) BUILD = $(VBIN) -INSTALL = $(VBIN:%=$(INSBIN)/%) +INSTALL = $(VBIN:%=$(INSBIN)/%$(EXEEXT)) #---------------------------------------------------------------------------- # Include macros and targets diff --git a/include/makeinclude/platform_gnuwin32_common.GNU b/include/makeinclude/platform_gnuwin32_common.GNU index 412420bf95a..aee06d0ed29 100644 --- a/include/makeinclude/platform_gnuwin32_common.GNU +++ b/include/makeinclude/platform_gnuwin32_common.GNU @@ -49,20 +49,28 @@ ifeq ($(debug),0) CFLAGS += -DNDEBUG endif -CC = gcc -m$(TCPU) -CXX = g++ -m$(TCPU) +CC = gcc +CXX = g++ + +MODEL_FLAGS += -m$(TCPU) # Never use -pipe with 95/98. On NT/2000, not sure if it helps. CFLAGS += -W -Wall -Wpointer-arith ifeq ($(threads),1) - CC += -mthreads - CXX += -mthreads + MODEL_FLAGS += -mthreads endif # threads +CFLAGS += $(MODEL_FLAGS) + +# Never use -pipe with 95/98. On NT/2000, not sure if it helps. +CFLAGS += -W -Wall -Wpointer-arith + ifeq ($(IMPLICIT_TEMPLATES_FLAG),) IMPLICIT_TEMPLATES_FLAG=-fno-implicit-templates endif +EXEEXT = .exe + CCFLAGS += $(CFLAGS) $(IMPLICIT_TEMPLATES_FLAG) DCFLAGS += -g DLD = $(CXX) @@ -75,18 +83,26 @@ endif LIBS += -lwsock32 endif -VSHDIR = .obj/ - OCFLAGS += -O3 -PIC = +PIC = -DACE_OS_HAS_DLL=1 AR = ar ARFLAGS = rsuv RANLIB = ranlib SOEXT = dll -SOFLAGS = $(CPPFLAGS) +SOFLAGS = $(MODEL_FLAGS) $(CPPFLAGS) SOBUILD = $(COMPILE.cc) $(PIC) -o $(VSHDIR)$*.so $< -# The sed below is a workaround to a bug in ld. -SHLIBBUILD = dlltool --export-all --output-def $@.def --dllname $@ $(VSHOBJS1) && mv $@.def $@.def.old && sed 's/;.*$$//g' < $@.def.old > $@.def && $(SOLINK.cc) -Wl,--enable-auto-image-base -Wl,--out-implib,$@.a -shared -o $@ $(LDFLAGS) $@.def $(VSHOBJS1) $(LIBS) && $(RM) $@.def.old $@.def + +# The sed below is to strip comments on the .def file, +# to workaround to a bug in ld. +SHLIBBUILD = \ + $(RM) $(VSHDIR)/$@.def.old $(VSHDIR)/$@.def; \ + dlltool --export-all --output-def $(VSHDIR)/$@.def --dllname $@ \ + $(VSHOBJS1) \ + && mv $(VSHDIR)/$@.def $(VSHDIR)/$@.def.old \ + && sed 's/;.*$$//g' < $(VSHDIR)/$@.def.old > $(VSHDIR)/$@.def \ + && $(SOLINK.cc) -Wl,--enable-auto-image-base -Wl,--out-implib,$@.a \ + -shared -o $@ $(LDFLAGS) $(VSHDIR)/$@.def \ + $(VSHOBJS1) $(ACE_SHLIBS) $(LIBS) ifeq ($(exceptions),1) SHLIBBUILD += \ diff --git a/include/makeinclude/platform_mingw32.GNU b/include/makeinclude/platform_mingw32.GNU index ba2d31272df..800877565f8 100644 --- a/include/makeinclude/platform_mingw32.GNU +++ b/include/makeinclude/platform_mingw32.GNU @@ -1,13 +1,10 @@ # $Id$ -# # This file should allow to build ACE for mingw32 with mingw tools. # Edit to change TCPU and M32_BASE below. # # Don't forget to define the ACE_ROOT environment variable! -# -# # mingw32 packages as distributed from sourceforge: # http://sourceforge.net/project/showfiles.php?group_id=2435&release_id=15084 # See also http://www.mingw.org. @@ -36,23 +33,19 @@ # with # ... %{!shared:%{!mdll:c:/mingw32/lib/gcc-lib/mingw32/2.95.2/crt2%O%s}} ... # or something similar depending on the location of your instalation). -# -# # Chose your target CPU (uncomment ONE of these). -# TCPU = pentiumpro #TCPU = pentium #TCPU = i486 #TCPU = i386 -# # Define here mingw32 instalation location. # These asumes no fancy hierachy, just all packages above unpacked on # the same base directory. # Optionally, you can define it as an environment variable, or set it # on your platform_macros.GNU before including this file. -# + ifndef MINGW_BASE MINGW_BASE = c:/live/local/mingw32 endif diff --git a/include/makeinclude/rules.local.GNU b/include/makeinclude/rules.local.GNU index c6cce7274f6..c51d1e3ce84 100644 --- a/include/makeinclude/rules.local.GNU +++ b/include/makeinclude/rules.local.GNU @@ -177,7 +177,7 @@ ifeq (,$(LN_S)) endif # ! WIN32 endif # ! LN_S -$(INSBIN)/%$(VAR) \ +$(INSBIN)/%$(VAR)$(EXEEXT) \ $(INSINC)/ace% \ $(INSLIB)/% \ $(INSMAN)/man1/% \ @@ -221,7 +221,7 @@ clean.local: -$(RM) -r SunWS_cache ir.out realclean.local: clean.local - -$(RM) $(BIN) $(BIN:%=%_debug) $(BIN:%=%_profile) $(BIN:%=%_optimize) $(LIB:%=%) $(LIB:%=%_debug) $(LIB:%=%_profile) $(LIB:%=%_optimize) $(SHLIB:%=%) $(SHLIB:%=%.a) $(SHLIB:%=%_debug) $(SHLIB:%=%_profile) $(SHLIB:%=%_optimize) $(SHLIBA:%=%) $(BIN2) $(BIN2:%=%_debug) $(BIN2:%=%_profile) $(BIN2:%=%_optimize) $(LIB2:%=%) $(LIB2:%=%_debug) $(LIB2:%=%_profile) $(LIB2:%=%_optimize) $(SHLIB2:%=%) $(SHLIB2:%=%_debug) $(SHLIB2:%=%_profile) $(SHLIB2:%=%_optimize) $(SHLIBA2:%=%) + -$(RM) $(BIN:%=%$(EXEEXT)) $(BIN:%=%_debug$(EXEEXT)) $(BIN:%=%_profile$(EXEEXT)) $(BIN:%=%_optimize$(EXEEXT)) $(LIB:%=%) $(LIB:%=%_debug) $(LIB:%=%_profile) $(LIB:%=%_optimize) $(SHLIB:%=%) $(SHLIB:%=%.a) $(SHLIB:%=%_debug) $(SHLIB:%=%_profile) $(SHLIB:%=%_optimize) $(SHLIBA:%=%) $(BIN2:%=%$(EXEEXT)) $(BIN2:%=%_debug$(EXEEXT)) $(BIN2:%=%_profile$(EXEEXT)) $(BIN2:%=%_optimize$(EXEEXT)) $(LIB2:%=%) $(LIB2:%=%_debug) $(LIB2:%=%_profile) $(LIB2:%=%_optimize) $(SHLIB2:%=%) $(SHLIB2:%=%_debug) $(SHLIB2:%=%_profile) $(SHLIB2:%=%_optimize) $(SHLIBA2:%=%) #---------------------------------------------------------------------------- # Dependency generation target diff --git a/tests/Cached_Accept_Conn_Test.cpp b/tests/Cached_Accept_Conn_Test.cpp index fba0e81eb94..e2ee073fe14 100644 --- a/tests/Cached_Accept_Conn_Test.cpp +++ b/tests/Cached_Accept_Conn_Test.cpp @@ -100,12 +100,12 @@ Accept_Strategy<SVC_HANDLER, ACE_PEER_ACCEPTOR_2>::accept_svc_handler (SVC_HANDL // associations. int reset_new_handle = this->reactor_->uses_event_associations (); - int result = this->acceptor_.accept (svc_handler->peer (), // stream - 0, // remote address - 0, // timeout - 1, // restart - reset_new_handle // reset new handler - ); + int result = this->acceptor ().accept (svc_handler->peer (), // stream + 0, // remote address + 0, // timeout + 1, // restart + reset_new_handle // reset new handler + ); if (result == 0) { if (debug) |