From 51f566db838cca6dd2a5b235ae5d75eee0bfe6fa Mon Sep 17 00:00:00 2001 From: Simon Rit Date: Tue, 24 Jul 2012 11:25:51 +0200 Subject: [PATCH] _WIN32 is always defined and WIN32 maybe isn't, see http://msdn.microsoft.com/en-us/library/b0084kay%28v=vs.80%29.aspx --- common/clitkCommon.h | 2 +- common/clitkDD.h | 4 ++-- common/clitkPortability.h | 4 ++-- common/clitkTimer.cxx | 6 +++--- common/clitkTimer.h | 4 ++-- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/common/clitkCommon.h b/common/clitkCommon.h index 769ca63..9eb3652 100644 --- a/common/clitkCommon.h +++ b/common/clitkCommon.h @@ -38,7 +38,7 @@ #if defined(unix) || defined(__APPLE__) # include # include -#elif defined(WIN32) +#elif defined(_WIN32) # include #endif diff --git a/common/clitkDD.h b/common/clitkDD.h index c21bb81..97ba443 100644 --- a/common/clitkDD.h +++ b/common/clitkDD.h @@ -19,12 +19,12 @@ #define clitkDD_h #include -#ifdef WIN32 +#ifdef _WIN32 # include #endif // David's debug -#ifdef WIN32 +#ifdef _WIN32 # define DD(a) { \ std::ostringstream ossDD; \ ossDD << #a " = [ " << a << " ]" << std::endl; \ diff --git a/common/clitkPortability.h b/common/clitkPortability.h index 7fae01e..3671066 100644 --- a/common/clitkPortability.h +++ b/common/clitkPortability.h @@ -17,12 +17,12 @@ ===========================================================================**/ #ifndef CLITKPORTABILITY_H #define CLITKPORTABILITY_H -#if defined(WIN32) +#if defined(_WIN32) # define _USE_MATH_DEFINES //Before math.h include (i.e. cmath) #endif #include -#if defined(WIN32) +#if defined(_WIN32) # define rint(x) floor(x+0.5) # define lrint(x) (long)rint(x) #endif diff --git a/common/clitkTimer.cxx b/common/clitkTimer.cxx index f01d77c..cd74428 100644 --- a/common/clitkTimer.cxx +++ b/common/clitkTimer.cxx @@ -37,7 +37,7 @@ clitk::Timer::Timer() { Reset(); -#if defined(WIN32) +#if defined(_WIN32) QueryPerformanceFrequency((LARGE_INTEGER*)&mFrequency); #endif } @@ -48,7 +48,7 @@ void clitk::Timer::Start() { #if defined(unix) || defined(__APPLE__) getrusage(RUSAGE_SELF, &mBegin); -#elif defined(WIN32) +#elif defined(_WIN32) QueryPerformanceCounter((LARGE_INTEGER*)&mBegin); #endif mNumberOfCall++; @@ -64,7 +64,7 @@ void clitk::Timer::Stop(bool accumulate) mElapsed += (mEnd.ru_utime.tv_usec - mBegin.ru_utime.tv_usec)+ (mEnd.ru_utime.tv_sec - mBegin.ru_utime.tv_sec)*1000000; } -#elif defined(WIN32) +#elif defined(_WIN32) QueryPerformanceCounter((LARGE_INTEGER*)&mEnd); if (accumulate) { mElapsed += ((mEnd-mBegin)*1000000)/(long double)mFrequency; diff --git a/common/clitkTimer.h b/common/clitkTimer.h index 0021fa7..725a3b2 100644 --- a/common/clitkTimer.h +++ b/common/clitkTimer.h @@ -23,7 +23,7 @@ #if defined(unix) || defined(__APPLE__) # include # include -#elif defined(WIN32) +#elif defined(_WIN32) # include #endif #include @@ -53,7 +53,7 @@ namespace clitk { #if defined(unix) || defined(__APPLE__) rusage mBegin; rusage mEnd; -#elif defined(WIN32) +#elif defined(_WIN32) unsigned __int64 mBegin; unsigned __int64 mEnd; unsigned __int64 mFrequency; -- 2.47.1