Skip to content
Snippets Groups Projects
Select Git revision
  • b63cf3bbdb0cd48b3e2846852204031034faa596
  • master default
  • labcomm2014
  • labcomm2006
  • python_sig_hash
  • typedefs
  • anders.blomdell
  • typeref
  • pragma
  • compiler-refactoring
  • labcomm2013
  • v2014.6
  • v2015.0
  • v2014.5
  • v2014.4
  • v2006.0
  • v2014.3
  • v2014.2
  • v2014.1
  • v2014.0
  • v2013.0
21 results

FlatSignature.jrag

Blame
  • labcomm2014_compat_osx.h 601 B
    #ifndef __APPLE__
    #error "__APPLE__" not defined
    #endif
    
    #ifndef LABCOMM_COMPAT_OSX
    #define LABCOMM_COMPAT_OSX
    
    #include <machine/endian.h>
    #include <stdio.h>
    #include <time.h>
    
    #include <mach/clock.h>
    #include <mach/mach.h>
    
    #define CLOCK_REALTIME 0
    static inline void clock_gettime(int garbage, struct timespec *ts)
    {
      (void) garbage;
      clock_serv_t cclock;
      mach_timespec_t mts;
      host_get_clock_service(mach_host_self(), CALENDAR_CLOCK, &cclock);
      clock_get_time(cclock, &mts);
      mach_port_deallocate(mach_task_self(), cclock);
      ts->tv_sec = mts.tv_sec;
      ts->tv_nsec = mts.tv_nsec;
    }
    
    #endif