Create Cover-Rowan
[matches/MCTX3420.git] / server / common.h
1 /**
2  * @file common.h
3  * @brief Common header includes
4  */
5
6 #ifndef _COMMON_H
7 #define _COMMON_H
8
9 #define _POSIX_C_SOURCE 200809L
10 #define _BSD_SOURCE
11 #define _XOPEN_SOURCE 600
12
13 /** Determine if we're running on the BBB **/
14 #ifdef __arm__
15 #define _BBB
16 #endif
17
18 /** The current API version **/
19 #define API_VERSION 0
20
21 #include <stdlib.h>
22 #include <stdio.h>
23 #include <stdbool.h>
24 #include <string.h>
25 #include <errno.h>
26 #include <pthread.h>
27 #include <unistd.h>
28 #include <assert.h>
29 #include <sys/time.h>
30 #include <time.h>
31
32 #include "log.h"
33 #include "fastcgi.h"
34 #include "control.h"
35
36 /**Converts a timeval to a double**/
37 #define TIMEVAL_TO_DOUBLE(tv) ((tv).tv_sec + 1e-6 * ((tv).tv_usec))
38 /**Takes the tv1-tv2 between two timevals and returns the result as a double*/
39 #define TIMEVAL_DIFF(tv1, tv2) ((tv1).tv_sec - (tv2).tv_sec + 1e-6 * ((tv1).tv_usec - (tv2).tv_usec))
40
41
42
43
44 #endif //_COMMON_H

UCC git Repository :: git.ucc.asn.au