chrpath: new recipe (#8639)

*very* lightly tested.
This commit is contained in:
OscarL
2023-11-01 15:06:46 -03:00
committed by GitHub
parent 0bc32b534a
commit d5f16fd3ee
2 changed files with 92 additions and 0 deletions

View File

@@ -0,0 +1,39 @@
From 5ce86fd44694055d87e2cc2a3e1500f293bfe3ed Mon Sep 17 00:00:00 2001
From: Oscar Lesta <oscar.lesta@gmail.com>
Date: Sat, 13 May 2023 16:47:24 -0300
Subject: Fix build on Haiku
diff --git a/protos.h b/protos.h
index f24bc06..b16b1cc 100644
--- a/protos.h
+++ b/protos.h
@@ -1,7 +1,14 @@
#ifndef PROTOS_H
#define PROTOS_H
+#ifdef __HAIKU__
+ #include <ByteOrder.h>
+ #define bswap_16 B_SWAP_INT16
+ #define bswap_32 B_SWAP_INT32
+ #define bswap_64 B_SWAP_INT64
+#else
#include <byteswap.h>
+#endif
#include <elf.h>
#include "config.h"
@@ -25,6 +32,10 @@ typedef union {
Elf64_Shdr e64;
} Elf_Shdr;
+#ifdef __HAIKU__
+ #undef Elf_Phdr
+#endif
+
typedef union {
Elf32_Phdr e32;
Elf64_Phdr e64;
--
2.37.3