Mac OS X support

This commit is contained in:
Benjamin Navarro
2015-10-11 18:31:30 +02:00
parent faa74047db
commit a09d5c3c95
28 changed files with 2223 additions and 154 deletions

View File

@@ -2,7 +2,7 @@
#include <nana/config.hpp>
#ifdef NANA_WINDOWS
#include <windows.h>
#elif defined(NANA_LINUX)
#elif defined(NANA_LINUX) || defined(NANA_MACOS)
#include <sys/time.h>
#endif
@@ -15,7 +15,7 @@ namespace system
{
#if defined(NANA_WINDOWS)
LARGE_INTEGER beg_timestamp;
#elif defined(NANA_LINUX)
#elif defined(NANA_LINUX) || defined(NANA_MACOS)
struct timeval beg_timestamp;
#endif
};
@@ -45,7 +45,7 @@ namespace system
{
#if defined(NANA_WINDOWS)
::QueryPerformanceCounter(&impl_->beg_timestamp);
#elif defined(NANA_LINUX)
#elif defined(NANA_LINUX) || defined(NANA_MACOS)
struct timezone tz;
::gettimeofday(&impl_->beg_timestamp, &tz);
#endif
@@ -63,7 +63,7 @@ namespace system
::QueryPerformanceFrequency(&freq);
return double(diff)/double(freq.QuadPart) * 1000;
#elif defined(NANA_LINUX)
#elif defined(NANA_LINUX) || defined(NANA_MACOS)
struct timeval tv;
struct timezone tz;
gettimeofday(&tv, &tz);