Subversion Repositories Kolibri OS

Rev

Blame | Last modification | View Log | Download | RSS feed

  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.  
  23. #ifndef __M_SWAP__
  24. #define __M_SWAP__
  25.  
  26.  
  27. #ifdef __GNUG__
  28. #pragma interface
  29. #endif
  30.  
  31.  
  32. // Endianess handling.
  33. // WAD files are stored little endian.
  34. #ifdef __BIG_ENDIAN__
  35. short   SwapSHORT(short);
  36. long    SwapLONG(long);
  37. #define SHORT(x)        ((short)SwapSHORT((unsigned short) (x)))
  38. #define LONG(x)         ((long)SwapLONG((unsigned long) (x)))
  39. #else
  40. #define SHORT(x)        (x)
  41. #define LONG(x)         (x)
  42. #endif
  43.  
  44.  
  45.  
  46.  
  47. #endif
  48. //-----------------------------------------------------------------------------
  49. //
  50. // $Log:$
  51. //
  52. //-----------------------------------------------------------------------------
  53.