mirror of
https://github.com/matrix-construct/construct
synced 2024-12-26 15:33:54 +01:00
ircd::spirit: Adjust generator_state linkage for clang/gcc.
This commit is contained in:
parent
8505635716
commit
d64d038911
2 changed files with 13 additions and 1 deletions
|
@ -14,6 +14,12 @@
|
|||
/// it involves extremely expensive boost headers for creating formal spirit
|
||||
/// grammars. This file is automatically included in the spirit.h group.
|
||||
|
||||
#ifdef __clang__
|
||||
#define IRCD_SPIRIT_GSPTR_LINKAGE static
|
||||
#else
|
||||
#define IRCD_SPIRIT_GSPTR_LINKAGE extern
|
||||
#endif
|
||||
|
||||
namespace ircd {
|
||||
namespace spirit
|
||||
__attribute__((visibility("default")))
|
||||
|
@ -21,7 +27,7 @@ __attribute__((visibility("default")))
|
|||
IRCD_EXCEPTION(error, generator_error);
|
||||
IRCD_EXCEPTION(generator_error, buffer_overrun);
|
||||
|
||||
static thread_local struct generator_state *generator_state {nullptr};
|
||||
IRCD_SPIRIT_GSPTR_LINKAGE thread_local struct generator_state *generator_state;
|
||||
extern thread_local char generator_buffer[8][64_KiB];
|
||||
}}
|
||||
|
||||
|
|
|
@ -28,6 +28,12 @@ decltype(ircd::spirit::rule_buffer)
|
|||
ircd::spirit::rule_buffer
|
||||
alignas(64);
|
||||
|
||||
#ifndef __clang__
|
||||
thread_local
|
||||
decltype(ircd::spirit::generator_state)
|
||||
ircd::spirit::generator_state;
|
||||
#endif
|
||||
|
||||
thread_local
|
||||
decltype(ircd::spirit::generator_buffer)
|
||||
ircd::spirit::generator_buffer
|
||||
|
|
Loading…
Reference in a new issue