Due to recent changes in the cd9660 code, crosscompilation of tools/makefs
now fails due to the use of [be]e{16,32}dec. Add a compat header, and force the inclusion of <sys/endian.h>.
This commit is contained in:
parent
e6a160bd78
commit
f7c54e5b52
32
tools/compat/sys/endian.h
Normal file
32
tools/compat/sys/endian.h
Normal file
@ -0,0 +1,32 @@
|
||||
/* $NetBSD: endian.h,v 1.1 2007/01/28 09:19:33 dogcow Exp $ */
|
||||
|
||||
static __inline uint16_t __unused
|
||||
be16dec(const void *buf)
|
||||
{
|
||||
const uint8_t *p = (const uint8_t *)buf;
|
||||
|
||||
return ((p[0] << 8) | p[1]);
|
||||
}
|
||||
|
||||
static __inline uint16_t __unused
|
||||
le16dec(const void *buf)
|
||||
{
|
||||
const uint8_t *p = (const uint8_t *)buf;
|
||||
|
||||
return ((p[1] << 8) | p[0]);
|
||||
}
|
||||
|
||||
be32dec(const void *buf)
|
||||
{
|
||||
const uint8_t *p = (const uint8_t *)buf;
|
||||
|
||||
return ((p[0] << 24) | (p[1] << 16) | (p[2] << 8) | p[3]);
|
||||
}
|
||||
|
||||
static __inline uint32_t __unused
|
||||
le32dec(const void *buf)
|
||||
{
|
||||
const uint8_t *p = (const uint8_t *)buf;
|
||||
|
||||
return ((p[3] << 24) | (p[2] << 16) | (p[1] << 8) | p[0]);
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: cd9660_debug.c,v 1.5 2006/12/18 21:03:29 christos Exp $ */
|
||||
/* $NetBSD: cd9660_debug.c,v 1.6 2007/01/28 09:19:33 dogcow Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2005 Daniel Watt, Walter Deignan, Ryan Gabrys, Alan
|
||||
@ -38,9 +38,10 @@
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
#include <sys/param.h>
|
||||
#include <sys/endian.h>
|
||||
|
||||
#if defined(__RCSID) && !defined(__lint)
|
||||
__RCSID("$NetBSD: cd9660_debug.c,v 1.5 2006/12/18 21:03:29 christos Exp $");
|
||||
__RCSID("$NetBSD: cd9660_debug.c,v 1.6 2007/01/28 09:19:33 dogcow Exp $");
|
||||
#endif /* !__lint */
|
||||
|
||||
#if !HAVE_NBTOOL_CONFIG_H
|
||||
|
Loading…
Reference in New Issue
Block a user