From 6d53b510ac5232de369e355e0a4098be55dd3b3b Mon Sep 17 00:00:00 2001
From: Gerasim Troeglazov <3dEyes@gmail.com>
Date: Fri, 11 Dec 2020 21:11:56 +1000
Subject: Add Haiku support


diff --git a/libs/librepcb/common/systeminfo.cpp b/libs/librepcb/common/systeminfo.cpp
index 3436f2f..48e49e1 100644
--- a/libs/librepcb/common/systeminfo.cpp
+++ b/libs/librepcb/common/systeminfo.cpp
@@ -59,6 +59,10 @@
 #error "Unknown operating system!"
 #endif
 
+#if defined(Q_OS_HAIKU)
+#include <OS.h>
+#endif
+
 /*******************************************************************************
  *  Namespace
  ******************************************************************************/
@@ -295,6 +299,12 @@ QString SystemInfo::getProcessNameByPid(qint64 pid) {
     return QString();  // process not running
   }
   processName = QString::fromLocal8Bit(psinfo.pr_fname);
+#elif defined(Q_OS_HAIKU)
+  team_info info;
+  if (get_team_info(pid, &info) == B_OK) {
+    processName = QString::fromLocal8Bit(info.args, 64);
+  } else
+	return QString();
 #else
 #error "Unknown operating system!"
 #endif
-- 
2.28.0

