commit: 674e04c237a4fab11eb4a8772aafd91cb860c454
parent: 9727c7ea9d4793d721b0fc1a473dd739df16cb3b
author: Brian Callahan <dodonpachi-github@mailinator.com>
date: Sun, 24 Sep 2017 11:07:25 -0400
Maybe fix Mac OS X (blind).
Add Travis-CI.
2 files changed, 21 insertions(+)
diff --git a/.travis.yml b/.travis.yml
@@ -0,0 +1,9 @@
+language: c
+os:
+ - linux
+ - osx
+compiler:
+ - clang
+ - gcc
+script: make
+osx_image: xcode6.4
diff --git a/portable/darwin/darwin.h b/portable/darwin/darwin.h
@@ -4,6 +4,8 @@
/* Includes */
#include <sys/param.h>
+#include <mach/clock.h>
+#include <mach/mach.h>
/* Defines */
#define _PW_NAME_LEN MAXLOGNAME - 1
@@ -13,6 +15,16 @@
#define setresgid(x, y, z) setgid(x); setegid(y); setgid(z)
#define setresuid(x, y, z) setuid(x); seteuid(y); setuid(z)
+/* Convert clock_gettime() to clock_get_time() */
+#define clock_gettime(x, y) \
+ 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); \
+ (*y)->tv_sec = mts.tv_sec; \
+ (*y)->tv_nsec = mts.tv_nsec;
+
/* From OpenBSD sys/time.h */
#define timespeccmp(tsp, usp, cmp) \
(((tsp)->tv_sec == (usp)->tv_sec) ? \