mirror of
https://github.com/falcosecurity/falco.git
synced 2026-02-21 14:13:27 +00:00
fix(webserver): fix inconsistent include directives trying to compile the webserver on Apple
Signed-off-by: Paolo Polidori <paolo.polidori@sysdig.com>
This commit is contained in:
@@ -17,7 +17,7 @@ limitations under the License.
|
||||
|
||||
#include "actions.h"
|
||||
|
||||
#if !defined(_WIN32) && !defined(__EMSCRIPTEN__) && !defined(MINIMAL_BUILD)
|
||||
#if defined(__linux__) && !defined(__EMSCRIPTEN__) && !defined(MINIMAL_BUILD)
|
||||
#include "webserver.h"
|
||||
#endif
|
||||
|
||||
@@ -25,7 +25,7 @@ using namespace falco::app;
|
||||
using namespace falco::app::actions;
|
||||
|
||||
falco::app::run_result falco::app::actions::start_webserver(falco::app::state& state) {
|
||||
#if !defined(_WIN32) && !defined(__EMSCRIPTEN__) && !defined(MINIMAL_BUILD)
|
||||
#if defined(__linux__) && !defined(__EMSCRIPTEN__) && !defined(MINIMAL_BUILD)
|
||||
if(state.is_capture_mode() || !state.config->m_webserver_enabled) {
|
||||
return run_result::ok();
|
||||
}
|
||||
@@ -50,7 +50,7 @@ falco::app::run_result falco::app::actions::start_webserver(falco::app::state& s
|
||||
}
|
||||
|
||||
falco::app::run_result falco::app::actions::stop_webserver(falco::app::state& state) {
|
||||
#if !defined(_WIN32) && !defined(__EMSCRIPTEN__) && !defined(MINIMAL_BUILD)
|
||||
#if defined(__linux__) && !defined(__EMSCRIPTEN__) && !defined(MINIMAL_BUILD)
|
||||
if(state.is_capture_mode() || !state.config->m_webserver_enabled) {
|
||||
return run_result::ok();
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@ limitations under the License.
|
||||
#include "restart_handler.h"
|
||||
#include "../configuration.h"
|
||||
#include "../stats_writer.h"
|
||||
#if !defined(_WIN32) && !defined(__EMSCRIPTEN__) && !defined(MINIMAL_BUILD)
|
||||
#if defined(__linux__) && !defined(__EMSCRIPTEN__) && !defined(MINIMAL_BUILD)
|
||||
#include "../webserver.h"
|
||||
#endif
|
||||
|
||||
@@ -109,7 +109,7 @@ struct state {
|
||||
// Helper responsible for watching of handling hot application restarts
|
||||
std::shared_ptr<restart_handler> restarter;
|
||||
|
||||
#if !defined(_WIN32) && !defined(__EMSCRIPTEN__) && !defined(MINIMAL_BUILD)
|
||||
#if defined(__linux__) && !defined(__EMSCRIPTEN__) && !defined(MINIMAL_BUILD)
|
||||
falco_webserver webserver;
|
||||
#endif
|
||||
// Set by start_webserver to start prometheus metrics
|
||||
|
||||
@@ -28,7 +28,7 @@ limitations under the License.
|
||||
#include "outputs_program.h"
|
||||
#include "outputs_syslog.h"
|
||||
#endif
|
||||
#if !defined(_WIN32) && !defined(__EMSCRIPTEN__) && !defined(MINIMAL_BUILD)
|
||||
#if defined(__linux__) && !defined(__EMSCRIPTEN__) && !defined(MINIMAL_BUILD)
|
||||
#include "outputs_http.h"
|
||||
#endif
|
||||
|
||||
@@ -93,7 +93,7 @@ void falco_outputs::add_output(const falco::outputs::config &oc) {
|
||||
oo = std::make_unique<falco::outputs::output_syslog>();
|
||||
}
|
||||
#endif
|
||||
#if !defined(_WIN32) && !defined(__EMSCRIPTEN__) && !defined(MINIMAL_BUILD)
|
||||
#if defined(__linux__) && !defined(__EMSCRIPTEN__) && !defined(MINIMAL_BUILD)
|
||||
else if(oc.name == "http") {
|
||||
oo = std::make_unique<falco::outputs::output_http>();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user