summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormsmit <msmit@remedy.nl>2009-04-08 10:59:58 +0000
committermsmit <msmit@remedy.nl>2009-04-08 10:59:58 +0000
commitde5c12d1c6d00dbc7c4f00b498bed6941ea6956a (patch)
tree888dfab0d8d40904fa2d5ed7a29af968a3332c9d
parent8c02cf1944b1ae083e1307b22ec0e5d60504f5b1 (diff)
downloadATCD-de5c12d1c6d00dbc7c4f00b498bed6941ea6956a.tar.gz
Wed Apr 8 10:59:59 UTC 2009 Marcel Smit <msmit@remedy.nl>
* ace/config-win32-cegcc.h: Added to support CE gcc compiler * ace/config-win32-common.h: Prevent ACE_HAS_CUSTOM_EXPORT_MACROS from being defined a second time. * ace/config-win32.h: Introduced ACE_HAS_CEGCC. When defined, config-win32-cegcc is included. * ace/Numeric_Limits.h: "#ifdef" replace by "#if defined" * ace/os_include/sys/os_stat.h: Prevent defines from being defined a second time. * ace/OS_NS_stdio.inl: Prevent compiler errors when compiling with CE gcc compiler. Using global namespace for fseek * ace/OS_NS_stdlib.inl: Prevent compiler errors when compiling with CE gcc compiler. * ace/OS_NS_Thread.h: Defining STACK_SIZE_PARAM_IS_A_RESERVATION (when it isn't defined yet). * ace/OS_NS_time.h: * ace/Time_Value.inl: Prevent pragma warnings when compiling with CE gcc compiler.
-rw-r--r--ACE/ChangeLog38
-rw-r--r--ACE/ace/Numeric_Limits.h2
-rw-r--r--ACE/ace/OS_NS_Thread.h3
-rw-r--r--ACE/ace/OS_NS_stdio.inl10
-rw-r--r--ACE/ace/OS_NS_stdlib.inl4
-rw-r--r--ACE/ace/OS_NS_time.h6
-rw-r--r--ACE/ace/Time_Value.inl4
-rw-r--r--ACE/ace/config-win32-cegcc.h114
-rw-r--r--ACE/ace/config-win32-common.h4
-rw-r--r--ACE/ace/config-win32.h2
-rw-r--r--ACE/ace/os_include/sys/os_stat.h59
11 files changed, 220 insertions, 26 deletions
diff --git a/ACE/ChangeLog b/ACE/ChangeLog
index 5e1c0404d2a..c6efa24cea2 100644
--- a/ACE/ChangeLog
+++ b/ACE/ChangeLog
@@ -1,3 +1,41 @@
+Wed Apr 9 10:59:59 UTC 2009 Marcel Smit <msmit@remedy.nl>
+
+ * ace/config-win32-cegcc.h:
+ Added to support CE gcc compiler
+
+ * ace/config-win32-common.h:
+ Prevent ACE_HAS_CUSTOM_EXPORT_MACROS from
+ being defined a second time.
+
+ * ace/config-win32.h:
+ Introduced ACE_HAS_CEGCC. When defined,
+ config-win32-cegcc is included.
+
+ * ace/Numeric_Limits.h:
+ "#ifdef" replace by "#if defined"
+
+ * ace/os_include/sys/os_stat.h:
+ Prevent defines from being defined a second time.
+
+ * ace/OS_NS_stdio.inl:
+ Prevent compiler errors when compiling
+ with CE gcc compiler.
+
+ Using global namespace for fseek
+
+ * ace/OS_NS_stdlib.inl:
+ Prevent compiler errors when compiling
+ with CE gcc compiler.
+
+ * ace/OS_NS_Thread.h:
+ Defining STACK_SIZE_PARAM_IS_A_RESERVATION (when it
+ isn't defined yet).
+
+ * ace/OS_NS_time.h:
+ * ace/Time_Value.inl:
+ Prevent pragma warnings when compiling with
+ CE gcc compiler.
+
Wed Apr 8 10:13:28 UTC 2009 Olli Savia <ops@iki.fi>
* ace/config-lynxos.h:
diff --git a/ACE/ace/Numeric_Limits.h b/ACE/ace/Numeric_Limits.h
index d50abb19f98..506b5a62ea6 100644
--- a/ACE/ace/Numeric_Limits.h
+++ b/ACE/ace/Numeric_Limits.h
@@ -37,7 +37,7 @@
# include "ace/Basic_Types.h"
#else
-# ifdef __MINGW32__
+# if defined __MINGW32__
// Windows defines min/max macros that interfere with the
// numeric_limits::min/max() traits. Undefine those macros before
// including <limits>.
diff --git a/ACE/ace/OS_NS_Thread.h b/ACE/ace/OS_NS_Thread.h
index a9d85a0e802..82573039b34 100644
--- a/ACE/ace/OS_NS_Thread.h
+++ b/ACE/ace/OS_NS_Thread.h
@@ -304,6 +304,9 @@ ACE_END_VERSIONED_NAMESPACE_DECL
# define THR_DAEMON 0 /* ignore in most places */
# define THR_JOINABLE 0 /* ignore in most places */
# define THR_SUSPENDED CREATE_SUSPENDED
+# if !defined (STACK_SIZE_PARAM_IS_A_RESERVATION)
+# define STACK_SIZE_PARAM_IS_A_RESERVATION 0x00010000
+# endif /* STACK_SIZE_PARAM_IS_A_RESERVATION */
# define THR_USE_AFX 0x01000000
# define THR_SCHED_FIFO 0
# define THR_SCHED_RR 0
diff --git a/ACE/ace/OS_NS_stdio.inl b/ACE/ace/OS_NS_stdio.inl
index 3c610552f88..692cbc71c39 100644
--- a/ACE/ace/OS_NS_stdio.inl
+++ b/ACE/ace/OS_NS_stdio.inl
@@ -498,9 +498,15 @@ ACE_OS::fdopen (ACE_HANDLE handle, const ACE_TCHAR *mode)
{
ACE_OS_TRACE ("ACE_OS::fdopen");
#if defined (ACE_HAS_WINCE)
- ACE_OSCALL_RETURN (::_wfdopen (handle, ACE_TEXT_ALWAYS_WCHAR (mode)),
+# if defined (ACE_HAS_NONCONST_WFDOPEN)
+ ACE_OSCALL_RETURN (::_wfdopen ((int)handle, const_cast <ACE_TCHAR*> (ACE_TEXT_ALWAYS_WCHAR (mode))),
FILE*,
0);
+# else
+ ACE_OSCALL_RETURN (::_wfdopen ((int)handle, ACE_TEXT_ALWAYS_WCHAR (mode)),
+ FILE*,
+ 0);
+# endif
#elif defined (ACE_WIN32)
// kernel file handle -> FILE* conversion...
// Options: _O_APPEND, _O_RDONLY and _O_TEXT are lost
@@ -873,7 +879,7 @@ ACE_OS::rewind (FILE *fp)
#else
// This isn't perfect since it doesn't reset EOF, but it's probably
// the closest we can get on WINCE.
- (void) fseek (fp, 0L, SEEK_SET);
+ (void) ::fseek (fp, 0L, SEEK_SET);
#endif /* ACE_HAS_WINCE */
}
diff --git a/ACE/ace/OS_NS_stdlib.inl b/ACE/ace/OS_NS_stdlib.inl
index 63f931fdd78..8f634f030be 100644
--- a/ACE/ace/OS_NS_stdlib.inl
+++ b/ACE/ace/OS_NS_stdlib.inl
@@ -59,7 +59,7 @@ ACE_OS::atoi (const char *s)
ACE_INLINE int
ACE_OS::atoi (const wchar_t *s)
{
-#if defined (ACE_WIN32)
+#if defined (ACE_WIN32) && defined (ACE_HAS_WTOI)
ACE_OSCALL_RETURN (::_wtoi (s), int, -1);
#else /* ACE_WIN32 */
return ACE_OS::atoi (ACE_Wide_To_Ascii (s).char_rep ());
@@ -77,7 +77,7 @@ ACE_OS::atol (const char *s)
ACE_INLINE long
ACE_OS::atol (const wchar_t *s)
{
-#if defined (ACE_WIN32)
+#if defined (ACE_WIN32) && defined (ACE_HAS_WTOL)
ACE_OSCALL_RETURN (::_wtol (s), long, -1);
#else /* ACE_WIN32 */
return ACE_OS::atol (ACE_Wide_To_Ascii (s).char_rep ());
diff --git a/ACE/ace/OS_NS_time.h b/ACE/ace/OS_NS_time.h
index 5e927229c38..ca5d21ed736 100644
--- a/ACE/ace/OS_NS_time.h
+++ b/ACE/ace/OS_NS_time.h
@@ -99,7 +99,8 @@ inline long ace_timezone()
#if !defined (ACE_LACKS_DIFFTIME)
-# if defined (_WIN32_WCE) && (_WIN32_WCE == 0x600) && !defined (_USE_32BIT_TIME_T)
+# if defined (_WIN32_WCE) && (_WIN32_WCE == 0x600) && !defined (_USE_32BIT_TIME_T) \
+ && defined (_MSC_VER)
// The WinCE 6.0 SDK ships with a diff_time that uses __time32_t as type
// not time_t. This resolves in compilation warnings because time_t
// can be 64bit. Disable at this momemt the warning for just this method
@@ -121,7 +122,8 @@ inline double ace_difftime(time_t t1, time_t t0)
{
return difftime (t1, t0);
}
-# if defined (_WIN32_WCE) && (_WIN32_WCE == 0x600) && !defined (_USE_32BIT_TIME_T)
+# if defined (_WIN32_WCE) && (_WIN32_WCE == 0x600) && !defined (_USE_32BIT_TIME_T) \
+ && defined (_MSC_VER)
# pragma warning (pop)
# endif
#endif /* !ACE_LACKS_DIFFTIME */
diff --git a/ACE/ace/Time_Value.inl b/ACE/ace/Time_Value.inl
index 49788e3fd98..4614b7a97c3 100644
--- a/ACE/ace/Time_Value.inl
+++ b/ACE/ace/Time_Value.inl
@@ -69,7 +69,7 @@ ACE_INLINE void
ACE_Time_Value::set (time_t sec, suseconds_t usec)
{
// ACE_OS_TRACE ("ACE_Time_Value::set");
-# if defined (_WIN32_WCE) && (_WIN32_WCE == 0x600) && !defined (_USE_32BIT_TIME_T)
+# if defined (_WIN32_WCE) && (_WIN32_WCE == 0x600) && !defined (_USE_32BIT_TIME_T) && defined (_MSC_VER)
// The WinCE 6.0 SDK ships with a timeval tv_sec member that uses long as type
// not time_t. This resolves in compilation warnings because time_t
// can be 64bit. Disable at this momemt the warning for just this method
@@ -79,7 +79,7 @@ ACE_Time_Value::set (time_t sec, suseconds_t usec)
# pragma warning (disable: 4244)
# endif
this->tv_.tv_sec = sec;
-# if defined (_WIN32_WCE) && (_WIN32_WCE == 0x600) && !defined (_USE_32BIT_TIME_T)
+# if defined (_WIN32_WCE) && (_WIN32_WCE == 0x600) && !defined (_USE_32BIT_TIME_T) && defined (_MSC_VER)
# pragma warning (pop)
# endif
this->tv_.tv_usec = usec;
diff --git a/ACE/ace/config-win32-cegcc.h b/ACE/ace/config-win32-cegcc.h
new file mode 100644
index 00000000000..fcbb0d8e31a
--- /dev/null
+++ b/ACE/ace/config-win32-cegcc.h
@@ -0,0 +1,114 @@
+// -*- C++ -*-
+// $Id$
+
+//
+// The following configuration file is designed to work for win32
+// platforms using gcc/g++ with mingw32 (http://www.mingw.org).
+//
+
+#ifndef ACE_CONFIG_WIN32_CEGCC_H
+#define ACE_CONFIG_WIN32_CEGCC_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_NAME ACE_TEXT ("g++")
+#define ACE_CC_PREPROCESSOR "cpp"
+#define ACE_CC_PREPROCESOR_ARGS ""
+
+// Why all this is not in config-g++-common.h?
+#define ACE_CC_MAJOR_VERSION __GNUC__
+#define ACE_CC_MINOR_VERSION __GNUC_MINOR__
+#define ACE_CC_BETA_VERSION (0)
+
+#if !defined (ACE_HAS_CEGCC)
+# error You do not seem to be using cegcc
+#endif
+
+// We trust the user: He must have used -mpentiumpro or -mpentium
+// if that is what he wants.
+#if defined(pentiumpro) || defined(pentium)
+# define ACE_HAS_PENTIUM
+#endif
+
+#include "ace/config-g++-common.h"
+
+#undef _WIN32_WCE
+#define _WIN32_WCE 0x600
+
+#include /**/ <cegcc.h>
+#include /**/ <w32api.h>
+
+#define ACE_HAS_USER_MODE_MASKS
+
+#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
+
+#undef ACE_HAS_WTOF
+
+#define ACE_LACKS_SIGSET_DEFINITIONS
+#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_HAS_STRERROR
+#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_HAS_NONCONST_WCSDUP
+#define ACE_HAS_WINSOCK2_GQOS
+
+//Changes to compile on CE gcc.
+#undef ACE_HAS_TYPES_H
+#define ACE_LACKS_ERRNO_H
+#undef ACE_LACKS_SIGSET
+#undef ACE_LACKS_DEV_T
+#define ACE_LACKS_USECONDS_T
+#define ACE_LACKS_ISCTYPE
+#define ACE_HAS_NONCONST_WFDOPEN
+#undef ACE_HAS_WTOI
+#undef ACE_HAS_WTOL
+#define ACE_LACKS_GETSYSTEMTIMEASFILETIME
+#define ACE_LACKS_FILELOCKS
+
+#define ACE_INT64_FORMAT_SPECIFIER_ASCII "%I64d"
+#define ACE_UINT64_FORMAT_SPECIFIER_ASCII "%I64u"
+
+#if defined (_WIN32_WCE)
+# define ACE_ENDTHREADEX(STATUS) ExitThread ((DWORD) STATUS)
+#else
+# define ACE_ENDTHREADEX(STATUS) ::_endthreadex ((DWORD) STATUS)
+#endif /* _WIN32_WCE */
+
+#include /**/ "ace/post.h"
+#endif /* ACE_CONFIG_WIN32_CEGCC_H */
diff --git a/ACE/ace/config-win32-common.h b/ACE/ace/config-win32-common.h
index 920b55ab1ec..b7f821389e9 100644
--- a/ACE/ace/config-win32-common.h
+++ b/ACE/ace/config-win32-common.h
@@ -114,7 +114,7 @@
// #endif
// Define the special export macros needed to export symbols outside a dll
-#if !defined(__BORLANDC__)
+#if !defined(__BORLANDC__) && !defined (ACE_HAS_CUSTOM_EXPORT_MACROS)
#define ACE_HAS_CUSTOM_EXPORT_MACROS 1
#define ACE_Proper_Export_Flag __declspec (dllexport)
#define ACE_Proper_Import_Flag __declspec (dllimport)
@@ -322,6 +322,8 @@
// Win32 has wide-char support. Use of the compiler-defined wchar_t type
// is controlled in compiler configs since it's a compiler switch.
#define ACE_HAS_WCHAR
+#define ACE_HAS_WTOI
+#define ACE_HAS_WTOL
// Compiler/platform correctly calls init()/fini() for shared
// libraries. - applied for DLLs ?
diff --git a/ACE/ace/config-win32.h b/ACE/ace/config-win32.h
index 37cfb683519..417b7ccfc28 100644
--- a/ACE/ace/config-win32.h
+++ b/ACE/ace/config-win32.h
@@ -37,6 +37,8 @@
# include "ace/config-win32-msvc.h"
#elif defined (ghs)
# include "ace/config-win32-ghs.h"
+#elif defined (ACE_HAS_CEGCC) //need to be prior to MINGW32
+# include "ace/config-win32-cegcc.h"
#elif defined (__MINGW32__)
# include "ace/config-win32-mingw.h"
#elif defined (__DMC__)
diff --git a/ACE/ace/os_include/sys/os_stat.h b/ACE/ace/os_include/sys/os_stat.h
index 389cb1151a6..aebcad5ea7c 100644
--- a/ACE/ace/os_include/sys/os_stat.h
+++ b/ACE/ace/os_include/sys/os_stat.h
@@ -46,19 +46,44 @@ extern "C"
// the following macros are for POSIX conformance.
# if !defined (ACE_HAS_USER_MODE_MASKS)
-# define S_IRWXU 00700 /* read, write, execute: owner. */
-# define S_IRUSR 00400 /* read permission: owner. */
-# define S_IWUSR 00200 /* write permission: owner. */
-# define S_IXUSR 00100 /* execute permission: owner. */
+# if !defined (S_IRWXU)
+# define S_IRWXU 00700 /* read, write, execute: owner. */
+# endif /* !S_IRWXU */
+# if !defined (S_IRUSR)
+# define S_IRUSR 00400 /* read permission: owner. */
+# endif /* !S_IRUSR */
+# if !defined (S_IWUSR)
+# define S_IWUSR 00200 /* write permission: owner. */
+# endif /* !S_IWUSR */
+# if !defined (S_IXUSR)
+# define S_IXUSR 00100 /* execute permission: owner. */
+# endif /* !S_IXUSR */
# endif /* ACE_HAS_USER_MODE_MASKS */
-# define S_IRWXG 00070 /* read, write, execute: group. */
-# define S_IRGRP 00040 /* read permission: group. */
-# define S_IWGRP 00020 /* write permission: group. */
-# define S_IXGRP 00010 /* execute permission: group. */
-# define S_IRWXO 00007 /* read, write, execute: other. */
-# define S_IROTH 00004 /* read permission: other. */
-# define S_IWOTH 00002 /* write permission: other. */
-# define S_IXOTH 00001 /* execute permission: other. */
+
+# if !defined (S_IRWXG)
+# define S_IRWXG 00070
+# endif /* S_IRWXG */
+# if !defined (S_IRGRP)
+# define S_IRGRP 00040
+# endif /* S_IRGRP */
+# if !defined (S_IWGRP)
+# define S_IWGRP 00020
+# endif /* S_IWGRP */
+# if !defined (S_IXGRP)
+# define S_IXGRP 00010
+# endif /* S_IXGRP */
+# if !defined (S_IRWXO)
+# define S_IRWXO 00007
+# endif /* S_IRWXO */
+# if !defined (S_IROTH)
+# define S_IROTH 00004
+# endif /* S_IROTH */
+# if !defined (S_IWOTH)
+# define S_IWOTH 00002
+# endif /* S_IWOTH */
+# if !defined (S_IXOTH)
+# define S_IXOTH 00001
+# endif /* S_IXOTH */
// WinCE's S_IFLNK is defined with the other bits, below.
#if !defined (S_IFLNK) && !defined (ACE_HAS_WINCE)
@@ -86,10 +111,11 @@ extern "C"
# define S_IFREG FILE_ATTRIBUTE_NORMAL
# define S_IFLNK 0
- // Since CE does not have _stat by default as NT/2000 does, the 'stat'
- // struct defined here will be used. Also note that CE file system
- // struct is only for the CE 3.0 or later.
- // Refer to the WCHAR.H from Visual C++ and WIBASE.H from eVC 3.0.
+# if !defined (__MINGW32__)
+ // Since CE does not have _stat by default as NT/2000 does, the 'stat'
+ // struct defined here will be used. Also note that CE file system
+ // struct is only for the CE 3.0 or later.
+ // Refer to the WCHAR.H from Visual C++ and WIBASE.H from eVC 3.0.
struct stat
{
/// always 0 on Windows platforms
@@ -120,6 +146,7 @@ extern "C"
//u_long st_blksize; // optimal blocksize for I/O
//u_long st_flags; // user defined flags for file
};
+ #endif
#endif /* ACE_HAS_WINCE */
#ifdef __cplusplus