AGX Dynamics 2.41.3.0
Loading...
Searching...
No Matches
macros.h
Go to the documentation of this file.
1/*
2Copyright 2007-2025. Algoryx Simulation AB.
3
4All AGX source code, intellectual property, documentation, sample code,
5tutorials, scene files and technical white papers, are copyrighted, proprietary
6and confidential material of Algoryx Simulation AB. You may not download, read,
7store, distribute, publish, copy or otherwise disseminate, use or expose this
8material unless having a written signed agreement with Algoryx Simulation AB, or having been
9advised so by Algoryx Simulation AB for a time limited evaluation, or having purchased a
10valid commercial license from Algoryx Simulation AB.
11
12Algoryx Simulation AB disclaims all responsibilities for loss or damage caused
13from using this software, unless otherwise stated in written agreements with
14Algoryx Simulation AB.
15*/
16
17#ifndef AGX_MACROS_H
18#define AGX_MACROS_H
19
20#include <agx/config.h>
21#include <hedley/hedley.h>
22
23#define AGX_STATIC_ASSERT(X) static_assert(X, #X)
24
25#if !defined(AGX_DEBUG) && !defined(NDEBUG)
26#define AGX_DEBUG
27#endif
28
29#define AGX_STRINGIFY(A) #A
30#define AGX_TOSTRING(x) AGX_STRINGIFY(x)
31
38#define _AGX_CONCAT(x,y) x ## y
39#define AGX_CONCAT(x,y) _AGX_CONCAT(x,y)
40
41
42#ifdef _MSC_VER
43# define AGX_NOEXCEPT
44#else
45
46#define AGX_NOEXCEPT noexcept
47
48#endif
49
50// Index set iterator for kernels.
51#define AGX_ITERATE_INDEX_SET(set, i) typename SetT::iterator _agx_set_iterator = set.begin(), _agx_set_end = set.end(); for (typename SetT::Type i; (_agx_set_iterator != _agx_set_end) && ((i = *_agx_set_iterator), true); ++_agx_set_iterator)
52
53#if defined(_MSC_VER)
54# define AGX_FORCE_INLINE __forceinline
55#elif defined(__GNUC__) && !defined(AGX_DEBUG)
56# define AGX_FORCE_INLINE inline __attribute__((always_inline))
57#else
58# define AGX_FORCE_INLINE inline
59#endif
60
61#ifdef _MSC_VER
62#define AGX_ALIGNED( t, a ) __declspec( align( a ) ) t
63#else
64#define AGX_ALIGNED( t, a ) t __attribute__ ((aligned (a)))
65#endif
66
67#ifdef CALLABLE_GENERATOR
68#define CALLABLE __attribute__((annotate("CALLABLE")))
69#define CALLABLE_UNIT(param) __attribute__((annotate("CALLABLE_UNIT " param)))
70#define CALLABLE_IGNORE __attribute__((annotate("CALLABLE_IGNORE")))
71#else
72#define CALLABLE
73#define CALLABLE_UNIT(param)
74#define CALLABLE_IGNORE
75#endif
76
77#ifdef SWIG
78 #define AGX_DEPRECATED(since)
79 #define AGX_DEPRECATED_FOR(since, replacement)
80#else
81 #define AGX_DEPRECATED(since) HEDLEY_DEPRECATED(since)
82 #define AGX_DEPRECATED_FOR(since, replacement) HEDLEY_DEPRECATED_FOR(since, replacement)
83#endif
84
85
86//
87#ifdef AGX_HIDE_INTERNAL_DOCUMENTATION
88 #define DOXYGEN_START_INTERNAL_BLOCK()
89 #define DOXYGEN_END_INTERNAL_BLOCK()
90#else
91 #define DOXYGEN_START_INTERNAL_BLOCK()
92 #define DOXYGEN_END_INTERNAL_BLOCK()
93#endif
94
95
96#endif