mirror of
https://github.com/yann64/haikuports.git
synced 2026-04-20 10:40:05 +02:00
* Add appstream * recipe cleanup, add appstreamqt --------- Co-authored-by: Luc Schrijvers <begasus@gmail.com>
39 lines
951 B
Plaintext
39 lines
951 B
Plaintext
From 066d7f81183d71158b961bb26667e149321f8409 Mon Sep 17 00:00:00 2001
|
|
From: Sebastian Silva <sebastian@fuentelibre.org>
|
|
Date: Wed, 11 Jun 2025 20:15:07 +0000
|
|
Subject: [PATCH] Add Haiku
|
|
|
|
---
|
|
src/as-system-info.c | 8 ++++++++
|
|
1 file changed, 8 insertions(+)
|
|
|
|
diff --git a/src/as-system-info.c b/src/as-system-info.c
|
|
index 0c7e27c..3d12f5b 100644
|
|
--- a/src/as-system-info.c
|
|
+++ b/src/as-system-info.c
|
|
@@ -65,6 +65,9 @@
|
|
#endif
|
|
|
|
#include "as-utils-private.h"
|
|
+#ifdef __HAIKU__
|
|
+#include <OS.h>
|
|
+#endif
|
|
|
|
#define MB_IN_BYTES (1024 * 1024)
|
|
|
|
@@ -519,6 +522,11 @@ as_get_physical_memory_total (void)
|
|
if (physpages > 0 && pagesize > 0)
|
|
return (physpages * pagesize) / MB_IN_BYTES;
|
|
return 0;
|
|
+#elif defined(__HAIKU__)
|
|
+ system_info info;
|
|
+ if (get_system_info(&info) != B_OK)
|
|
+ return 0;
|
|
+ return (guint64)info.max_pages * B_PAGE_SIZE;
|
|
#else
|
|
#error "Implementation of as_get_physical_memory_total() missing for this OS."
|
|
#endif
|
|
--
|
|
2.48.1
|
|
|