mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-17 02:49:12 +00:00
Too lazy to comment
This commit is contained in:
+16
-3
@@ -142,17 +142,30 @@ namespace IfcParse {
|
|||||||
Token OperatorTokenPtr(IfcSpfLexer* tokens, unsigned start, unsigned end);
|
Token OperatorTokenPtr(IfcSpfLexer* tokens, unsigned start, unsigned end);
|
||||||
Token GeneralTokenPtr(IfcSpfLexer* tokens, unsigned start, unsigned end);
|
Token GeneralTokenPtr(IfcSpfLexer* tokens, unsigned start, unsigned end);
|
||||||
Token NoneTokenPtr();
|
Token NoneTokenPtr();
|
||||||
|
/* gcc doesn't know _Thread_local from C11 yet */
|
||||||
|
#ifdef __GNUC__
|
||||||
|
# define thread_local __thread
|
||||||
|
#elif __STDC_VERSION__ >= 201112L
|
||||||
|
# define thread_local _Thread_local
|
||||||
|
#elif defined(_MSC_VER)
|
||||||
|
# define thread_local __declspec(thread)
|
||||||
|
#else
|
||||||
|
# error Cannot define thread_local
|
||||||
|
#endif
|
||||||
/// A stream of tokens to be read from a IfcSpfStream.
|
/// A stream of tokens to be read from a IfcSpfStream.
|
||||||
class IFC_PARSE_API IfcSpfLexer {
|
class IFC_PARSE_API IfcSpfLexer {
|
||||||
private:
|
private:
|
||||||
IfcCharacterDecoder* decoder;
|
IfcCharacterDecoder* decoder;
|
||||||
//storage for temporary string without allocation
|
//storage for temporary string without allocation
|
||||||
mutable std::string _tempString;
|
// mutable std::string _tempString;
|
||||||
unsigned int skipWhitespace();
|
unsigned int skipWhitespace();
|
||||||
unsigned int skipComment();
|
unsigned int skipComment();
|
||||||
public:
|
public:
|
||||||
std::string &GetTempString() const { return _tempString; }
|
// std::string &GetTempString() const { return _tempString; }
|
||||||
|
std::string &GetTempString() const {
|
||||||
|
static thread_local std::string s;
|
||||||
|
return s;
|
||||||
|
}
|
||||||
IfcSpfStream* stream;
|
IfcSpfStream* stream;
|
||||||
IfcFile* file;
|
IfcFile* file;
|
||||||
IfcSpfLexer(IfcSpfStream* s, IfcFile* f);
|
IfcSpfLexer(IfcSpfStream* s, IfcFile* f);
|
||||||
|
|||||||
Reference in New Issue
Block a user