mirror of
https://github.com/matrix-construct/construct
synced 2025-02-18 01:30:12 +01:00
ircd::spirit: Apply hidden visibility to all headers + our internal grammar namespaces.
This commit is contained in:
parent
77c7b43eea
commit
af1bd92b26
7 changed files with 33 additions and 19 deletions
|
@ -20,8 +20,6 @@ namespace ircd::rfc3986
|
|||
IRCD_EXCEPTION(coding_error, decoding_error)
|
||||
|
||||
struct parser;
|
||||
struct encoder extern const encoder;
|
||||
struct decoder extern const decoder;
|
||||
|
||||
constexpr size_t HOSTNAME_MAX {rfc1035::LABEL_MAX};
|
||||
constexpr size_t DOMAIN_MAX {rfc1035::NAME_MAX};
|
||||
|
|
|
@ -15,14 +15,25 @@
|
|||
/// it involves extremely expensive boost headers for creating formal spirit
|
||||
/// grammars. Include this in a definition file which defines such grammars.
|
||||
|
||||
#pragma GCC visibility push(hidden)
|
||||
#include <boost/spirit/include/qi.hpp>
|
||||
#include <boost/spirit/include/karma.hpp>
|
||||
#include <boost/spirit/include/phoenix.hpp>
|
||||
#include <boost/fusion/include/std_pair.hpp>
|
||||
#include <boost/fusion/adapted/std_pair.hpp>
|
||||
#include <boost/fusion/adapted/std_tuple.hpp>
|
||||
#pragma GCC visibility pop
|
||||
|
||||
namespace ircd::spirit
|
||||
{
|
||||
template<class parent_error> struct expectation_failure;
|
||||
|
||||
extern thread_local char rulebuf[64]; // parse.cc
|
||||
}
|
||||
|
||||
namespace ircd {
|
||||
namespace spirit
|
||||
__attribute__((visibility("hidden")))
|
||||
{
|
||||
namespace spirit = boost::spirit;
|
||||
namespace ascii = spirit::ascii;
|
||||
|
@ -87,11 +98,7 @@ namespace ircd::spirit
|
|||
using _r1_type = phx::actor<spirit::attribute<1>>;
|
||||
using _r2_type = phx::actor<spirit::attribute<2>>;
|
||||
using _r3_type = phx::actor<spirit::attribute<3>>;
|
||||
|
||||
template<class parent_error> struct expectation_failure;
|
||||
|
||||
extern thread_local char rulebuf[64]; // parse.cc
|
||||
}
|
||||
}}
|
||||
|
||||
namespace ircd::spirit::local
|
||||
{
|
||||
|
|
|
@ -10,7 +10,8 @@
|
|||
|
||||
#include <ircd/spirit.h>
|
||||
|
||||
namespace ircd::fmt
|
||||
namespace ircd { namespace fmt
|
||||
__attribute__((visibility("hidden")))
|
||||
{
|
||||
using namespace ircd::spirit;
|
||||
|
||||
|
@ -42,7 +43,7 @@ namespace ircd::fmt
|
|||
void handle_specifier(mutable_buffer &out, const uint &idx, const spec &, const arg &);
|
||||
template<class generator> bool generate_string(char *&out, const generator &gen, const arg &val);
|
||||
template<class T, class lambda> bool visit_type(const arg &val, lambda&& closure);
|
||||
}
|
||||
}}
|
||||
|
||||
/// Structural representation of a format specifier. The parse of each
|
||||
/// specifier in the format string creates one of these.
|
||||
|
|
|
@ -10,7 +10,8 @@
|
|||
|
||||
#include <ircd/spirit.h>
|
||||
|
||||
namespace ircd::http
|
||||
namespace ircd { namespace http
|
||||
__attribute__((visibility("hidden")))
|
||||
{
|
||||
using namespace ircd::spirit;
|
||||
|
||||
|
@ -20,7 +21,7 @@ namespace ircd::http
|
|||
extern const std::unordered_map<ircd::http::code, ircd::string_view> reason;
|
||||
|
||||
[[noreturn]] void throw_error(const qi::expectation_failure<const char *> &, const bool &internal = false);
|
||||
}
|
||||
}}
|
||||
|
||||
BOOST_FUSION_ADAPT_STRUCT
|
||||
(
|
||||
|
|
|
@ -11,7 +11,8 @@
|
|||
#include <ircd/spirit.h>
|
||||
#include <boost/fusion/include/at.hpp>
|
||||
|
||||
namespace ircd::json
|
||||
namespace ircd { namespace json
|
||||
__attribute__((visibility("hidden")))
|
||||
{
|
||||
using namespace ircd::spirit;
|
||||
|
||||
|
@ -23,7 +24,7 @@ namespace ircd::json
|
|||
struct printer extern const printer;
|
||||
|
||||
const size_t &error_show_max {48};
|
||||
}
|
||||
}}
|
||||
|
||||
BOOST_FUSION_ADAPT_STRUCT
|
||||
(
|
||||
|
|
|
@ -15,19 +15,21 @@ namespace ircd::rfc1459
|
|||
using namespace ircd::spirit;
|
||||
}
|
||||
|
||||
namespace ircd::rfc1459::parse
|
||||
namespace ircd { namespace rfc1459 { namespace parse
|
||||
__attribute__((visibility("hidden")))
|
||||
{
|
||||
template<class it, class top> struct grammar;
|
||||
struct capstan extern const capstan;
|
||||
struct head extern const head;
|
||||
}
|
||||
}}}
|
||||
|
||||
namespace ircd::rfc1459::gen
|
||||
namespace ircd { namespace rfc1459 { namespace gen
|
||||
__attribute__((visibility("hidden")))
|
||||
{
|
||||
using ircd::spirit::buffer;
|
||||
|
||||
template<class it, class top> struct grammar;
|
||||
}
|
||||
}}}
|
||||
|
||||
BOOST_FUSION_ADAPT_STRUCT
|
||||
(
|
||||
|
|
|
@ -10,10 +10,14 @@
|
|||
|
||||
#include <ircd/spirit.h>
|
||||
|
||||
namespace ircd::rfc3986
|
||||
namespace ircd { namespace rfc3986
|
||||
__attribute__((visibility("hidden")))
|
||||
{
|
||||
using namespace ircd::spirit;
|
||||
}
|
||||
|
||||
struct encoder extern const encoder;
|
||||
struct decoder extern const decoder;
|
||||
}}
|
||||
|
||||
struct ircd::rfc3986::encoder
|
||||
:karma::grammar<char *, const string_view &>
|
||||
|
|
Loading…
Add table
Reference in a new issue