mirror of
https://github.com/dankamongmen/notcurses.git
synced 2024-11-02 09:40:15 +00:00
FreeBSD: no CLOCK_MONOTONIC_RAW #196
This commit is contained in:
parent
caf7e41737
commit
09aa606281
@ -17,7 +17,7 @@ int box_demo(struct notcurses* nc){
|
||||
return -1;
|
||||
}
|
||||
struct timespec start, now;
|
||||
clock_gettime(CLOCK_MONOTONIC_RAW, &start);
|
||||
clock_gettime(CLOCK_MONOTONIC, &start);
|
||||
int zbonus = 40;
|
||||
int zbonusdelta = 20;
|
||||
int ylen, xlen;
|
||||
@ -86,7 +86,7 @@ int box_demo(struct notcurses* nc){
|
||||
return -1;
|
||||
}
|
||||
nanosleep(&iterdelay, NULL);
|
||||
clock_gettime(CLOCK_MONOTONIC_RAW, &now);
|
||||
clock_gettime(CLOCK_MONOTONIC, &now);
|
||||
if((zbonus += zbonusdelta > 255) || zbonus < 0){
|
||||
zbonusdelta = -zbonusdelta;
|
||||
zbonus += zbonusdelta;
|
||||
|
@ -2,6 +2,7 @@
|
||||
#define NOTCURSES_INTERNAL
|
||||
|
||||
#include <term.h>
|
||||
#include <time.h>
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include <stdarg.h>
|
||||
@ -263,6 +264,11 @@ cell* ncplane_cell_ref_yx(ncplane* n, int y, int x);
|
||||
|
||||
#define NANOSECS_IN_SEC 1000000000
|
||||
|
||||
// no CLOCK_MONOTONIC_RAW on FreeBSD as of 12.0 :/
|
||||
#ifndef CLOCK_MONOTONIC_RAW
|
||||
#define CLOCK_MONOTONIC_RAW CLOCK_MONOTONIC
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user