Skip to content
Snippets Groups Projects
Commit 917d24aa authored by deuce's avatar deuce
Browse files

Added cpuwrap.h for big endian processors byte-swapping macros.

More OS/X mods.
parent 836b92da
No related branches found
No related tags found
No related merge requests found
#ifdef __BIG_ENDIAN__
#define htols(hval) ((((ushort)(hval) & 0xff00)>>8)|(((ushort)(hval) & 0x00ff)<<8))
#define ltohs(lval) ((((ushort)(lval) & 0xff00)>>8)|(((ushort)(lval) & 0x00ff)<<8))
#define htoll(hval) ((((ulong)(hval) & 0xff000000)>>24)|(((ulong)(hval) & 0x00ff0000)>>8)|(((ulong)(hval) & 0x0000ff00)<<8)|(((ulong)(hval) & 0x000000ff)<<24))
#define ltohl(lval) ((((ulong)(lval) & 0xff000000)>>24)|(((ulong)(lval) & 0x00ff0000)>>8)|(((ulong)(lval) & 0x0000ff00)<<8)|(((ulong)(lval) & 0x000000ff)<<24))
#else
#define htols(x) (x)
#define ltohs(x) (x)
#define htoll(x) (x)
#define ltohl(x) (x)
#endif
......@@ -142,6 +142,7 @@ void DLLCALL unix_beep(int freq, int dur)
{
static int console_fd=-1;
#if !defined(__OpenBSD__) && !defined(__GNU__) && !defined(__NetBSD__) && !defined(__QNX__)
#if defined(__OpenBSD__) || defined(__FreeBSD__) || defined(__NetBSD__)
int speaker_fd=-1;
tone_t tone;
......@@ -175,6 +176,7 @@ void DLLCALL unix_beep(int freq, int dur)
#endif /* solaris */
}
#endif
#endif /* Nasty Kludge */
}
#endif
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment