From 7518813d49459abda5033ee140f26c0126c71bd0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krystian=20Bac=C5=82awski?= Date: Thu, 16 Feb 2012 21:28:24 -0800 Subject: [PATCH] Add endian aware getters and setters. --- tools/defs.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tools/defs.h b/tools/defs.h index 8cd8957..c5acd7f 100644 --- a/tools/defs.h +++ b/tools/defs.h @@ -7,13 +7,15 @@ #ifndef _DEFS_H_ #define _DEFS_H_ -#include +#include #include #include "a.out.h" -#define GETWORD(x) ntohs(x) -#define GETLONG(x) ntohl(x) +#define GETWORD(x) be16toh(x) +#define GETLONG(x) be32toh(x) +#define PUTWORD(x) htobe16(x) +#define PUTLONG(x) htobe32(x) /* Converts an SLINE value to an offset in the text section. This definition is OK for ld 1.8, currently used on the Amiga AFAIK,