Skip to content
Snippets Groups Projects
Commit b453d2f5 authored by Ludovic Apvrille's avatar Ludovic Apvrille
Browse files

AVATAR code generator: upgrade to be supported under MACOS

parent 7b278bc0
No related branches found
No related tags found
No related merge requests found
......@@ -8,6 +8,9 @@ OPT = -O1 -pthread
#LOPT = -O1 -pthread -ldl -lnsl -lsocket
#Linux
LOPT = -O1 -pthread -ldl -lrt
LOPT_MAC = -O1 -pthread -ldl
LOPT = $(LOPT_MAC)
DEBUG = -g
OTHER = -Wall
......
SRCS = generated_src/main.c generated_src/Wallet.c generated_src/CoffeeMachine.c generated_src/TeaButton.c generated_src/CoffeeButton.c
\ No newline at end of file
SRCS = generated_src/main.c generated_src/Wallet.c generated_src/CoffeeMachine.c generated_src/CoffeeButton.c generated_src/TeaButton.c
\ No newline at end of file
......@@ -2,6 +2,20 @@
#define MYTIMELIB_H
#include <time.h>
#include <sys/time.h>
#ifndef CLOCK_REALTIME
#define CLOCK_REALTIME 0
void clock_gettime(int x, struct timespec *ts) {
struct timeval tv;
gettimeofday(&tv, NULL);
ts->tv_sec = tv.tv_sec;
ts->tv_nsec = tv.tv_usec * 1000;
}
#endif
// in usec
void addTime(struct timespec *src1, struct timespec *src2, struct timespec *dest);
......
......@@ -8,6 +8,8 @@
#include "debug.h"
#include <math.h>
#include "mytimelib.h"
int computeRandom(int min, int max) {
if (min == max) {
return min;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment