Commit 5a1fccd3 authored by Andy Cedilnik's avatar Andy Cedilnik
Browse files

Fix namespace, typo, and make ftime work on windows

parent f4859295
...@@ -26,8 +26,10 @@ ...@@ -26,8 +26,10 @@
// 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>
# define HAVE_FTIME # define HAVE_FTIME
# defint FTIME _ftime_ # define FTIME _ftime
# define TIMEB _timeb
#elif defined( __CYGWIN__ ) || defined( __linux__ ) #elif defined( __CYGWIN__ ) || defined( __linux__ )
# include <sys/time.h> # include <sys/time.h>
# define HAVE_GETTIMEOFDAY # define HAVE_GETTIMEOFDAY
...@@ -58,7 +60,7 @@ floattime(void) ...@@ -58,7 +60,7 @@ floattime(void)
#endif /* !HAVE_GETTIMEOFDAY */ #endif /* !HAVE_GETTIMEOFDAY */
{ {
#if defined(HAVE_FTIME) #if defined(HAVE_FTIME)
struct timeb t; struct TIMEB t;
FTIME(&t); FTIME(&t);
return (double)t.time + (double)t.millitm * (double)0.001; return (double)t.time + (double)t.millitm * (double)0.001;
#else /* !HAVE_FTIME */ #else /* !HAVE_FTIME */
...@@ -162,7 +164,7 @@ std::string ctest::MakeXMLSafe(const std::string& str) ...@@ -162,7 +164,7 @@ std::string ctest::MakeXMLSafe(const std::string& str)
char ch = str[pos]; char ch = str[pos];
if ( ch > 126 ) if ( ch > 126 )
{ {
ost << "&" << hex << ch; ost << "&" << std::hex << (int)ch;
} }
else else
{ {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment