0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-06-02 10:08:56 +02:00

ircd::spirit: Apply hidden visibility to all headers + our internal grammar namespaces.

This commit is contained in:
Jason Volk 2019-04-16 17:12:17 -07:00
parent 77c7b43eea
commit af1bd92b26
7 changed files with 33 additions and 19 deletions

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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