libllvm: Fix building under ubuntu 18.04
[termux-packages] / packages / brogue / curses-platform.c.patch
CommitLineData
59f0d218
FF
1In Android the <sys/timeb.h> header and associated ftime(3) has been
2removed in android-21 since it is deprecated and removed from POSIX.
3
4diff -u -r ../brogue-1.7.4/src/platform/curses-platform.c ./src/platform/curses-platform.c
5--- ../brogue-1.7.4/src/platform/curses-platform.c 2014-07-03 15:19:10.000000000 -0400
6+++ ./src/platform/curses-platform.c 2014-12-20 03:47:20.303572495 -0500
7@@ -3,7 +3,7 @@
8 #include <string.h>
9 #include <time.h>
10 #include "term.h"
11-#include <sys/timeb.h>
12+#include <sys/time.h>
13 #include <stdint.h>
14 #include <signal.h>
15 #include "platform.h"
16@@ -109,9 +109,9 @@
17 #define PAUSE_BETWEEN_EVENT_POLLING 34//17
18
19 static uint32_t getTime() {
20- struct timeb time;
21- ftime(&time);
22- return 1000 * time.time + time.millitm;
23+ struct timeval tv;
24+ gettimeofday(&tv, NULL);
25+ return 1000 * tv.tv_sec + tv.tv_usec / 1000;
26 }
27
28 static boolean curses_pauseForMilliseconds(short milliseconds) {