[10643] Update the ACE part we use to 5.8.2

Signed-off-by: Neo2003 <Neo.2003@Hotmail.fr>
This commit is contained in:
Neo2003 2010-10-25 20:36:51 +02:00
parent 8f71d95c0d
commit 23c920ca4b
739 changed files with 22031 additions and 40373 deletions

View file

@ -1,13 +1,8 @@
// $Id: OS_NS_stdio.cpp 82586 2008-08-11 12:46:00Z johnnyw $
// $Id: OS_NS_stdio.cpp 91286 2010-08-05 09:04:31Z johnnyw $
#include "ace/OS_NS_stdio.h"
#include "ace/OS_NS_Thread.h"
ACE_RCSID (ace,
OS_NS_stdio,
"$Id: OS_NS_stdio.cpp 82586 2008-08-11 12:46:00Z johnnyw $")
#if !defined (ACE_HAS_INLINED_OSCALLS)
# include "ace/OS_NS_stdio.inl"
#endif /* ACE_HAS_INLINED_OSCALLS */
@ -74,42 +69,6 @@ ACE_OS::ace_flock_t::dump (void) const
/*****************************************************************************/
#if defined (ACE_USES_WCHAR)
void ACE_OS::checkUnicodeFormat (FILE* fp)
{
if (fp != 0)
{
// Due to the ACE_TCHAR definition, all default input files, such as
// svc.conf, have to be in Unicode format (small endian) on WinCE
// because ACE has all 'char' converted into ACE_TCHAR.
// However, for TAO, ASCII files, such as IOR file, can still be read
// and be written without any error since given buffers are all in 'char'
// type instead of ACE_TCHAR. Therefore, it is user's reponsibility to
// select correct buffer type.
// At this point, check if the file is Unicode or not.
ACE_UINT16 first_two_bytes;
size_t numRead =
ACE_OS::fread(&first_two_bytes, sizeof (first_two_bytes), 1, fp);
if (numRead == 1)
{
if ((first_two_bytes != 0xFFFE) && // not a small endian Unicode file
(first_two_bytes != 0xFEFF)) // not a big endian Unicode file
{
// set file pointer back to the beginning
#if defined (ACE_WIN32)
ACE_OS::fseek(fp, 0, FILE_BEGIN);
#else
ACE_OS::fseek(fp, 0, SEEK_SET);
#endif /* ACE_WIN32 */
}
}
// if it is a Unicode file, file pointer will be right next to the first
// two-bytes
}
}
#endif // ACE_USES_WCHAR
#if defined (ACE_WIN32) && !defined (ACE_HAS_WINCE)
namespace
@ -165,6 +124,11 @@ ACE_OS::fopen (const char *filename,
const ACE_TCHAR *mode)
{
ACE_OS_TRACE ("ACE_OS::fopen");
#if defined (ACE_LACKS_FOPEN)
ACE_UNUSED_ARG (filename);
ACE_UNUSED_ARG (mode);
ACE_NOTSUP_RETURN (0);
#else
int hmode = _O_TEXT;
// Let the chips fall where they may if the user passes in a NULL
@ -197,9 +161,6 @@ ACE_OS::fopen (const char *filename,
# endif /* defined(ACE_HAS_NONCONST_FDOPEN) && !defined (ACE_USES_WCHAR)) */
if (fp != 0)
{
# if defined (ACE_USES_WCHAR)
checkUnicodeFormat(fp);
# endif // ACE_USES_WCHAR
return fp;
}
::_close (fd);
@ -208,6 +169,7 @@ ACE_OS::fopen (const char *filename,
ACE_OS::close (handle);
}
return 0;
#endif
}
#if defined (ACE_HAS_WCHAR)
@ -230,6 +192,11 @@ ACE_OS::fopen (const wchar_t *filename,
const ACE_TCHAR *mode)
{
ACE_OS_TRACE ("ACE_OS::fopen");
#if defined (ACE_LACKS_FOPEN)
ACE_UNUSED_ARG (filename);
ACE_UNUSED_ARG (mode);
ACE_NOTSUP_RETURN (0);
#else
int hmode = _O_TEXT;
for (const ACE_TCHAR *mode_ptr = mode; *mode_ptr != 0; mode_ptr++)
@ -255,9 +222,6 @@ ACE_OS::fopen (const wchar_t *filename,
# endif /* defined(ACE_HAS_NONCONST_FDOPEN) && !defined (ACE_USES_WCHAR)) */
if (fp != 0)
{
# if defined (ACE_USES_WCHAR)
checkUnicodeFormat(fp);
# endif // ACE_USES_WCHAR
return fp;
}
::_close (fd);
@ -266,6 +230,7 @@ ACE_OS::fopen (const wchar_t *filename,
ACE_OS::close (handle);
}
return 0;
#endif
}
#endif /* ACE_HAS_WCHAR */
@ -278,10 +243,9 @@ int
ACE_OS::fprintf (FILE *fp, const char *format, ...)
{
// ACE_OS_TRACE ("ACE_OS::fprintf");
int result = 0;
va_list ap;
va_start (ap, format);
result = ACE_OS::vfprintf (fp, format, ap);
int const result = ACE_OS::vfprintf (fp, format, ap);
va_end (ap);
return result;
}
@ -291,10 +255,9 @@ int
ACE_OS::fprintf (FILE *fp, const wchar_t *format, ...)
{
// ACE_OS_TRACE ("ACE_OS::fprintf");
int result = 0;
va_list ap;
va_start (ap, format);
result = ACE_OS::vfprintf (fp, format, ap);
int const result = ACE_OS::vfprintf (fp, format, ap);
va_end (ap);
return result;
}
@ -304,10 +267,9 @@ int
ACE_OS::asprintf (char **bufp, const char *format, ...)
{
// ACE_OS_TRACE ("ACE_OS::asprintf");
int result;
va_list ap;
va_start (ap, format);
result = ACE_OS::vasprintf (bufp, format, ap);
int const result = ACE_OS::vasprintf (bufp, format, ap);
va_end (ap);
return result;
}
@ -317,10 +279,9 @@ int
ACE_OS::asprintf (wchar_t **bufp, const wchar_t *format, ...)
{
// ACE_OS_TRACE ("ACE_OS::asprintf");
int result;
va_list ap;
va_start (ap, format);
result = ACE_OS::vasprintf (bufp, format, ap);
int const result = ACE_OS::vasprintf (bufp, format, ap);
va_end (ap);
return result;
}
@ -330,10 +291,9 @@ int
ACE_OS::printf (const char *format, ...)
{
// ACE_OS_TRACE ("ACE_OS::printf");
int result;
va_list ap;
va_start (ap, format);
result = ACE_OS::vprintf (format, ap);
int const result = ACE_OS::vprintf (format, ap);
va_end (ap);
return result;
}
@ -343,10 +303,9 @@ int
ACE_OS::printf (const wchar_t *format, ...)
{
// ACE_OS_TRACE ("ACE_OS::printf");
int result;
va_list ap;
va_start (ap, format);
result = ACE_OS::vprintf (format, ap);
int const result = ACE_OS::vprintf (format, ap);
va_end (ap);
return result;
}
@ -358,7 +317,7 @@ ACE_OS::snprintf (char *buf, size_t maxlen, const char *format, ...)
// ACE_OS_TRACE ("ACE_OS::snprintf");
va_list ap;
va_start (ap, format);
int result = ACE_OS::vsnprintf (buf, maxlen, format, ap);
int const result = ACE_OS::vsnprintf (buf, maxlen, format, ap);
va_end (ap);
return result;
}
@ -370,7 +329,7 @@ ACE_OS::snprintf (wchar_t *buf, size_t maxlen, const wchar_t *format, ...)
// ACE_OS_TRACE ("ACE_OS::snprintf");
va_list ap;
va_start (ap, format);
int result = ACE_OS::vsnprintf (buf, maxlen, format, ap);
int const result = ACE_OS::vsnprintf (buf, maxlen, format, ap);
va_end (ap);
return result;
}
@ -382,7 +341,7 @@ ACE_OS::sprintf (char *buf, const char *format, ...)
// ACE_OS_TRACE ("ACE_OS::sprintf");
va_list ap;
va_start (ap, format);
int result = ACE_OS::vsprintf (buf, format, ap);
int const result = ACE_OS::vsprintf (buf, format, ap);
va_end (ap);
return result;
}
@ -394,7 +353,7 @@ ACE_OS::sprintf (wchar_t *buf, const wchar_t *format, ...)
// ACE_OS_TRACE ("ACE_OS::sprintf");
va_list ap;
va_start (ap, format);
int result = ACE_OS::vsprintf (buf, format, ap);
int const result = ACE_OS::vsprintf (buf, format, ap);
va_end (ap);
return result;
}
@ -406,7 +365,7 @@ ACE_OS::vasprintf_emulation(char **bufp, const char *format, va_list argptr)
{
va_list ap;
va_copy (ap, argptr);
int size = ACE_OS::vsnprintf(0, 0, format, ap);
int size = ACE_OS::vsnprintf (0, 0, format, ap);
va_end (ap);
if (size != -1)