home *** CD-ROM | disk | FTP | other *** search
/ ST-Computer Leser-CD 2000 January / LCD_01_2000.iso / games / doom / sndserv / include / m_swap.h next >
Encoding:
C/C++ Source or Header  |  1999-08-16  |  1.2 KB  |  42 lines

  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. */
  11. /*  */
  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. */
  16. /*  */
  17. /*  DESCRIPTION: */
  18. /*     Endianess handling, swapping 16bit and 32bit. */
  19. /*  */
  20. /* ----------------------------------------------------------------------------- */
  21.  
  22. #ifndef __M_SWAP__
  23. #define __M_SWAP__
  24.  
  25. /*  Endianess handling. */
  26. /*  WAD files are stored little endian. */
  27.  
  28. #ifdef __BIG_ENDIAN__
  29. unsigned short    SwapSHORT(unsigned short);
  30. unsigned long    SwapLONG(unsigned long);
  31. #define SHORT(x)    ((short)SwapSHORT((unsigned short)x))
  32. #define LONG(x)         ((long)SwapLONG((unsigned long)x))
  33.  
  34. #else
  35.  
  36. #define SHORT(x)    (x)
  37. #define LONG(x)         (x)
  38.  
  39. #endif
  40.  
  41. #endif
  42.