home *** CD-ROM | disk | FTP | other *** search
/ ST-Computer Leser-CD 2000 January / LCD_01_2000.iso / games / doom / pmdoom / include / m_swap.h < prev    next >
Encoding:
C/C++ Source or Header  |  1999-12-17  |  1.2 KB  |  41 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. unsigned short    SwapSHORT(unsigned short);
  29. unsigned long    SwapLONG(unsigned long);
  30.  
  31. #ifdef __BIG_ENDIAN__
  32. #define SHORT(x)    ((short)SwapSHORT((unsigned short)x))
  33. #define LONG(x)         ((long)SwapLONG((unsigned long)x))
  34. #else
  35. #define SHORT(x)    (x)
  36. #define LONG(x)         (x)
  37.  
  38. #endif
  39.  
  40. #endif
  41.