summaryrefslogtreecommitdiff
path: root/lang/parrot/patches/patch-ab
blob: 794f21e9c9d2583c65c1527b0d6104702dd7b24e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
$NetBSD: patch-ab,v 1.6 2009/04/17 22:08:44 he Exp $

The R_PPC_ADDR16{HI,LO} constants are named something else on
NetBSD, and might be elsewhere.
Also add workarounds for NetBSD/powerpc 3.x, which has some
constants defined as enums.

--- src/exec_save.c.orig	2009-03-08 20:32:43.000000000 +0000
+++ src/exec_save.c
@@ -30,6 +30,26 @@ static void save_int(FILE *fp, int i);
 static void save_short(FILE *fp, short s);
 static void save_struct(FILE *fp, void *sp, size_t size);
 
+#if defined(PARROT_PPC)
+#if !defined(R_PPC_ADDR16_HI) && !defined(R_PPC_ADDR16_LO) && \
+	defined(R_PPC_16_HI) && defined(R_PPC_16_LO)
+# define	R_PPC_ADDR16_HI	R_PPC_16_HI
+# define	R_PPC_ADDR16_LO	R_PPC_16_LO
+#endif
+/*
+ * NetBSD/powerpc 3.x doesn't define these constants,
+ * but instead has them as enums, so add some workarounds for it.
+ */
+#if !defined(R_PPC_ADDR16_HI) && !defined(R_PPC_ADDR16_LO) && \
+	defined(__NetBSD__)
+# define	R_PPC_ADDR16_HI RELOC_16_HI
+# define	R_PPC_ADDR16_LO RELOC_16_LO
+#endif
+#if !defined(R_PPC_REL24) && defined(__NetBSD__)
+# define	R_PPC_REL24	RELOC_REL24
+#endif
+#endif /* PARROT_PPC */
+
 #ifdef EXEC_A_OUT
 
 #  include <a.out.h>