0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-05-29 08:13:46 +02:00

ircd::spirit: Adjust generator_state linkage for clang/gcc.

This commit is contained in:
Jason Volk 2020-08-30 10:06:17 -07:00
parent 8505635716
commit d64d038911
2 changed files with 13 additions and 1 deletions

View file

@ -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];
}}

View file

@ -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