26 #define SHARE_UTILITIES_GLOBALDEFINITIONS_HPP
27
28 #include "utilities/compilerWarnings.hpp"
29 #include "utilities/debug.hpp"
30 #include "utilities/macros.hpp"
31
32 #include COMPILER_HEADER(utilities/globalDefinitions)
33
34 // Defaults for macros that might be defined per compiler.
35 #ifndef NOINLINE
36 #define NOINLINE
37 #endif
38 #ifndef ALWAYSINLINE
39 #define ALWAYSINLINE inline
40 #endif
41
42 #ifndef ATTRIBUTE_ALIGNED
43 #define ATTRIBUTE_ALIGNED(x)
44 #endif
45
46 // This file holds all globally used constants & types, class (forward)
47 // declarations and a few frequently used utility functions.
48
49 //----------------------------------------------------------------------------------------------------
50 // Printf-style formatters for fixed- and variable-width types as pointers and
51 // integers. These are derived from the definitions in inttypes.h. If the platform
52 // doesn't provide appropriate definitions, they should be provided in
53 // the compiler-specific definitions file (e.g., globalDefinitions_gcc.hpp)
54
55 #define BOOL_TO_STR(_b_) ((_b_) ? "true" : "false")
56
57 // Format 32-bit quantities.
58 #define INT32_FORMAT "%" PRId32
59 #define UINT32_FORMAT "%" PRIu32
60 #define INT32_FORMAT_W(width) "%" #width PRId32
61 #define UINT32_FORMAT_W(width) "%" #width PRIu32
62
63 #define PTR32_FORMAT "0x%08" PRIx32
64 #define PTR32_FORMAT_W(width) "0x%" #width PRIx32
65
|
26 #define SHARE_UTILITIES_GLOBALDEFINITIONS_HPP
27
28 #include "utilities/compilerWarnings.hpp"
29 #include "utilities/debug.hpp"
30 #include "utilities/macros.hpp"
31
32 #include COMPILER_HEADER(utilities/globalDefinitions)
33
34 // Defaults for macros that might be defined per compiler.
35 #ifndef NOINLINE
36 #define NOINLINE
37 #endif
38 #ifndef ALWAYSINLINE
39 #define ALWAYSINLINE inline
40 #endif
41
42 #ifndef ATTRIBUTE_ALIGNED
43 #define ATTRIBUTE_ALIGNED(x)
44 #endif
45
46 // These are #defines to selectively turn on/off the Print(Opto)Assembly
47 // capabilities. Choices should be led by a tradeoff between
48 // code size and improved supportability.
49 // if PRINT_ASSEMBLY then PRINT_ABSTRACT_ASSEMBLY must be true as well
50 // to have a fallback in case hsdis is not available.
51 #if defined(PRODUCT)
52 #define SUPPORT_ABSTRACT_ASSEMBLY
53 #define SUPPORT_ASSEMBLY
54 #undef SUPPORT_OPTO_ASSEMBLY // Can't activate. In PRODUCT, many dump methods are missing.
55 #undef SUPPORT_DATA_STRUCTS // Of limited use. In PRODUCT, many print methods are empty.
56 #else
57 #define SUPPORT_ABSTRACT_ASSEMBLY
58 #define SUPPORT_ASSEMBLY
59 #define SUPPORT_OPTO_ASSEMBLY
60 #define SUPPORT_DATA_STRUCTS
61 #endif
62 #if defined(SUPPORT_ASSEMBLY) && !defined(SUPPORT_ABSTRACT_ASSEMBLY)
63 #define SUPPORT_ABSTRACT_ASSEMBLY
64 #endif
65
66 // This file holds all globally used constants & types, class (forward)
67 // declarations and a few frequently used utility functions.
68
69 //----------------------------------------------------------------------------------------------------
70 // Printf-style formatters for fixed- and variable-width types as pointers and
71 // integers. These are derived from the definitions in inttypes.h. If the platform
72 // doesn't provide appropriate definitions, they should be provided in
73 // the compiler-specific definitions file (e.g., globalDefinitions_gcc.hpp)
74
75 #define BOOL_TO_STR(_b_) ((_b_) ? "true" : "false")
76
77 // Format 32-bit quantities.
78 #define INT32_FORMAT "%" PRId32
79 #define UINT32_FORMAT "%" PRIu32
80 #define INT32_FORMAT_W(width) "%" #width PRId32
81 #define UINT32_FORMAT_W(width) "%" #width PRIu32
82
83 #define PTR32_FORMAT "0x%08" PRIx32
84 #define PTR32_FORMAT_W(width) "0x%" #width PRIx32
85
|