0
0
mirror of https://github.com/PurpleI2P/i2pd synced 2025-10-05 23:52:50 +02:00

handle ThrowFatal for Haiku

This commit is contained in:
orignal
2025-09-19 13:40:41 -04:00
parent fd4635e8f4
commit 1f0512c4f6
2 changed files with 15 additions and 1 deletions

View File

@@ -134,6 +134,7 @@ namespace util
return instance;
}
bool init(int argc, char* argv[]);
void run ();
};
#define Daemon i2p::util::DaemonHaiku::Instance()

View File

@@ -9,12 +9,16 @@
#if defined(__HAIKU__)
#include <memory>
#include <string>
#include <MenuItem.h>
#include <MenuBar.h>
#include <MessageRunner.h>
#include <Window.h>
#include <Application.h>
#include <Alert.h>
#include "version.h"
#include "Log.h"
#include "RouterContext.h"
#include "Tunnel.h"
#include "Daemon.h"
@@ -44,7 +48,7 @@ class I2PApp: public BApplication
};
MainWindow::MainWindow ():
BWindow (BRect(100, 100, 500, 400), "i2pd", B_TITLED_WINDOW, B_QUIT_ON_WINDOW_CLOSE),
BWindow (BRect(100, 100, 500, 400), "i2pd " VERSION, B_TITLED_WINDOW, B_QUIT_ON_WINDOW_CLOSE),
m_Messenger (nullptr, this)
{
auto r = Bounds (); r.bottom = 20;
@@ -94,6 +98,15 @@ namespace i2p
{
namespace util
{
bool DaemonHaiku::init(int argc, char* argv[])
{
i2p::log::SetThrowFunction ([](const std::string& s)
{
// BAlert ("Critical", s.c_str (), "Ok").Go ();
});
return Daemon_Singleton::init (argc, argv);
}
void DaemonHaiku::run ()
{
if (isDaemon)