mirror of
https://github.com/krgamestudios/Toy.git
synced 2026-04-15 14:54:07 +10:00
Trying to fix time and platforms
This commit is contained in:
@@ -3,30 +3,7 @@
|
||||
#include "memory.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <time.h>
|
||||
#include <sys/time.h>
|
||||
|
||||
/*
|
||||
//using time.h
|
||||
var timer: opaque = startTimer();
|
||||
var diff: opaque = timer.stopTimer();
|
||||
|
||||
...
|
||||
|
||||
var timer = createTimer(seconds, microseconds);
|
||||
print timer.getTimerSeconds();
|
||||
print timer.getTimerMicroseconds();
|
||||
|
||||
...
|
||||
|
||||
var diff: opaque = timer.compareTimers(rhs); //expects another timer
|
||||
|
||||
...
|
||||
|
||||
print timer.timerToString(); //string representation of the timer
|
||||
|
||||
timer.destroyTimer(); //needed to free the memory
|
||||
*/
|
||||
#include "toy_common.h"
|
||||
|
||||
//god damn it
|
||||
static struct timeval* diff(struct timeval* lhs, struct timeval* rhs) {
|
||||
|
||||
@@ -12,8 +12,17 @@
|
||||
//platform exports/imports
|
||||
#if defined(__linux__)
|
||||
#define TOY_API extern
|
||||
#include <time.h>
|
||||
|
||||
#elif defined(_WIN32) || defined(WIN32)
|
||||
#define TOY_API
|
||||
#include <sys/time.h>
|
||||
#include <time.h>
|
||||
|
||||
#else
|
||||
#define TOY_API
|
||||
#include <time.h>
|
||||
|
||||
#endif
|
||||
|
||||
#ifndef TOY_EXPORT
|
||||
|
||||
Reference in New Issue
Block a user