diff options
author | mcorino <mcorino@users.noreply.github.com> | 2013-03-30 09:42:31 +0000 |
---|---|---|
committer | mcorino <mcorino@users.noreply.github.com> | 2013-03-30 09:42:31 +0000 |
commit | 5ad4f3d78411d6253d88926dbd59ae2884e8548c (patch) | |
tree | 1f070ddfdacf033876b1f707c143586a457d2db5 | |
parent | f203ae2043a2f5e92e6c550f850958b913c126a7 (diff) | |
download | ATCD-5ad4f3d78411d6253d88926dbd59ae2884e8548c.tar.gz |
ChangelogTag: Sat Mar 30 09:30:10 UTC 2013 Martin Corino <mcorino@remedy.nl>
-rw-r--r-- | ACE/ChangeLog | 41 | ||||
-rw-r--r-- | ACE/ace/CDR_Base.inl | 6 | ||||
-rw-r--r-- | ACE/ace/Functor_T.h | 1 | ||||
-rw-r--r-- | ACE/ace/Functor_T.inl | 2 | ||||
-rw-r--r-- | ACE/ace/OS_NS_stdio.h | 2 | ||||
-rw-r--r-- | ACE/ace/OS_NS_stdio.inl | 8 | ||||
-rw-r--r-- | ACE/ace/OS_NS_sys_stat.inl | 2 | ||||
-rw-r--r-- | ACE/ace/Process.cpp | 5 | ||||
-rw-r--r-- | ACE/ace/SV_Semaphore_Simple.cpp | 2 | ||||
-rw-r--r-- | ACE/ace/Timer_Wheel_T.cpp | 3 | ||||
-rw-r--r-- | ACE/ace/config-win32-mingw.h | 19 | ||||
-rw-r--r-- | ACE/ace/config-win32-mingw64.h | 129 | ||||
-rw-r--r-- | ACE/ace/config-win32.h | 10 | ||||
-rw-r--r-- | ACE/apps/Gateway/Gateway/Gateway.cpp | 3 | ||||
-rw-r--r-- | ACE/examples/C++NPv1/Reactive_Logging_Server.h | 3 | ||||
-rw-r--r-- | ACE/examples/C++NPv1/Reactive_Logging_Server_Ex.h | 3 | ||||
-rw-r--r-- | ACE/examples/IPC_SAP/SOCK_SAP/CPP-inserver.cpp | 4 | ||||
-rw-r--r-- | ACE/examples/Reactor/Misc/test_early_timeouts.cpp | 4 | ||||
-rw-r--r-- | ACE/include/makeinclude/platform_mingw32.GNU | 10 | ||||
-rw-r--r-- | ACE/performance-tests/SCTP/SOCK_STREAM_srv.cpp | 3 | ||||
-rw-r--r-- | ACE/tests/Map_Test.h | 4 | ||||
-rw-r--r-- | ACE/tests/Process_Env_Test.cpp | 3 | ||||
-rw-r--r-- | ACE/tests/Thread_Timer_Queue_Adapter_Test.cpp | 3 |
23 files changed, 231 insertions, 39 deletions
diff --git a/ACE/ChangeLog b/ACE/ChangeLog index 3689046fcbc..986e7044a15 100644 --- a/ACE/ChangeLog +++ b/ACE/ChangeLog @@ -1,3 +1,44 @@ +Sat Mar 30 09:30:10 UTC 2013 Martin Corino <mcorino@remedy.nl> + + * include/makeinclude/platform_mingw32.GNU: + Added support for latest GCC from MinGW64. + + * ace/config-win32.h: + * ace/config-win32-mingw.h: + Split support for MinGW64 variants of MinGW compilers + into separate files because of tricky differences between + MinGW32 and MinGW64 APIs. + + * ace/config-win32-mingw64.h: + Added separate support file for MinGW64 compilers (both + 32 and 64 bit). + + * ace/CDR_Base.inl: + More standardized use of ACE_LACKS_INLINE_ASSEMBLY for benefit + of MinGW64 64bit compiler. + + * ace/Functor_T.h: + * ace/Functor_T.inl: + * ace/OS_NS_stdio.h: + * ace/OS_NS_stdio.inl: + * ace/OS_NS_sys_stat.inl: + * ace/Process.cpp: + * ace/SV_Semaphore_Simple.cpp: + * ace/Timer_Wheel_T.cpp: + * apps/Gateway/Gateway/Gateway.cpp: + * examples/C++NPv1/Reactive_Logging_Server.h: + * examples/C++NPv1/Reactive_Logging_Server_Ex.h: + * examples/IPC_SAP/SOCK_SAP/CPP-inserver.cpp: + * examples/Reactor/Misc/test_early_timeouts.cpp: + * performance-tests/SCTP/SOCK_STREAM_srv.cpp: + * tests/Map_Test.h: + * tests/Process_Env_Test.cpp: + * tests/Thread_Timer_Queue_Adapter_Test.cpp: + All kinds of minor updates and corrections to silence + warnings and errors relating to either 64bit Windows or + the very latest GCC (4.8.0). Mostly precision loss and + truncating casts. + Thu Mar 28 08:52:43 UTC 2013 Johnny Willemsen <jwillemsen@remedy.nl> * docs/ACE-bug-process.html: diff --git a/ACE/ace/CDR_Base.inl b/ACE/ace/CDR_Base.inl index b84470af87f..351c853c2e3 100644 --- a/ACE/ace/CDR_Base.inl +++ b/ACE/ace/CDR_Base.inl @@ -145,12 +145,14 @@ ACE_CDR::swap_8 (const char* orig, char* target) #elif defined (ACE_HAS_BSWAP_64) *reinterpret_cast<uint64_t *> (target) = bswap_64 (*reinterpret_cast<uint64_t const *> (orig)); -#elif (defined (__amd64__) || defined (__x86_64__)) && defined(__GNUG__) +#elif (defined (__amd64__) || defined (__x86_64__)) && defined(__GNUG__) \ + && !defined(ACE_LACKS_INLINE_ASSEMBLY) register unsigned long x = * reinterpret_cast<const unsigned long*> (orig); asm ("bswapq %1" : "=r" (x) : "0" (x)); *reinterpret_cast<unsigned long*> (target) = x; -#elif defined(ACE_HAS_PENTIUM) && defined(__GNUG__) +#elif defined(ACE_HAS_PENTIUM) && defined(__GNUG__) \ + && !defined(ACE_LACKS_INLINE_ASSEMBLY) register unsigned int i = *reinterpret_cast<const unsigned int*> (orig); register unsigned int j = diff --git a/ACE/ace/Functor_T.h b/ACE/ace/Functor_T.h index f8a215c078e..d35f4e2aaef 100644 --- a/ACE/ace/Functor_T.h +++ b/ACE/ace/Functor_T.h @@ -37,6 +37,7 @@ #endif /* ACE_LACKS_PRAGMA_ONCE */ #include "ace/Functor_String.h" +#include "ace/Truncate.h" ACE_BEGIN_VERSIONED_NAMESPACE_DECL diff --git a/ACE/ace/Functor_T.inl b/ACE/ace/Functor_T.inl index d6cefade1bd..f22672d7fa5 100644 --- a/ACE/ace/Functor_T.inl +++ b/ACE/ace/Functor_T.inl @@ -40,7 +40,7 @@ ACE_Pointer_Hash<TYPE>::operator () (TYPE t) const # pragma warning(push) # pragma warning(disable : 4311) /* Truncate pointer to unsigned long */ #endif /* ACE_WIN64 */ - return reinterpret_cast<unsigned long> (t); + return ACE_Utils::truncate_cast<unsigned long> ((intptr_t)t); #if defined (ACE_WIN64) # pragma warning(pop) #endif /* ACE_WIN64 */ diff --git a/ACE/ace/OS_NS_stdio.h b/ACE/ace/OS_NS_stdio.h index 411c1e5ee58..c42434ed7b5 100644 --- a/ACE/ace/OS_NS_stdio.h +++ b/ACE/ace/OS_NS_stdio.h @@ -117,7 +117,7 @@ inline ACE_HANDLE ace_fileno_helper (FILE *fp) return (ACE_HANDLE)fileno (fp); # undef fileno # else - return (ACE_HANDLE)ACE_STD_NAMESPACE::fileno (fp); + return (ACE_HANDLE)(intptr_t)ACE_STD_NAMESPACE::fileno (fp); # endif /* defined (fileno) */ } #endif /* !ACE_FILENO_EQUIVALENT */ diff --git a/ACE/ace/OS_NS_stdio.inl b/ACE/ace/OS_NS_stdio.inl index e24a4024f11..60031b4fd63 100644 --- a/ACE/ace/OS_NS_stdio.inl +++ b/ACE/ace/OS_NS_stdio.inl @@ -583,7 +583,7 @@ ACE_INLINE ACE_HANDLE ACE_OS::fileno (FILE *stream) { #if defined ACE_FILENO_EQUIVALENT - return (ACE_HANDLE)ACE_FILENO_EQUIVALENT (stream); + return (ACE_HANDLE)((intptr_t)ACE_FILENO_EQUIVALENT (stream)); #else return ace_fileno_helper (stream); #endif @@ -1014,6 +1014,12 @@ ACE_OS::vsprintf (wchar_t *buffer, const wchar_t *format, va_list argptr) // ACE_OS::snprintf(). return vswprintf (buffer, 4096, format, argptr); +# elif defined (__MINGW64_VERSION_MAJOR) && !defined (WIN64) + // the MingW64 32bit version causes link errors when using the + // 'standard' vswprint(). Luckily they have a mingw special. + + return __mingw_vswprintf (buffer, format, argptr); + # elif defined (ACE_WIN32) // Windows has vswprintf, but the pre-VC8 signature is from the older // ISO C standard. Also see ACE_OS::snprintf() for more info on this. diff --git a/ACE/ace/OS_NS_sys_stat.inl b/ACE/ace/OS_NS_sys_stat.inl index b34d5bdeda0..0f769cd7cb5 100644 --- a/ACE/ace/OS_NS_sys_stat.inl +++ b/ACE/ace/OS_NS_sys_stat.inl @@ -262,7 +262,7 @@ namespace ACE_OS return 0; #elif defined (__BORLANDC__) \ || defined (_MSC_VER) \ - || defined (__MINGW32__) + || (defined (__MINGW32__) && !defined (__MINGW64_VERSION_MAJOR)) ACE_OSCALL_RETURN (ACE_WSTAT_FUNC_NAME (file, stp), int, -1); #else /* ACE_HAS_WINCE */ ACE_Wide_To_Ascii nfile (file); diff --git a/ACE/ace/Process.cpp b/ACE/ace/Process.cpp index b3471897404..6ba69acbf0e 100644 --- a/ACE/ace/Process.cpp +++ b/ACE/ace/Process.cpp @@ -116,9 +116,14 @@ ACE_Process::spawn (ACE_Process_Options &options) { #if defined (ACE_WIN32) # if defined (ACE_WIN64) +// silence warnings coming from MinGW64 compilers +# pragma GCC diagnostic push +# pragma GCC diagnostic ignored "-Wformat" +# pragma GCC diagnostic ignored "-Wformat-extra-args" curr_len += ACE_OS::sprintf (&cmd_line_buf[curr_len], ACE_TEXT (" +H %I64p"), h); +# pragma GCC diagnostic pop # else curr_len += ACE_OS::sprintf (&cmd_line_buf[curr_len], ACE_TEXT (" +H %p"), diff --git a/ACE/ace/SV_Semaphore_Simple.cpp b/ACE/ace/SV_Semaphore_Simple.cpp index bdf4531f4e1..2b340649ed1 100644 --- a/ACE/ace/SV_Semaphore_Simple.cpp +++ b/ACE/ace/SV_Semaphore_Simple.cpp @@ -141,7 +141,7 @@ ACE_SV_Semaphore_Simple::name_2_key (const char *name) # pragma warning(push) # pragma warning(disable : 4312) #endif /* defined (ACE_WIN32) && defined (_MSC_VER) */ - return (key_t) ACE::crc32 (name); + return (key_t)(intptr_t)ACE::crc32 (name); #if defined (ACE_WIN32) && defined (_MSC_VER) # pragma warning(pop) #endif /* defined (ACE_WIN32) && defined (_MSC_VER) */ diff --git a/ACE/ace/Timer_Wheel_T.cpp b/ACE/ace/Timer_Wheel_T.cpp index 2ede9545028..cf0f957edd5 100644 --- a/ACE/ace/Timer_Wheel_T.cpp +++ b/ACE/ace/Timer_Wheel_T.cpp @@ -11,6 +11,7 @@ #include "ace/Guard_T.h" #include "ace/Timer_Wheel_T.h" #include "ace/Log_Msg.h" +#include "ace/Truncate.h" ACE_BEGIN_VERSIONED_NAMESPACE_DECL @@ -321,7 +322,7 @@ ACE_Timer_Wheel_T<TYPE, FUNCTOR, ACE_LOCK, TIME_POLICY>::generate_timer_id (u_in # pragma warning(push) # pragma warning(disable : 4311) #endif /* ACE_WIN64 */ - long next_cnt = reinterpret_cast<long> (root->get_act ()); + long next_cnt = ACE_Utils::truncate_cast<long> ((intptr_t)root->get_act ()); #if defined (ACE_WIN64) # pragma warning(pop) #endif /* ACE_WIN64 */ diff --git a/ACE/ace/config-win32-mingw.h b/ACE/ace/config-win32-mingw.h index f711a58665a..f5f75e59f9c 100644 --- a/ACE/ace/config-win32-mingw.h +++ b/ACE/ace/config-win32-mingw.h @@ -28,7 +28,7 @@ #define ACE_HAS_USER_MODE_MASKS -#if (__MINGW32_MAJOR_VERSION < 2) && (__MINGW64_VERSION_MAJOR < 3) +#if (__MINGW32_MAJOR_VERSION < 2) # error You need a newer version (>= 2.0) of mingw32/w32api #endif @@ -38,7 +38,7 @@ # define ACE_FILENO_EQUIVALENT ::_fileno #endif -#if (__MINGW32_MAJOR_VERSION >= 3) || (__MINGW64_VERSION_MAJOR >= 3) +#if (__MINGW32_MAJOR_VERSION >= 3) # define ACE_HAS_SSIZE_T # undef ACE_LACKS_STRUCT_DIR # undef ACE_LACKS_OPENDIR @@ -51,21 +51,8 @@ # define ACE_LACKS_DIRENT_H #endif -#if (__MINGW32_MAJOR_VERSION > 3) || ((__MINGW32_MAJOR_VERSION == 3) && (__MINGW32_MINOR_VERSION >= 15)) +#if (__MINGW32_MAJOR_VERSION > 3) || ((__MINGW32_MAJOR_VERSION == 3) && (__MINGW32_MINOR_VERSION >= 15)) # undef ACE_LACKS_USECONDS_T -#elif (__MINGW64_VERSION_MAJOR >= 3) -# undef ACE_LACKS_USECONDS_T -#endif - -#if (__MINGW64_VERSION_MAJOR >= 3) -# define ACE_HAS_POSIX_TIME 1 -# define ACE_LACKS_TIMESPEC_T 1 - -# include <stdlib.h> -# if defined (strtod) -# undef strtod -# endif -#else # if defined (ACE_LACKS_SIGSET_T) # undef ACE_LACKS_SIGSET_T # endif diff --git a/ACE/ace/config-win32-mingw64.h b/ACE/ace/config-win32-mingw64.h new file mode 100644 index 00000000000..89e99c73d37 --- /dev/null +++ b/ACE/ace/config-win32-mingw64.h @@ -0,0 +1,129 @@ +// -*- C++ -*- +// $Id$ + +// +// The following configuration file is designed to work for win32 +// platforms using gcc/g++ with mingw64 (http://http://mingw-w64.sourceforge.net/). +// + +#ifndef ACE_CONFIG_WIN32_MINGW64_H +#define ACE_CONFIG_WIN32_MINGW64_H +#include /**/ "ace/pre.h" + +#ifndef ACE_CONFIG_WIN32_H +# error Use config-win32.h in config.h instead of this header +#endif /* ACE_CONFIG_WIN32_H */ + +#define ACE_CC_PREPROCESSOR "cpp" +#define ACE_CC_PREPROCESOR_ARGS "" + +#if !defined(__MINGW32__) || !defined (__MINGW64_VERSION_MAJOR) +# error You do not seem to be using mingw64 +#endif + +#if defined (WIN64) || defined (__WIN64__) +# define ACE_SIZEOF_LONG_DOUBLE 16 +#else +# define ACE_SIZEOF_LONG_DOUBLE 12 +#endif + +#include "ace/config-g++-common.h" + +#include /**/ <_mingw.h> +#include /**/ <w32api.h> + +#if defined (exception_info) +# undef exception_info +#endif + +#define ACE_HAS_USER_MODE_MASKS + +#if (!defined (__MINGW64_VERSION_MAJOR) || (__MINGW64_VERSION_MAJOR < 2)) +# error You need a newer version (>= 2.0) of mingw32/w32api +#endif + +#include <stdio.h> + +#if defined (fileno) +# undef fileno +#endif +#if (__MINGW64_VERSION_MAJOR >= 3) +# define ACE_FILENO_EQUIVALENT ::_fileno +#endif + +#if (__MINGW64_VERSION_MAJOR >= 2) + +# define ACE_HAS_SSIZE_T +# undef ACE_LACKS_STRUCT_DIR +# undef ACE_LACKS_OPENDIR +# undef ACE_LACKS_CLOSEDIR +# undef ACE_LACKS_READDIR +# undef ACE_LACKS_TELLDIR +# undef ACE_LACKS_SEEKDIR +# undef ACE_LACKS_REWINDDIR +# undef ACE_LACKS_USECONDS_T + +# define ACE_HAS_POSIX_TIME 1 +# define ACE_LACKS_TIMESPEC_T 1 +# define ACE_HAS_NONCONST_SELECT_TIMEVAL 1 + +# if defined (ACE_HAS_QOS) && !defined (ACE_HAS_WINSOCK2_GQOS) +# define ACE_HAS_WINSOCK2_GQOS +# endif + +# if defined (WIN64) || defined (__WIN64__) +# define ACE_LACKS_INLINE_ASSEMBLY +# endif + +# include <stdlib.h> +# if defined (strtod) +# undef strtod +# endif + +#else +# define ACE_LACKS_DIRENT_H +#endif // __MINGW64_VERSION_MAJOR >= 3 + +#undef ACE_HAS_WTOF + +#define ACE_LACKS_SYS_SHM_H +#define ACE_LACKS_TERMIOS_H +#define ACE_LACKS_NETINET_TCP_H +#define ACE_LACKS_STRRECVFD +#define ACE_LACKS_STRPTIME +#define ACE_LACKS_POLL_H +#define ACE_LACKS_REGEX_H +#define ACE_LACKS_SYS_MSG_H +#define ACE_LACKS_PWD_H +#define ACE_LACKS_SEMAPHORE_H +#define ACE_LACKS_UCONTEXT_H +#define ACE_LACKS_SYS_SELECT_H +#define ACE_LACKS_SYS_RESOURCE_H +#define ACE_LACKS_SYS_WAIT_H +#define ACE_LACKS_DLFCN_H +#define ACE_LACKS_SYS_MMAN_H +#define ACE_LACKS_SYS_UIO_H +#define ACE_LACKS_SYS_SOCKET_H +#define ACE_LACKS_NETINET_IN_H +#define ACE_LACKS_NETDB_H +#define ACE_LACKS_NET_IF_H +#define ACE_LACKS_SYS_IPC_H +#define ACE_LACKS_SYS_SEM_H +#define ACE_LACKS_STROPTS_H +#define ACE_LACKS_SYS_IOCTL_H +#define ACE_LACKS_PDH_H +#define ACE_LACKS_PDHMSG_H +#define ACE_LACKS_STRTOK_R +#define ACE_LACKS_LOCALTIME_R +#define ACE_HAS_NONCONST_WCSDUP +#define ACE_ISCTYPE_EQUIVALENT ::_isctype + +#define ACE_INT64_FORMAT_SPECIFIER_ASCII "%I64d" +#define ACE_UINT64_FORMAT_SPECIFIER_ASCII "%I64u" + +#define ACE_ENDTHREADEX(STATUS) ::_endthreadex ((DWORD) (STATUS)) + +#define ACE_DLL_PREFIX ACE_TEXT ("lib") + +#include /**/ "ace/post.h" +#endif /* ACE_CONFIG_WIN32_MINGW64_H */ diff --git a/ACE/ace/config-win32.h b/ACE/ace/config-win32.h index 7cad8a1f1fa..1ada8467838 100644 --- a/ACE/ace/config-win32.h +++ b/ACE/ace/config-win32.h @@ -26,11 +26,15 @@ // Include the config-win32-* file specific to the compiler #if defined (_MSC_VER) -# include "ace/config-win32-msvc.h" +# include "ace/config-win32-msvc.h" #elif defined (ACE_HAS_CEGCC) //need to be prior to MINGW32 -# include "ace/config-win32-cegcc.h" +# include "ace/config-win32-cegcc.h" #elif defined (__MINGW32__) -# include "ace/config-win32-mingw.h" +# if defined (__MINGW64_VERSION_MAJOR) +# include "ace/config-win32-mingw64.h" +# else +# include "ace/config-win32-mingw.h" +# endif #elif defined (__DMC__) # include "ace/config-win32-dmc.h" #else diff --git a/ACE/apps/Gateway/Gateway/Gateway.cpp b/ACE/apps/Gateway/Gateway/Gateway.cpp index 7f14f27603e..b91c8026143 100644 --- a/ACE/apps/Gateway/Gateway/Gateway.cpp +++ b/ACE/apps/Gateway/Gateway/Gateway.cpp @@ -7,6 +7,7 @@ #include "ace/OS_NS_unistd.h" #include "ace/Service_Config.h" #include "ace/Signal.h" +#include "ace/Truncate.h" #include "Config_Files.h" #include "Event_Channel.h" #include "Gateway.h" @@ -71,7 +72,7 @@ Gateway::handle_input (ACE_HANDLE h) ACE_OS::read (h, buf, sizeof (buf)); // Shut us down. - return this->handle_signal ((int) h); + return this->handle_signal (ACE_Utils::truncate_cast<int> ((intptr_t)h)); } int diff --git a/ACE/examples/C++NPv1/Reactive_Logging_Server.h b/ACE/examples/C++NPv1/Reactive_Logging_Server.h index e7558a16e34..ccabc6a88fe 100644 --- a/ACE/examples/C++NPv1/Reactive_Logging_Server.h +++ b/ACE/examples/C++NPv1/Reactive_Logging_Server.h @@ -13,6 +13,7 @@ #include "ace/Log_Record.h" #include "ace/Handle_Set.h" #include "ace/Basic_Types.h" +#include "ace/Truncate.h" #include "ace/os_include/os_fcntl.h" #include "Iterative_Logging_Server.h" @@ -35,7 +36,7 @@ protected: virtual int wait_for_multiple_events () { active_handles_ = master_handle_set_; - int width = (int)active_handles_.max_set () + 1; + int width = ACE_Utils::truncate_cast<int> ((intptr_t)active_handles_.max_set ()) + 1; if (select (width, active_handles_.fdset (), 0, // no write_fds diff --git a/ACE/examples/C++NPv1/Reactive_Logging_Server_Ex.h b/ACE/examples/C++NPv1/Reactive_Logging_Server_Ex.h index c839b2453fc..912d454840b 100644 --- a/ACE/examples/C++NPv1/Reactive_Logging_Server_Ex.h +++ b/ACE/examples/C++NPv1/Reactive_Logging_Server_Ex.h @@ -18,6 +18,7 @@ #include "Logging_Server.h" #include "Logging_Handler.h" #include "ace/Null_Mutex.h" +#include "ace/Truncate.h" #include "ace/os_include/os_fcntl.h" typedef ACE_Hash_Map_Manager<ACE_HANDLE, @@ -46,7 +47,7 @@ protected: virtual int wait_for_multiple_events () { active_read_handles_ = master_handle_set_; - int width = (int) active_read_handles_.max_set () + 1; + int width = ACE_Utils::truncate_cast<int> (active_read_handles_.max_set ()) + 1; return ACE::select (width, active_read_handles_); } diff --git a/ACE/examples/IPC_SAP/SOCK_SAP/CPP-inserver.cpp b/ACE/examples/IPC_SAP/SOCK_SAP/CPP-inserver.cpp index 2fb30695bbc..2c097321acf 100644 --- a/ACE/examples/IPC_SAP/SOCK_SAP/CPP-inserver.cpp +++ b/ACE/examples/IPC_SAP/SOCK_SAP/CPP-inserver.cpp @@ -12,7 +12,7 @@ #include "ace/Basic_Types.h" #include "ace/OS_NS_sys_select.h" #include "ace/OS_main.h" - +#include "ace/Truncate.h" // Are we running verbosely? @@ -328,7 +328,7 @@ run_event_loop (u_short port) ACE_Time_Value timeout (ACE_DEFAULT_TIMEOUT); ACE_Handle_Set temp = handle_set; - int result = ACE_OS::select (int (oneway_acceptor.get_handle ()) + 1, + int result = ACE_OS::select (ACE_Utils::truncate_cast<int> ((intptr_t)oneway_acceptor.get_handle ()) + 1, (fd_set *) temp, 0, 0, diff --git a/ACE/examples/Reactor/Misc/test_early_timeouts.cpp b/ACE/examples/Reactor/Misc/test_early_timeouts.cpp index f22ffbb70f4..6ded80b602d 100644 --- a/ACE/examples/Reactor/Misc/test_early_timeouts.cpp +++ b/ACE/examples/Reactor/Misc/test_early_timeouts.cpp @@ -21,7 +21,7 @@ #include "ace/Time_Value.h" #include "ace/OS_NS_sys_time.h" #include "ace/OS_NS_sys_select.h" - +#include "ace/Truncate.h" int @@ -71,7 +71,7 @@ ACE_TMAIN (int, ACE_TCHAR *[]) starting_time_of_day = ACE_OS::gettimeofday (); // Wait for timeout - result = ACE_OS::select ((int) dummy_pipe.read_handle (), dummy_handle_set, 0, 0, &timeout); + result = ACE_OS::select (ACE_Utils::truncate_cast<int> ((intptr_t)dummy_pipe.read_handle ()), dummy_handle_set, 0, 0, &timeout); ACE_ASSERT (result == 0); // Note the time after select diff --git a/ACE/include/makeinclude/platform_mingw32.GNU b/ACE/include/makeinclude/platform_mingw32.GNU index 4e716aed034..dc1ada8ff4c 100644 --- a/ACE/include/makeinclude/platform_mingw32.GNU +++ b/ACE/include/makeinclude/platform_mingw32.GNU @@ -33,3 +33,13 @@ ifeq ($(winsock2),1) endif LIBS += -lwsock32 -lnetapi32 + +ifeq ($(GXX_4_OR_BETTER),1) + ifeq ($(CXX_MAJOR_VERSION),4) + ifeq ($(findstring $(CXX_MINOR_VERSION),7 8 9),$(CXX_MINOR_VERSION)) + CPPFLAGS += -Wno-unknown-pragmas + endif + else + CPPFLAGS += -Wno-unknown-pragmas + endif +endif diff --git a/ACE/performance-tests/SCTP/SOCK_STREAM_srv.cpp b/ACE/performance-tests/SCTP/SOCK_STREAM_srv.cpp index a9ff3959a42..a307e6e127b 100644 --- a/ACE/performance-tests/SCTP/SOCK_STREAM_srv.cpp +++ b/ACE/performance-tests/SCTP/SOCK_STREAM_srv.cpp @@ -7,6 +7,7 @@ #include "ace/Thread_Manager.h" #include "ace/Handle_Set.h" #include "ace/CDR_Stream.h" +#include "ace/Truncate.h" // FUZZ: disable check_for_streams_include #include "ace/streams.h" @@ -311,7 +312,7 @@ int ACE_TMAIN (int argc, ACE_TCHAR **argv){ // services. So select was needed to wait on both sockets // simultaneously. In this test we could just call accept on the // one socket. - int result = ACE_OS::select((int) (acceptor_socket.get_handle()) +1, + int result = ACE_OS::select(ACE_Utils::truncate_cast<int> ((intptr_t)acceptor_socket.get_handle()) +1, (fd_set *) temp, 0, 0, diff --git a/ACE/tests/Map_Test.h b/ACE/tests/Map_Test.h index 39b4db9b682..276f5ab6325 100644 --- a/ACE/tests/Map_Test.h +++ b/ACE/tests/Map_Test.h @@ -53,7 +53,7 @@ public: size_t original_size = key.size (); // Size of this counter key. - size_t counter_key_size = sizeof this->counter_; + const size_t counter_key_size = sizeof this->counter_; // Resize to accommodate both the original data and the new key. key.size (counter_key_size + original_size); @@ -61,7 +61,7 @@ public: // Add new key data. ACE_OS::memcpy (&key[original_size], &++this->counter_, - sizeof this->counter_); + counter_key_size); // Success. return 0; diff --git a/ACE/tests/Process_Env_Test.cpp b/ACE/tests/Process_Env_Test.cpp index 116f800ad5e..185f7302adf 100644 --- a/ACE/tests/Process_Env_Test.cpp +++ b/ACE/tests/Process_Env_Test.cpp @@ -28,7 +28,8 @@ void create_large_env (setenvfn_t setenv, void *ctx) static const size_t varsize = 1200; for (int i = 0; i < 26; i++) { - char name[2] = { 'A' + i, '\0' }; + char name[2] = { 'A', '\0' }; + name[0] += i; char value[varsize]; ACE_OS::memset (value, 'R', varsize); value[varsize - 1] = '\0'; diff --git a/ACE/tests/Thread_Timer_Queue_Adapter_Test.cpp b/ACE/tests/Thread_Timer_Queue_Adapter_Test.cpp index a364b027ba5..e59f43c621a 100644 --- a/ACE/tests/Thread_Timer_Queue_Adapter_Test.cpp +++ b/ACE/tests/Thread_Timer_Queue_Adapter_Test.cpp @@ -13,6 +13,7 @@ #include "ace/Timer_Wheel.h" #include "ace/Timer_Queue_Adapters.h" +#include "ace/Truncate.h" #include "test_config.h" #if defined (ACE_HAS_THREADS) @@ -143,7 +144,7 @@ class CTestEventHandler : public ICustomEventHandler /// @param p_vParameter virtual int operator() (void* p_vParameter) { - long iParameter = (long) p_vParameter; + long iParameter = ACE_Utils::truncate_cast<long> ((intptr_t)p_vParameter); ACE_DEBUG((LM_DEBUG, ACE_TEXT("%I(%t) Incrementing test event handler call count by %d.\n"), |