2017-08-01 14:30:58 +02:00
|
|
|
#ifndef B3_PLATFORM_DEFINITIONS_H
|
|
|
|
#define B3_PLATFORM_DEFINITIONS_H
|
|
|
|
|
|
|
|
struct MyTest
|
|
|
|
{
|
|
|
|
int bla;
|
|
|
|
};
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
//#define b3ConstArray(a) const b3AlignedObjectArray<a>&
|
2019-01-03 14:26:51 +01:00
|
|
|
#define b3ConstArray(a) const a *
|
2017-08-01 14:30:58 +02:00
|
|
|
#define b3AtomicInc(a) ((*a)++)
|
|
|
|
|
2019-01-03 14:26:51 +01:00
|
|
|
inline int b3AtomicAdd(volatile int *p, int val)
|
2017-08-01 14:30:58 +02:00
|
|
|
{
|
|
|
|
int oldValue = *p;
|
2019-01-03 14:26:51 +01:00
|
|
|
int newValue = oldValue + val;
|
2017-08-01 14:30:58 +02:00
|
|
|
*p = newValue;
|
|
|
|
return oldValue;
|
|
|
|
}
|
|
|
|
|
2019-01-03 14:26:51 +01:00
|
|
|
#define __global
|
2017-08-01 14:30:58 +02:00
|
|
|
|
|
|
|
#define B3_STATIC static
|
|
|
|
#else
|
|
|
|
//keep B3_LARGE_FLOAT*B3_LARGE_FLOAT < FLT_MAX
|
|
|
|
#define B3_LARGE_FLOAT 1e18f
|
|
|
|
#define B3_INFINITY 1e18f
|
|
|
|
#define b3Assert(a)
|
2019-01-03 14:26:51 +01:00
|
|
|
#define b3ConstArray(a) __global const a *
|
2017-08-01 14:30:58 +02:00
|
|
|
#define b3AtomicInc atomic_inc
|
|
|
|
#define b3AtomicAdd atomic_add
|
|
|
|
#define b3Fabs fabs
|
|
|
|
#define b3Sqrt native_sqrt
|
|
|
|
#define b3Sin native_sin
|
|
|
|
#define b3Cos native_cos
|
|
|
|
|
|
|
|
#define B3_STATIC
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif
|