mirror of
https://github.com/falcosecurity/falco.git
synced 2025-07-05 19:06:44 +00:00
Specify namespace compat w/ gcc 5
I wasn't able to compile the dev branch with gcc 5.4 (e.g. not using the builder), getting this error: ``` .../falco/userspace/falco/grpc_server.cpp:40:109: error: specialization of ‘template<class Request, class Response> void falco::grpc::request_stream_context<Request, Response>::start(falco::grpc::server*)’ in different namespace [-fpermissive] void falco::grpc::request_stream_context<falco::output::request, falco::output::response>::start(server* srv) ^ In file included from .../falco/userspace/falco/grpc_server.cpp:26:0: .../falco/userspace/falco/grpc_server.h:102:7: error: from definition of ‘template<class Request, class Response> void falco::grpc::request_stream_context<Request, Response>::start(falco::grpc::server*)’ [-fpermissive] void start(server* srv); ``` It looks like gcc 5.4 doesn't handle a declaration with namespace blocks but a definition with namespaces in the function. https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56480 has more detail. A workaround is to add `namespace falco {` and `namespace grpc {` around the declarations. Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
This commit is contained in:
parent
db3383180c
commit
2bc4bfd7fb
@ -36,8 +36,13 @@ limitations under the License.
|
||||
ctx.start(this); \
|
||||
}
|
||||
|
||||
namespace falco
|
||||
{
|
||||
namespace grpc
|
||||
{
|
||||
|
||||
template<>
|
||||
void falco::grpc::request_stream_context<falco::output::request, falco::output::response>::start(server* srv)
|
||||
void request_stream_context<falco::output::request, falco::output::response>::start(server* srv)
|
||||
{
|
||||
m_state = request_context_base::REQUEST;
|
||||
m_srv_ctx.reset(new ::grpc::ServerContext);
|
||||
@ -50,7 +55,7 @@ void falco::grpc::request_stream_context<falco::output::request, falco::output::
|
||||
}
|
||||
|
||||
template<>
|
||||
void falco::grpc::request_stream_context<falco::output::request, falco::output::response>::process(server* srv)
|
||||
void request_stream_context<falco::output::request, falco::output::response>::process(server* srv)
|
||||
{
|
||||
// When it is the 1st process call
|
||||
if(m_state == request_context_base::REQUEST)
|
||||
@ -79,7 +84,7 @@ void falco::grpc::request_stream_context<falco::output::request, falco::output::
|
||||
}
|
||||
|
||||
template<>
|
||||
void falco::grpc::request_stream_context<falco::output::request, falco::output::response>::end(server* srv, bool errored)
|
||||
void request_stream_context<falco::output::request, falco::output::response>::end(server* srv, bool errored)
|
||||
{
|
||||
if(m_stream_ctx)
|
||||
{
|
||||
@ -92,6 +97,8 @@ void falco::grpc::request_stream_context<falco::output::request, falco::output::
|
||||
|
||||
start(srv);
|
||||
}
|
||||
} // namespace grpc
|
||||
} // namespace falco
|
||||
|
||||
void falco::grpc::server::thread_process(int thread_index)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user