2
0

b3PlatformDefinitions.h 742 B

12345678910111213141516171819202122232425262728293031323334353637
  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. #else
  20. //keep B3_LARGE_FLOAT*B3_LARGE_FLOAT < FLT_MAX
  21. #define B3_LARGE_FLOAT 1e18f
  22. #define B3_INFINITY 1e18f
  23. #define b3Assert(a)
  24. #define b3ConstArray(a) __global const a*
  25. #define b3AtomicInc atomic_inc
  26. #define b3AtomicAdd atomic_add
  27. #define b3Fabs fabs
  28. #define b3Sqrt native_sqrt
  29. #define b3Sin native_sin
  30. #define b3Cos native_cos
  31. #endif
  32. #endif