Go to the documentation of this file. 1 #ifndef __DEFINITIONS_H__ 2 #define __DEFINITIONS_H__ 6 #define WIIMOTE_PI 3.14159265f 11 #define WIIUSE_ERROR(fmt, ...) fprintf(stderr, "[ERROR] " fmt "\n", ##__VA_ARGS__) 14 #define WIIUSE_WARNING(fmt, ...) fprintf(stderr, "[WARNING] " fmt "\n", ##__VA_ARGS__) 17 #define WIIUSE_INFO(fmt, ...) fprintf(stderr, "[INFO] " fmt "\n", ##__VA_ARGS__) 19 #ifdef WITH_WIIUSE_DEBUG 21 #define WIIUSE_DEBUG(fmt, ...) do { \ 22 char* file = __FILE__; \ 23 int i = strlen(file) - 1; \ 24 for (; i && (file[i] != '\\'); --i); \ 25 fprintf(stderr, "[DEBUG] %s:%i: " fmt "\n", file+i+1, __LINE__, ##__VA_ARGS__); \ 28 #define WIIUSE_DEBUG(fmt, ...) fprintf(stderr, "[DEBUG] " __FILE__ ":%i: " fmt "\n", __LINE__, ##__VA_ARGS__) 31 #define WIIUSE_DEBUG(fmt, ...) 35 #define WII_DEBUG(fmt, ...) do { \ 36 printf("[WDEBUG] " __FILE__ ":%i: " fmt "\n", __LINE__, ##__VA_ARGS__); \ 40 #define WII_DEBUG(fmt, ...) 45 #define RAD_TO_DEGREE(r) ((r * 180.0f) / WIIMOTE_PI) 46 #define DEGREE_TO_RAD(d) (d * (WIIMOTE_PI / 180.0f)) 49 #define BIG_ENDIAN_LONG(i) (htonl(i)) 50 #define BIG_ENDIAN_SHORT(i) (htons(i)) 52 #define absf(x) ((x >= 0) ? (x) : (x * -1.0f)) 53 #define diff_f(x, y) ((x >= y) ? (absf(x - y)) : (absf(y - x)))