Skip to content

Commit

Permalink
7809301: fix #535, compile error when including mach_time.h
Browse files Browse the repository at this point in the history
  • Loading branch information
jofre-ms committed Jun 24, 2016
1 parent b73a70c commit 5c196a2
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
7 changes: 7 additions & 0 deletions Frameworks/Starboard/mach.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,4 +79,11 @@ kern_return_t mach_timebase_info(mach_timebase_info_t tinfo) {
return 0;
}

uint64_t mach_absolute_time() {
LARGE_INTEGER count;
QueryPerformanceCounter(&count);
// mach_absolute_time is unsigned, but this function returns a signed value.
return (uint64_t)count.QuadPart;
}

}
1 change: 1 addition & 0 deletions build/Starboard/dll/Starboard.def
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ LIBRARY Starboard
arc4random
arc4random_uniform
mach_timebase_info
mach_absolute_time
sysctlbyname

EbrIncrement
Expand Down
7 changes: 1 addition & 6 deletions include/WOCStdLib/mach/mach_time.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,7 @@ typedef struct mach_timebase_info* mach_timebase_info_t;
__BEGIN_DECLS

kern_return_t mach_timebase_info(mach_timebase_info_t tinfo);
__inline uint64_t mach_absolute_time() {
LARGE_INTEGER count;
QueryPerformanceCounter(&count);
// mach_absolute_time is unsigned, but this function returns a signed value.
return (uint64_t)count.QuadPart;
}
uint64_t mach_absolute_time();

__END_DECLS

Expand Down

0 comments on commit 5c196a2

Please sign in to comment.