title: Platform specific code
body: <p>Hope to get some pointers here.  I am trying to get QT to compile with slightly different code for each platform. For example,</p>
  
  <p>If platform is Windows then include windows.h<br>
  If platform is OSX then include time.h</p>
  
  <p>AND</p>
  
  <p>If platform is Windows use  QueryPerformanceCounter function from windows.h
  If platform is Linux use  gettimeofdayfunction from time.h</p>
  
  <p>The objective here is to write wrapper function to return elapsed microseconds that works with Windows (QueryPerformanceCounter) &amp; Linux/Max (gettimeofday) without having 2 sets of code.  Qtimer resolution is inadequate in Windows XP. (about 10-15ms increments). </p>
  
  <p>Anyone can point me to a tutorial on how to do this ? Thank you in advance and Happy New Year to everyone here. </p>
  
  <p>Gary Cho</p>