2
0

b3PlatformDefinitions.h 789 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. #ifndef B3_PLATFORM_DEFINITIONS_H
  2. #define B3_PLATFORM_DEFINITIONS_H
  3. struct MyTest
  4. {
  5. int bla;
  6. };
  7. #ifdef __cplusplus
  8. //#define b3ConstArray(a) const b3AlignedObjectArray<a>&
  9. #define b3ConstArray(a) const a *
  10. #define b3AtomicInc(a) ((*a)++)
  11. inline int b3AtomicAdd(volatile int *p, int val)
  12. {
  13. int oldValue = *p;
  14. int newValue = oldValue + val;
  15. *p = newValue;
  16. return oldValue;
  17. }
  18. #define __global
  19. #define B3_STATIC static
  20. #else
  21. //keep B3_LARGE_FLOAT*B3_LARGE_FLOAT < FLT_MAX
  22. #define B3_LARGE_FLOAT 1e18f
  23. #define B3_INFINITY 1e18f
  24. #define b3Assert(a)
  25. #define b3ConstArray(a) __global const a *
  26. #define b3AtomicInc atomic_inc
  27. #define b3AtomicAdd atomic_add
  28. #define b3Fabs fabs
  29. #define b3Sqrt native_sqrt
  30. #define b3Sin native_sin
  31. #define b3Cos native_cos
  32. #define B3_STATIC
  33. #endif
  34. #endif