diff options
| author | cjep <cjep@NetBSD.org> | 2021-06-23 20:20:44 +0000 |
|---|---|---|
| committer | cjep <cjep@NetBSD.org> | 2021-06-23 20:20:44 +0000 |
| commit | 72ffdcff9992eb4b92968c46c0d08d04bfb6664b (patch) | |
| tree | 9108016630a0943309630d9f04eabbfdbbe5d2b2 | |
| parent | caf69e41c0f8d66f8bc29aaff6db586dab9aaada (diff) | |
nbmacppc-fixcoff did not cross-build correctly on OpenBSD because
fixcoff.c had its own definition of htobe16. The toolchain
already handles this. Now builds on OpenBSD. Checked on NetBSD, Darwin &
Linux.
Discussed with uwe@
| -rw-r--r-- | sys/arch/macppc/stand/fixcoff/fixcoff.c | 23 |
1 files changed, 4 insertions, 19 deletions
diff --git a/sys/arch/macppc/stand/fixcoff/fixcoff.c b/sys/arch/macppc/stand/fixcoff/fixcoff.c index 16d5ccd7654..c0f96f0bb84 100644 --- a/sys/arch/macppc/stand/fixcoff/fixcoff.c +++ b/sys/arch/macppc/stand/fixcoff/fixcoff.c @@ -1,4 +1,4 @@ -/* $NetBSD: fixcoff.c,v 1.11 2009/03/14 15:36:09 dsl Exp $ */ +/* $NetBSD: fixcoff.c,v 1.12 2021/06/23 20:20:44 cjep Exp $ */ /* * Copyright (c) 1999 National Aeronautics & Space Administration @@ -43,30 +43,15 @@ #if HAVE_NBTOOL_CONFIG_H #include "nbtool_config.h" -#endif +#else /* HAVE_NBTOOL_CONFIG_H */ +#include <sys/endian.h> +#endif /* HAVE_NBTOOL_CONFIG_H */ #include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <fcntl.h> -#if HAVE_NBTOOL_CONFIG_H - -#if WORDS_BIGENDIAN -#define htobe16(x) (x) -#else -static unsigned short -__htobe16(unsigned short x) -{ - return (((x & 0xff00) >> 8) | ((x & 0x00ff) << 8)); -} -#define htobe16(x) __htobe16(x) -#endif /* WORDS_BIGENDIAN */ - -#else /* HAVE_NBTOOL_CONFIG_H */ -#include <sys/endian.h> -#endif /* HAVE_NBTOOL_CONFIG_H */ - struct filehdr { #define U802WRMAGIC 0730 #define U802ROMAGIC 0735 |
