home *** CD-ROM | disk | FTP | other *** search
/ RISCWORLD 7 / RISCWORLD_VOL7.iso / Software / Issue6 / SDL.ZIP / !gcc / include / unixlib / string / h / byteswap
Encoding:
Text File  |  2006-09-17  |  1.8 KB  |  51 lines

  1. /****************************************************************************
  2.  *
  3.  * $Source: /usr/local/cvsroot/gccsdk/unixlib/source/clib/string/byteswap.h,v $
  4.  * $Date: 2002/12/22 18:32:47 $
  5.  * $Revision: 1.1 $
  6.  * $State: Exp $
  7.  * $Author: admin $
  8.  *
  9.  ***************************************************************************/
  10.  
  11. /* Copyright (C) 1997 Free Software Foundation, Inc.
  12.    This file is part of the GNU C Library.
  13.  
  14.    The GNU C Library is free software; you can redistribute it and/or
  15.    modify it under the terms of the GNU Lesser General Public
  16.    License as published by the Free Software Foundation; either
  17.    version 2.1 of the License, or (at your option) any later version.
  18.  
  19.    The GNU C Library is distributed in the hope that it will be useful,
  20.    but WITHOUT ANY WARRANTY; without even the implied warranty of
  21.    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  22.    Lesser General Public License for more details.
  23.  
  24.    You should have received a copy of the GNU Lesser General Public
  25.    License along with the GNU C Library; if not, write to the Free
  26.    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
  27.    02111-1307 USA.  */
  28.  
  29. #ifndef __BYTESWAP_H
  30. #define __BYTESWAP_H    1
  31.  
  32. /* Get the machine specific, optimized definitions.  */
  33. #include <bits/byteswap.h>
  34.  
  35.  
  36. /* The following definitions must all be macros since otherwise some
  37.    of the possible optimizations are not possible.  */
  38.  
  39. /* Return a value with all bytes in the 16 bit argument swapped.  */
  40. #define bswap_16(x) __bswap_16 (x)
  41.  
  42. /* Return a value with all bytes in the 32 bit argument swapped.  */
  43. #define bswap_32(x) __bswap_32 (x)
  44.  
  45. #if defined __GNUC__ && __GNUC__ >= 2
  46. /* Return a value with all bytes in the 64 bit argument swapped.  */
  47. # define bswap_64(x) __bswap_64 (x)
  48. #endif
  49.  
  50. #endif /* byteswap.h */
  51.