X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=server%2Fcommon.h;h=00925984f7b19c7243289baacf29ebf7c0b081e9;hb=25ecb8cc15ad229de75d7bda20d7d36003544b77;hp=9b73de9032a4c3e73a94854558f510847e604b7d;hpb=ed21599957130173a661904f22e50af59a96a6ac;p=matches%2FMCTX3420.git diff --git a/server/common.h b/server/common.h index 9b73de9..0092598 100644 --- a/server/common.h +++ b/server/common.h @@ -1,6 +1,6 @@ /** * @file common.h - * @purpose Common header includes + * @brief Common header includes */ #ifndef _COMMON_H @@ -8,6 +8,15 @@ #define _POSIX_C_SOURCE 200809L #define _BSD_SOURCE +#define _XOPEN_SOURCE 600 + +/** Determine if we're running on the BBB **/ +#ifdef __arm__ +#define _BBB +#endif + +/** The current API version **/ +#define API_VERSION 0 #include #include @@ -18,9 +27,18 @@ #include #include #include +#include #include "log.h" #include "fastcgi.h" -#include "thread.h" +#include "control.h" + +/**Converts a timeval to a double**/ +#define TIMEVAL_TO_DOUBLE(tv) ((tv).tv_sec + 1e-6 * ((tv).tv_usec)) +/**Takes the tv1-tv2 between two timevals and returns the result as a double*/ +#define TIMEVAL_DIFF(tv1, tv2) ((tv1).tv_sec - (tv2).tv_sec + 1e-6 * ((tv1).tv_usec - (tv2).tv_usec)) + + + #endif //_COMMON_H