0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-11-11 04:21:07 +01:00

ircd::spirit: Fix inconsistent namespace visibilities.

This commit is contained in:
Jason Volk 2022-07-04 14:22:18 -07:00
parent 8ba5548a2e
commit 03d6c32556
6 changed files with 32 additions and 52 deletions

View file

@ -15,19 +15,17 @@
// it involves extremely expensive boost headers for creating formal spirit
// grammars. This file is automatically included in the spirit.h group.
namespace ircd {
namespace spirit
__attribute__((visibility("internal")))
namespace ircd::spirit
{
template<size_t id> struct custom_parser;
template<size_t id>
struct custom_parser;
BOOST_SPIRIT_TERMINAL(custom0);
BOOST_SPIRIT_TERMINAL(custom1);
BOOST_SPIRIT_TERMINAL(custom2);
}}
}
namespace boost {
namespace spirit
__attribute__((visibility("internal")))
namespace boost::spirit
{
namespace qi
{
@ -42,23 +40,23 @@ __attribute__((visibility("internal")))
}
template<>
struct [[clang::internal_linkage]]
struct [[gnu::visibility("internal"), clang::internal_linkage]]
use_terminal<qi::domain, ircd::spirit::tag::custom0>
:mpl::true_
{};
template<>
struct [[clang::internal_linkage]]
struct [[gnu::visibility("internal"), clang::internal_linkage]]
use_terminal<qi::domain, ircd::spirit::tag::custom1>
:mpl::true_
{};
template<>
struct [[clang::internal_linkage]]
struct [[gnu::visibility("internal"), clang::internal_linkage]]
use_terminal<qi::domain, ircd::spirit::tag::custom2>
:mpl::true_
{};
}}
}
template<size_t id>
struct [[gnu::visibility("internal"), clang::internal_linkage]]

View file

@ -11,20 +11,17 @@
#pragma once
#define HAVE_IRCD_SPIRIT_EXPECTATION_FAILURE_H
namespace ircd {
namespace spirit
__attribute__((visibility("default")))
namespace ircd::spirit
{
template<class parent_error>
struct expectation_failure;
// parse.cc
extern thread_local char rule_buffer[128];
}}
}
template<class parent_error>
struct __attribute__((visibility("default")))
ircd::spirit::expectation_failure
struct ircd::spirit::expectation_failure
:parent_error
{
template<class it = const char *>

View file

@ -40,7 +40,7 @@ namespace ircd::spirit
/// of indirect calls.
///
template<class T>
struct [[clang::internal_linkage]]
struct [[gnu::visibility("internal"), clang::internal_linkage]]
ircd::spirit::expr
:boost::proto::result_of::deep_copy<T>::type
{

View file

@ -15,28 +15,11 @@
// it involves extremely expensive boost headers for creating formal spirit
// grammars. This file is automatically included in the spirit.h group.
namespace ircd {
namespace spirit
__attribute__((visibility("default")))
namespace ircd::spirit
{
IRCD_EXCEPTION(error, generator_error);
IRCD_EXCEPTION(generator_error, buffer_overrun);
constexpr size_t
generator_buffer_size {64_KiB},
generator_buffer_count {8};
extern thread_local struct generator_state *
generator_state;
extern thread_local char
generator_buffer[generator_buffer_count][generator_buffer_size];
}}
namespace ircd {
namespace spirit
__attribute__((visibility("internal")))
{
using prop_mask = mpl_::int_
<
karma::generator_properties::no_properties
@ -51,11 +34,22 @@ __attribute__((visibility("internal")))
char *, prop_mask, unused_type
>;
constexpr size_t
generator_buffer_size {64_KiB},
generator_buffer_count {8};
extern thread_local struct generator_state *
generator_state;
extern thread_local char
generator_buffer[generator_buffer_count][generator_buffer_size];
template<bool truncation = false,
class gen,
class... attr>
[[gnu::visibility("internal"), clang::internal_linkage]]
bool generate(mutable_buffer &out, gen&&, attr&&...);
}}
}
/// This structure is a shadow for the default spirit::karma buffering
/// stack. They conduct buffering by allocating and copying standard strings
@ -65,7 +59,7 @@ __attribute__((visibility("internal")))
/// height of any stack growing from an ircd::spirit::generate() call without
/// need for reentrancy. This gives us the ability to pre-allocate thread_local
/// buffers.
struct [[gnu::visibility("internal")]]
struct [[gnu::visibility("default")]]
ircd::spirit::generator_state
{
/// The number of instances stacked behind the current state. This should

View file

@ -15,9 +15,7 @@
// it involves extremely expensive boost headers for creating formal spirit
// grammars. This file is automatically included in the spirit.h group.
namespace ircd {
namespace spirit
__attribute__((visibility("internal")))
namespace ircd::spirit
{
template<class rule,
class... attr>
@ -32,7 +30,7 @@ __attribute__((visibility("internal")))
template<class rule,
class... attr>
bool parse(std::nothrow_t, const char *&start, const char *const &stop, rule&&, attr&&...) noexcept;
}}
}
/// Execute the parse. The start pointer is advanced upon successful execution.
/// Failures must not throw: If the grammar contains any epsilon expressions or

View file

@ -11,17 +11,10 @@
#pragma once
#define HAVE_IRCD_SPIRIT_SPIRIT_H
namespace ircd {
namespace spirit
__attribute__((visibility("default")))
namespace ircd::spirit
{
IRCD_EXCEPTION(ircd::error, error);
}}
namespace ircd {
namespace spirit
__attribute__((visibility("internal")))
{
namespace phx = boost::phoenix;
namespace proto = boost::proto;
namespace fusion = boost::fusion;
@ -113,7 +106,7 @@ __attribute__((visibility("internal")))
class semantic_context>
auto &
local_at(semantic_context&&);
}}
}
template<size_t idx,
class semantic_context>