Files
tp/include/global.h
T

55 lines
1.2 KiB
C
Raw Normal View History

#ifndef _global_h_
#define _global_h_
2020-11-30 14:26:55 -08:00
#define ARRAY_SIZE(o) (sizeof((o)) / sizeof(*(o)))
2021-01-03 11:29:50 +01:00
// Align X to the previous N bytes (N must be power of two)
#define ALIGN_PREV(X, N) ((X) & ~((N)-1))
// Align X to the next N bytes (N must be power of two)
#define ALIGN_NEXT(X, N) ALIGN_PREV(((X) + (N)-1), N)
2021-01-10 02:15:52 +01:00
#define IS_ALIGNED(X, N) (((X) & ((N)-1)) == 0)
#define IS_NOT_ALIGNED(X, N) (((X) & ((N)-1)) != 0)
2021-01-03 11:29:50 +01:00
2021-01-04 03:26:25 +01:00
#define JUT_ASSERT(...)
2021-01-18 11:27:25 -08:00
#define JUT_EXPECT(...)
2021-01-05 17:34:58 +01:00
#define ASSERT(...)
2021-01-07 02:33:03 +01:00
#define LOGF(FMT, ...)
2021-01-10 02:15:52 +01:00
#define FLAG_ON(V, F) (((V) & (F)) == 0)
2021-01-04 03:26:25 +01:00
2021-01-18 11:27:25 -08:00
struct JUTWarn {
JUTWarn& operator<<(const char*) { return *this; }
JUTWarn& operator<<(long) { return *this; }
};
2021-01-07 02:04:53 +01:00
extern float __fabsf(float);
2021-01-26 23:48:47 +01:00
inline double fabsd(float f) {
return __fabsf(f);
}
inline float fabsf(float f) {
return (float)fabsd(f);
2021-01-07 02:04:53 +01:00
}
// extern float __frsqrte(float);
2021-01-07 02:04:53 +01:00
2021-01-26 23:48:47 +01:00
inline double sqrt(float f) {
return __frsqrte(f);
2021-01-07 02:04:53 +01:00
}
#include "dolphin/types.h"
2021-01-03 11:29:50 +01:00
2021-01-10 02:15:52 +01:00
#include "ar/AR.h"
2021-01-03 11:29:50 +01:00
#include "ar/ARQ.h"
2021-01-03 05:15:12 +01:00
#include "mwcc.h"
2020-12-26 11:31:49 -05:00
#include "os/OS.h"
#include "variables.h"
2020-12-31 21:12:29 +01:00
// hack to make functions that return comparisons as int match
extern int __cntlzw(unsigned int);
inline BOOL checkEqual(s32 a, s32 b) {
return (u32)__cntlzw(a - b) >> 5;
}
#endif