freebsd-ports/emulators/darcnes/files/endian.h
Kirill Ponomarev 245be80d76 - Fix build on non-i386 arch
- Add option to support Gtk/SVGAlib GUI
- Support NOPORTDOCS
- Fix WWW: line

PR:		ports/62262
Submitted by:	Ports Fury
2004-02-02 15:48:45 +00:00

41 lines
807 B
C

#ifndef __HAD_MY_ENDIAN_H
#define __HAD_MY_ENDIAN_H
#include <sys/param.h>
#if (defined(BSD) && (BSD >= 199306))
/* this should filter out NetBSD, FreeBSD and OpenBSD */
#include <machine/endian.h>
#if BYTE_ORDER == BIG_ENDIAN
#define MSB_FIRST 1
#undef LSB_FIRST
#else
#define LSB_FIRST 1
#undef MSB_FIRST
#endif
#else
/* for Linux, perhaps use #ifdef __linux__? */
#include <sys/types.h>
#if defined(__BYTE_ORDER)
#if __BYTE_ORDER == __BIG_ENDIAN
#define MSB_FIRST 1
#undef LSB_FIRST
#else
#define LSB_FIRST 1
#undef MSB_FIRST
#endif /* __BYTE_ORDER == __BIG_ENDIAN */
#else /* defined(__BYTE_ORDER) */
/* not Linux, either, just set it to LSB */
#define LSB_FIRST 1
#undef MSB_FIRST
#endif /* defined(__BYTE_ORDER) */
#endif /* defined(BSD) && (BSD >= 199306) */
#endif /* __HAD_MY_ENDIAN_H */