33
33
*
34
34
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
35
35
36
+ /* * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
37
+ * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
38
+ * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
39
+ * =======================> MAC OS WARNING <================================
40
+ * Xcode 16 has changes specific to Apple systems where using a static const std::string variable
41
+ * inside of an inline function in this header will lead to executable crashes
42
+ * in Debug (but not release). This is why the use of StringLiteral was introduced.
43
+ *
44
+ * EbsdStringLiteral are stack allocated instead of heap allocated. Which is Good.
45
+ *
46
+ * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
47
+ * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
48
+ * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
49
+ */
36
50
#pragma once
37
51
52
+ #include " EbsdLib/Core/EbsdStringLiteral.hpp"
53
+ #include " EbsdLib/EbsdLib.h"
54
+
38
55
#include < cstdint>
39
56
#include < string>
40
57
@@ -47,7 +64,7 @@ namespace EbsdLib
47
64
48
65
using Rgb = uint32_t ;
49
66
inline constexpr Rgb RGB_MASK = 0x00ffffff ; // masks RGB values
50
- inline const std::string PathSep (" |" );
67
+ EbsdLib_macOS_NO_EXPORT inline constexpr EbsdStringLiteral PathSep (" |" );
51
68
inline constexpr uint8_t Unchecked = 0 ;
52
69
inline constexpr uint8_t PartiallyChecked = 1 ;
53
70
inline constexpr uint8_t Checked = 2 ;
@@ -64,10 +81,10 @@ enum InfoStringFormat
64
81
65
82
namespace StringConstants
66
83
{
67
- inline const std::string Statistics (" Statistics" );
68
- inline const std::string StatsData (" StatsData" );
69
- inline const std::string StatsType (" StatsType" );
70
- inline const std::string GBCD (" GBCD" );
84
+ EbsdLib_macOS_NO_EXPORT inline constexpr EbsdStringLiteral Statistics (" Statistics" );
85
+ EbsdLib_macOS_NO_EXPORT inline constexpr EbsdStringLiteral StatsData (" StatsData" );
86
+ EbsdLib_macOS_NO_EXPORT inline constexpr EbsdStringLiteral StatsType (" StatsType" );
87
+ EbsdLib_macOS_NO_EXPORT inline constexpr EbsdStringLiteral GBCD (" GBCD" );
71
88
} // namespace StringConstants
72
89
73
90
namespace NumericTypes
@@ -102,35 +119,35 @@ inline constexpr uint32_t UnknownRefFrameZDirection = 2;
102
119
103
120
namespace H5Ebsd
104
121
{
105
- inline const std::string Manufacturer (" Manufacturer" );
106
- inline const std::string Header (" Header" );
107
- inline const std::string Phases (" Phases" );
108
- inline const std::string Phase (" Phase" );
109
- inline const std::string Data (" Data" );
110
- inline const std::string Index (" Index" );
122
+ EbsdLib_macOS_NO_EXPORT inline constexpr EbsdStringLiteral Manufacturer (" Manufacturer" );
123
+ EbsdLib_macOS_NO_EXPORT inline constexpr EbsdStringLiteral Header (" Header" );
124
+ EbsdLib_macOS_NO_EXPORT inline constexpr EbsdStringLiteral Phases (" Phases" );
125
+ EbsdLib_macOS_NO_EXPORT inline constexpr EbsdStringLiteral Phase (" Phase" );
126
+ EbsdLib_macOS_NO_EXPORT inline constexpr EbsdStringLiteral Data (" Data" );
127
+ EbsdLib_macOS_NO_EXPORT inline constexpr EbsdStringLiteral Index (" Index" );
111
128
112
- inline const std::string ZStartIndex (" ZStartIndex" );
113
- inline const std::string ZEndIndex (" ZEndIndex" );
114
- inline const std::string ZResolution (" Z Resolution" );
115
- inline const std::string StackingOrder (" Stacking Order" );
116
- inline const std::string SampleTransformationAngle (" SampleTransformationAngle" );
117
- inline const std::string SampleTransformationAxis (" SampleTransformationAxis" );
118
- inline const std::string EulerTransformationAngle (" EulerTransformationAngle" );
119
- inline const std::string EulerTransformationAxis (" EulerTransformationAxis" );
129
+ EbsdLib_macOS_NO_EXPORT inline constexpr EbsdStringLiteral ZStartIndex (" ZStartIndex" );
130
+ EbsdLib_macOS_NO_EXPORT inline constexpr EbsdStringLiteral ZEndIndex (" ZEndIndex" );
131
+ EbsdLib_macOS_NO_EXPORT inline constexpr EbsdStringLiteral ZResolution (" Z Resolution" );
132
+ EbsdLib_macOS_NO_EXPORT inline constexpr EbsdStringLiteral StackingOrder (" Stacking Order" );
133
+ EbsdLib_macOS_NO_EXPORT inline constexpr EbsdStringLiteral SampleTransformationAngle (" SampleTransformationAngle" );
134
+ EbsdLib_macOS_NO_EXPORT inline constexpr EbsdStringLiteral SampleTransformationAxis (" SampleTransformationAxis" );
135
+ EbsdLib_macOS_NO_EXPORT inline constexpr EbsdStringLiteral EulerTransformationAngle (" EulerTransformationAngle" );
136
+ EbsdLib_macOS_NO_EXPORT inline constexpr EbsdStringLiteral EulerTransformationAxis (" EulerTransformationAxis" );
120
137
121
138
// Each Manufacturer has their own naming scheme for these variables but for
122
139
// DREAM.3D we are going to settle on using these names for consistency
123
- inline const std::string XResolution (" X Resolution" );
124
- inline const std::string YResolution (" Y Resolution" );
140
+ EbsdLib_macOS_NO_EXPORT inline constexpr EbsdStringLiteral XResolution (" X Resolution" );
141
+ EbsdLib_macOS_NO_EXPORT inline constexpr EbsdStringLiteral YResolution (" Y Resolution" );
125
142
126
143
// We store the Maximum number of X and Y Points for the given volume. This
127
144
// allows us to store slices that have different XY voxel dimensions.
128
- inline const std::string XPoints (" Max X Points" );
129
- inline const std::string YPoints (" Max Y Points" );
145
+ EbsdLib_macOS_NO_EXPORT inline constexpr EbsdStringLiteral XPoints (" Max X Points" );
146
+ EbsdLib_macOS_NO_EXPORT inline constexpr EbsdStringLiteral YPoints (" Max Y Points" );
130
147
131
- inline const std::string FileVersionStr (" FileVersion" );
148
+ EbsdLib_macOS_NO_EXPORT inline constexpr EbsdStringLiteral FileVersionStr (" FileVersion" );
132
149
inline constexpr uint32_t FileVersion = 5 ;
133
- inline const std::string EbsdLibVersionStr (" EbsdLibVersion" );
150
+ EbsdLib_macOS_NO_EXPORT inline constexpr EbsdStringLiteral EbsdLibVersionStr (" EbsdLibVersion" );
134
151
} // namespace H5Ebsd
135
152
136
153
using EnumType = int32_t ;
@@ -149,8 +166,8 @@ enum class OEM : EnumType
149
166
150
167
namespace CellData
151
168
{
152
- inline const std::string EulerAngles (" EulerAngles" );
153
- inline const std::string Phases (" Phases" );
169
+ EbsdLib_macOS_NO_EXPORT inline constexpr EbsdStringLiteral EulerAngles (" EulerAngles" );
170
+ EbsdLib_macOS_NO_EXPORT inline constexpr EbsdStringLiteral Phases (" Phases" );
154
171
} // namespace CellData
155
172
156
173
enum EbsdToSampleCoordinateMapping
@@ -163,9 +180,9 @@ enum EbsdToSampleCoordinateMapping
163
180
164
181
namespace StackingOrder
165
182
{
166
- inline const std::string LowToHigh (" Low To High" );
167
- inline const std::string HighToLow (" High To Low" );
168
- inline const std::string UnknownStackingOrder (" Unknown Stacking Order" );
183
+ EbsdLib_macOS_NO_EXPORT inline constexpr EbsdStringLiteral LowToHigh (" Low To High" );
184
+ EbsdLib_macOS_NO_EXPORT inline constexpr EbsdStringLiteral HighToLow (" High To Low" );
185
+ EbsdLib_macOS_NO_EXPORT inline constexpr EbsdStringLiteral UnknownStackingOrder (" Unknown Stacking Order" );
169
186
170
187
namespace Utils
171
188
{
@@ -223,9 +240,9 @@ inline constexpr uint32_t UnknownCrystalStructure = 999; //!< UnknownCrystalStru
223
240
224
241
namespace BravaisLattice
225
242
{
226
- inline const std::string Unknown (" Unknown" );
227
- inline const std::string Cubic (" Cubic" );
228
- inline const std::string Hexagonal (" Hexagonal" );
243
+ EbsdLib_macOS_NO_EXPORT inline constexpr EbsdStringLiteral Unknown (" Unknown" );
244
+ EbsdLib_macOS_NO_EXPORT inline constexpr EbsdStringLiteral Cubic (" Cubic" );
245
+ EbsdLib_macOS_NO_EXPORT inline constexpr EbsdStringLiteral Hexagonal (" Hexagonal" );
229
246
} // namespace BravaisLattice
230
247
231
248
namespace AngleRepresentation
0 commit comments