home *** CD-ROM | disk | FTP | other *** search
/ linuxmafia.com 2016 / linuxmafia.com.tar / linuxmafia.com / pub / linux / backup / star-1.3.1.tar.gz / star-1.3.1.tar / star-1.3.1 / include / btorder.h next >
C/C++ Source or Header  |  2001-02-17  |  2KB  |  89 lines

  1. /* @(#)btorder.h    1.13 01/02/17 Copyright 1996 J. Schilling */
  2. /*
  3.  *    Definitions for Bitordering
  4.  *
  5.  *    Copyright (c) 1996 J. Schilling
  6.  */
  7. /*
  8.  * This program is free software; you can redistribute it and/or modify
  9.  * it under the terms of the GNU General Public License as published by
  10.  * the Free Software Foundation; either version 2, or (at your option)
  11.  * any later version.
  12.  *
  13.  * This program is distributed in the hope that it will be useful,
  14.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  16.  * GNU General Public License for more details.
  17.  *
  18.  * You should have received a copy of the GNU General Public License
  19.  * along with this program; see the file COPYING.  If not, write to
  20.  * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
  21.  */
  22.  
  23.  
  24. #ifndef    _BTORDER_H
  25. #define    _BTORDER_H
  26.  
  27. #ifndef    _INCL_SYS_TYPES_H
  28. #include <sys/types.h>            /* try to load isa_defs.h on Solaris */
  29. #define    _INCL_SYS_TYPES_H
  30. #endif
  31.  
  32. #ifndef _MCONFIG_H
  33. #include <mconfig.h>
  34. #endif
  35.  
  36. #if defined(HAVE_C_BITFIELDS)    && \
  37.     defined(BITFIELDS_LTOH)        /* Use definition from xconfig.h */
  38. #define    _BIT_FIELDS_LTOH
  39. #endif
  40.  
  41. #if defined(HAVE_C_BITFIELDS)    && \
  42.     defined(BITFIELDS_HTOL)        /* Use definition from xconfig.h */
  43. #define    _BIT_FIELDS_HTOL
  44. #endif
  45.  
  46. #if defined(HAVE_C_BITFIELDS)    && \
  47.    !defined(BITFIELDS_HTOL)        /* Use definition from xconfig.h */
  48. #define    BITFIELDS_LTOH
  49. #define    _BIT_FIELDS_LTOH
  50. #endif
  51.  
  52.  
  53. #if    defined(_BIT_FIELDS_LTOH) || defined(_BIT_FIELDS_HTOL)
  54. /*
  55.  * Bitorder is already known.
  56.  */
  57. #else
  58. /*
  59.  * Bitorder not yet known.
  60.  */
  61. #    if defined(sun3) || defined(mc68000) || \
  62.        defined(sun4) || defined(__sparc) || defined(sparc) || \
  63.        defined(__hppa) || defined(_ARCH_PPC) || defined(_IBMR2)
  64. #        define _BIT_FIELDS_HTOL
  65. #    endif
  66.  
  67. #    if defined(__sgi) && defined(__mips)
  68. #        define _BIT_FIELDS_HTOL
  69. #    endif
  70.  
  71. #    if defined(__i386__) || defined(__i386) || defined(i386) || \
  72.        defined(__alpha__) || defined(__alpha) || defined(alpha) || \
  73.        defined(__arm__) || defined(__arm) || defined(arm)
  74. #        define _BIT_FIELDS_LTOH
  75. #    endif
  76.  
  77. #    if defined(__ppc__) || defined(ppc) || defined(__ppc) || \
  78.        defined(__PPC) || defined(powerpc) || defined(__powerpc__)
  79.  
  80. #        if    defined(__BIG_ENDIAN__)
  81. #            define _BIT_FIELDS_HTOL
  82. #        else
  83. #            define _BIT_FIELDS_LTOH
  84. #        endif
  85. #    endif
  86. #endif
  87.  
  88. #endif    /* _BTORDER_H */
  89.