mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-09-30 03:34:29 +03:00
Add hack to fix MacOS X build
This commit is contained in:
committed by
Felipe Zimmerle
parent
049f1abb62
commit
4e3a599f68
@@ -321,6 +321,11 @@ void createDir(std::string dir, int mode) {
|
|||||||
|
|
||||||
|
|
||||||
double cpu_seconds(void) {
|
double cpu_seconds(void) {
|
||||||
|
/*
|
||||||
|
* FIXME: Temporary hack to fix build on MacOS X. Very issuficient way, but
|
||||||
|
* works. Worth reimplementing using mach_absolute_time().
|
||||||
|
*/
|
||||||
|
#ifndef MACOSX
|
||||||
struct timespec t;
|
struct timespec t;
|
||||||
if (!clock_gettime(CLOCK_PROCESS_CPUTIME_ID, &t))
|
if (!clock_gettime(CLOCK_PROCESS_CPUTIME_ID, &t))
|
||||||
return static_cast<double>(t.tv_sec)
|
return static_cast<double>(t.tv_sec)
|
||||||
@@ -328,6 +333,7 @@ double cpu_seconds(void) {
|
|||||||
else
|
else
|
||||||
return static_cast<double>(clock()) /
|
return static_cast<double>(clock()) /
|
||||||
static_cast<double>(CLOCKS_PER_SEC);
|
static_cast<double>(CLOCKS_PER_SEC);
|
||||||
|
#endif
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user