]> git.mdlowis.com Git - projs/tide.git/commitdiff
fix getmillis on linux
authorMike Lowis <mike.lowis@gentex.com>
Mon, 10 Oct 2016 12:41:27 +0000 (08:41 -0400)
committerMike Lowis <mike.lowis@gentex.com>
Mon, 10 Oct 2016 12:41:27 +0000 (08:41 -0400)
Makefile
mouse.c

index 14e70f10e16531c912657acdf12e3642ce936c4a..e3be92e8a99ab9aaf7f5c5eef1aa2ca33821f5ce 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,5 +1,5 @@
 LDFLAGS  = -L/opt/X11/lib -lX11 -lXft
-CFLAGS   = --std=c99 -Wall -Wextra -I. -I/opt/X11/include -I/opt/local/include/freetype2 -I/usr/include/freetype2
+CFLAGS   = --std=gnu99 -Wall -Wextra -I. -I/opt/X11/include -I/opt/local/include/freetype2 -I/usr/include/freetype2
 OBJS     = buf.o screen.o utf8.o keyboard.o mouse.o charset.o
 TESTOBJS = tests/tests.o tests/buf.o tests/utf8.o
 
diff --git a/mouse.c b/mouse.c
index e97a2e13a4040df2f678b1acb91b860ec8eb67d1..c848f6f44b429121d2f1eea924466e24e996ae03 100644 (file)
--- a/mouse.c
+++ b/mouse.c
@@ -1,9 +1,10 @@
 #include "edit.h"
 
-#ifndef __MACH__
+#define _GNU_SOURCE
 #include <time.h>
-#else
 #include <sys/time.h>
+
+#ifdef __MACH__
 #define CLOCK_MONOTONIC 0
 // clock_gettime is not implemented on OSX
 int clock_gettime(int id, struct timespec* t) {