feature/freebsd-support-one: main freebsd adjustments

This commit is contained in:
cosmicpsyop
2023-10-24 03:31:54 -07:00
parent 13b0296ba3
commit b22e515a71
6 changed files with 17 additions and 3 deletions

View File

@ -17,6 +17,11 @@
#include "events.h"
#ifdef __FreeBSD__
extern char **environ;
#endif
enum class PluginEventSifterResult {
Accept,

View File

@ -143,7 +143,7 @@ class WSConnection : NonCopyable {
hubTrigger->setData(&asyncCb);
hubTrigger->start([](uS::Async *a){
auto *r = static_cast<std::function<void()> *>(a->data);
auto *r = static_cast<std::function<void()> *>(a->getData());
(*r)();
});

View File

@ -391,7 +391,7 @@ struct Router {
hubTrigger->setData(&asyncCb);
hubTrigger->start([](uS::Async *a){
auto *r = static_cast<std::function<void()> *>(a->data);
auto *r = static_cast<std::function<void()> *>(a->getData());
(*r)();
});

View File

@ -223,7 +223,7 @@ void RelayServer::runWebsocket(ThreadPool<MsgWebsocket>::Thread &thr) {
hubTrigger->setData(&asyncCb);
hubTrigger->start([](uS::Async *a){
auto *r = static_cast<std::function<void()> *>(a->data);
auto *r = static_cast<std::function<void()> *>(a->getData());
(*r)();
});

View File

@ -1,4 +1,8 @@
#include <arpa/inet.h>
#ifdef __FreeBSD__
#include <sys/socket.h>
#include <netinet/in.h>
#endif
#include <stdio.h>
#include <signal.h>

View File

@ -69,5 +69,10 @@ static void setRLimits() {
void onAppStartup(lmdb::txn &txn, const std::string &cmd) {
dbCheck(txn, cmd);
#ifndef __FreeBSD__
// XXX - strfry error: Unable to set NOFILES limit to 1000000, exceeds max of 116991
// XXX - warning: comparison of integer expressions of different signedness:
// XXX 'const uint64_t' {aka 'const long unsigned int'} and 'rlim_t' {aka 'long int'} [-Wsign-compare]
setRLimits();
#endif
}