Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
D
diy2
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Service Desk
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Spiros Tsalikis
diy2
Commits
bb0d55c8
Commit
bb0d55c8
authored
4 years ago
by
Samuel Thibault
Browse files
Options
Downloads
Patches
Plain Diff
Fix build on mach-based OS which are not OS X
parent
066fecd1
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
include/diy/time.hpp
+3
-3
3 additions, 3 deletions
include/diy/time.hpp
with
3 additions
and
3 deletions
include/diy/time.hpp
+
3
−
3
View file @
bb0d55c8
...
@@ -3,10 +3,10 @@
...
@@ -3,10 +3,10 @@
#ifndef _WIN32
#ifndef _WIN32
#include
<sys/time.h>
#include
<sys/time.h>
#ifdef
__MACH__
#if
def
ined(
__MACH__
) && defined(__APPLE__)
#include
<mach/clock.h>
#include
<mach/clock.h>
#include
<mach/mach.h>
#include
<mach/mach.h>
#endif // __MACH__
#endif // __MACH__
&& __APPLE__
#endif // ifndef _WIN32
#endif // ifndef _WIN32
namespace
diy
namespace
diy
...
@@ -16,7 +16,7 @@ typedef unsigned long time_type;
...
@@ -16,7 +16,7 @@ typedef unsigned long time_type;
inline
time_type
get_time
()
inline
time_type
get_time
()
{
{
#ifdef
__MACH__ // OS X does not have clock_gettime, use clock_get_time
#if
def
ined(
__MACH__
) && defined(__APPLE__)
// OS X does not have clock_gettime, use clock_get_time
clock_serv_t
cclock
;
clock_serv_t
cclock
;
mach_timespec_t
ts
;
mach_timespec_t
ts
;
host_get_clock_service
(
mach_host_self
(),
CALENDAR_CLOCK
,
&
cclock
);
host_get_clock_service
(
mach_host_self
(),
CALENDAR_CLOCK
,
&
cclock
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment