# Correct the needed linklibs in curl-config also.
[AROS-Contrib.git] / Games / Doom / m_swap.c
blob4a395c30e646095a4fdc06c23625d0da9b0f2799
1 // Emacs style mode select -*- C++ -*-
2 //-----------------------------------------------------------------------------
3 //
4 // $Id$
5 //
6 // Copyright (C) 1993-1996 by id Software, Inc.
7 //
8 // This source is available for distribution and/or modification
9 // only under the terms of the DOOM Source Code License as
10 // published by id Software. All rights reserved.
12 // The source is distributed in the hope that it will be useful,
13 // but WITHOUT ANY WARRANTY; without even the implied warranty of
14 // FITNESS FOR A PARTICULAR PURPOSE. See the DOOM Source Code License
15 // for more details.
17 // $Log$
18 // Revision 1.1 2000/02/29 18:21:04 stegerg
19 // Doom port based on ADoomPPC. Read README.AROS!
22 // DESCRIPTION:
23 // Endianess handling, swapping 16bit and 32bit.
25 //-----------------------------------------------------------------------------
27 static const char
28 rcsid[] = "$Id$";
31 #ifdef __GNUG__
32 #pragma implementation "m_swap.h"
33 #endif
34 #include "m_swap.h"
37 // Needed with big endian.
38 #ifdef __BIG_ENDIAN__
40 // Swap 16bit, that is, MSB and LSB byte.
41 unsigned short SwapSHORT(unsigned short x)
43 // No masking with 0xFF should be necessary.
44 return (unsigned short)((x>>8) | (x<<8));
47 // Swapping 32bit.
48 unsigned long SwapLONG( unsigned long x)
50 return
51 (x>>24)
52 | ((x>>8) & 0xff00)
53 | ((x<<8) & 0xff0000)
54 | (x<<24);
58 #endif