fix compile with Sun CC

pull/2/head
weidai 2007-05-05 02:15:11 +00:00
parent 64157fa5e0
commit d2f4175c59
4 changed files with 7 additions and 9 deletions

View File

@ -234,7 +234,7 @@ void BenchMarkByName(const char *factoryName, size_t keyLength = 0, const char *
} }
template <class T> template <class T>
void BenchMarkByNameKeyLess(const char *factoryName, char *displayName=NULL, const NameValuePairs &params = g_nullNameValuePairs, T *x=NULL) void BenchMarkByNameKeyLess(const char *factoryName, const char *displayName=NULL, const NameValuePairs &params = g_nullNameValuePairs, T *x=NULL)
{ {
std::string name = factoryName; std::string name = factoryName;
if (displayName) if (displayName)
@ -252,7 +252,7 @@ void BenchmarkAll(double t, double hertz)
g_allocatedTime = t; g_allocatedTime = t;
g_hertz = hertz; g_hertz = hertz;
char *cpb, *cpk; const char *cpb, *cpk;
if (g_hertz) if (g_hertz)
{ {
cpb = "<TH>Cycles Per Byte"; cpb = "<TH>Cycles Per Byte";

View File

@ -354,7 +354,7 @@ NAMESPACE_END
#define CRYPTOPP_WIN32_AVAILABLE #define CRYPTOPP_WIN32_AVAILABLE
#endif #endif
#if defined(__unix__) || defined(__MACH__) || defined(__NetBSD__) #if defined(__unix__) || defined(__MACH__) || defined(__NetBSD__) || defined(__sun)
#define CRYPTOPP_UNIX_AVAILABLE #define CRYPTOPP_UNIX_AVAILABLE
#endif #endif

View File

@ -86,12 +86,8 @@ TimerWord Timer::TicksPerSecond()
return freq.QuadPart; return freq.QuadPart;
#elif defined(CRYPTOPP_UNIX_AVAILABLE) #elif defined(CRYPTOPP_UNIX_AVAILABLE)
return 1000000; return 1000000;
#elif defined(CLOCKS_PER_SEC)
return CLOCKS_PER_SEC;
#elif defined(CLK_TCK)
return CLK_TCK;
#else #else
return 1000000; return CLOCKS_PER_SEC;
#endif #endif
} }

View File

@ -2,6 +2,9 @@
#define CRYPTOPP_HRTIMER_H #define CRYPTOPP_HRTIMER_H
#include "config.h" #include "config.h"
#ifndef HIGHRES_TIMER_AVAILABLE
#include <time.h>
#endif
NAMESPACE_BEGIN(CryptoPP) NAMESPACE_BEGIN(CryptoPP)
@ -12,7 +15,6 @@ NAMESPACE_BEGIN(CryptoPP)
typedef word32 TimerWord; typedef word32 TimerWord;
#endif #endif
#else #else
#include <time.h>
typedef clock_t TimerWord; typedef clock_t TimerWord;
#endif #endif