]> Creatis software - clitk.git/commitdiff
_WIN32 is always defined and WIN32 maybe isn't, see
authorSimon Rit <simon.rit@creatis.insa-lyon.fr>
Tue, 24 Jul 2012 09:25:51 +0000 (11:25 +0200)
committerSimon Rit <simon.rit@creatis.insa-lyon.fr>
Tue, 24 Jul 2012 09:25:51 +0000 (11:25 +0200)
http://msdn.microsoft.com/en-us/library/b0084kay%28v=vs.80%29.aspx

common/clitkCommon.h
common/clitkDD.h
common/clitkPortability.h
common/clitkTimer.cxx
common/clitkTimer.h

index 769ca63f0bf4400cbb783cf53d3bd7b44b3fc293..9eb36522004c172b9cfa6d8bb209f45821cb02f5 100644 (file)
@@ -38,7 +38,7 @@
 #if defined(unix) || defined(__APPLE__)
 #  include <sys/time.h>
 #  include <sys/resource.h>
-#elif defined(WIN32)
+#elif defined(_WIN32)
 #  include <windows.h>
 #endif
 
index c21bb815acbc080e97f3adfd9b844c934209292e..97ba4437b07e5f5207faf55bfee180ac63f1cd2b 100644 (file)
 #define clitkDD_h
 
 #include <iostream>
-#ifdef WIN32
+#ifdef _WIN32
 # include <windows.h>
 #endif
 // David's debug
 
-#ifdef WIN32
+#ifdef _WIN32
 # define DD(a) { \
     std::ostringstream ossDD; \
     ossDD << #a " = [ " << a << " ]" << std::endl; \
index 7fae01ec9916e31e303465a95685e7fa46d9b0db..3671066fce427e26fb789cb3311865b8c1e32287 100644 (file)
 ===========================================================================**/
 #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 <cmath>
 
-#if defined(WIN32)
+#if defined(_WIN32)
 #  define rint(x)  floor(x+0.5)
 #  define lrint(x) (long)rint(x) 
 #endif
index f01d77c1426d9ca45d35f4fdf0ca790832f5ef29..cd74428832f4505df7edd11028b359030ab064c5 100644 (file)
@@ -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;
index 0021fa75afc9b812e7e31c59fe92afb0e84f3c91..725a3b2bd506dbce7b2c7e1bfbb8de70e99da37f 100644 (file)
@@ -23,7 +23,7 @@
 #if defined(unix) || defined(__APPLE__)
 #  include <sys/time.h>
 #  include <sys/resource.h>
-#elif defined(WIN32)
+#elif defined(_WIN32)
 #  include <windows.h>
 #endif
 #include <iostream>
@@ -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;