Remove std::hex as it does not seems to work on SGI, attempt to fix ftime problem on borland

This commit is contained in:
Andy Cedilnik 2002-10-15 07:20:02 -04:00
parent 5a1fccd34d
commit f70a759446
1 changed files with 14 additions and 7 deletions

View File

@ -26,13 +26,18 @@
// Taken from Python 2.1.3 // Taken from Python 2.1.3
#if defined( _WIN32 ) && !defined( __CYGWIN__ ) #if defined( _WIN32 ) && !defined( __CYGWIN__ )
# include <sys/timeb.h> # include <sys/timeb.h>
# define HAVE_FTIME # define HAVE_FTIME
# define FTIME _ftime # if defined( __BORLANDC__)
# define TIMEB _timeb # define FTIME ftime
# define TIMEB timeb
# else // Visual studio?
# define FTIME _ftime
# define TIMEB _timeb
# endif
#elif defined( __CYGWIN__ ) || defined( __linux__ ) #elif defined( __CYGWIN__ ) || defined( __linux__ )
# include <sys/time.h> # include <sys/time.h>
# define HAVE_GETTIMEOFDAY # define HAVE_GETTIMEOFDAY
#endif #endif
static double static double
@ -159,12 +164,14 @@ std::string ctest::MakeXMLSafe(const std::string& str)
{ {
std::string::size_type pos = 0; std::string::size_type pos = 0;
cmOStringStream ost; cmOStringStream ost;
char buffer[10];
for ( pos = 0; pos < str.size(); pos ++ ) for ( pos = 0; pos < str.size(); pos ++ )
{ {
char ch = str[pos]; char ch = str[pos];
if ( ch > 126 ) if ( ch > 126 )
{ {
ost << "&" << std::hex << (int)ch; sprintf(buffer, "&%x", (int)ch);
ost << buffer;
} }
else else
{ {