This repository has been archived on 2023-08-20. You can view files and clone it, but cannot push or open issues or pull requests.
yap-6.3/os/libtai/tai.h
Vitor Santos Costa 9cfd4d8d8b move package/PLStream to os
modify Makefiles accordingly
define __unix__ on Unix like clones (OSX, AIX, etc).
2011-09-04 19:42:33 +02:00

37 lines
805 B
C

#ifndef TAI_H
#define TAI_H
#ifdef __WINDOWS__
typedef __int64 int64_t;
typedef unsigned __int64 uint64_t;
#else
#include <inttypes.h> /* more portable than stdint.h */
#endif
#if defined(__WINDOWS__) && !defined(__GNUC__)
#define LL(x) x ## i64
#define ULL(x) x ## ui64
#else
#define LL(x) x ## LL
#define ULL(x) x ## ULL
#endif
struct tai {
uint64_t x;
} ;
extern void tai_now(struct tai *t);
/* JW: MSVC cannot convert unsigned to double :-( */
#define tai_approx(t) ((double) ((int64_t)(t)->x))
extern void tai_add(struct tai *t, struct tai *u, struct tai *v);
extern void tai_sub(struct tai *t, struct tai *u, struct tai *v);
#define tai_less(t,u) ((t)->x < (u)->x)
#define TAI_PACK 8
extern void tai_pack(char *s, struct tai *t);
extern void tai_unpack(char *s, struct tai *t);
#endif