fix compile with Sun CC
parent
64157fa5e0
commit
d2f4175c59
|
|
@ -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 ¶ms = g_nullNameValuePairs, T *x=NULL)
|
void BenchMarkByNameKeyLess(const char *factoryName, const char *displayName=NULL, const NameValuePairs ¶ms = 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";
|
||||||
|
|
|
||||||
2
config.h
2
config.h
|
|
@ -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
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue