Path: blob/main/emulators/darcnes/files/endian.h
16462 views
#ifndef __HAD_MY_ENDIAN_H1#define __HAD_MY_ENDIAN_H23#include <sys/param.h>45#if (defined(BSD) && (BSD >= 199306))6/* this should filter out NetBSD, FreeBSD and OpenBSD */7#include <machine/endian.h>89#if BYTE_ORDER == BIG_ENDIAN10#define MSB_FIRST 111#undef LSB_FIRST12#else13#define LSB_FIRST 114#undef MSB_FIRST15#endif1617#else18/* for Linux, perhaps use #ifdef __linux__? */19#include <sys/types.h>2021#if defined(__BYTE_ORDER)22#if __BYTE_ORDER == __BIG_ENDIAN23#define MSB_FIRST 124#undef LSB_FIRST25#else26#define LSB_FIRST 127#undef MSB_FIRST28#endif /* __BYTE_ORDER == __BIG_ENDIAN */2930#else /* defined(__BYTE_ORDER) */3132/* not Linux, either, just set it to LSB */33#define LSB_FIRST 134#undef MSB_FIRST3536#endif /* defined(__BYTE_ORDER) */3738#endif /* defined(BSD) && (BSD >= 199306) */3940#endif /* __HAD_MY_ENDIAN_H */414243