Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:14:31

0001 #ifndef _XARCH_H_
0002 # define _XARCH_H_
0003 
0004 /*
0005  * Copyright 1997 Metro Link Incorporated
0006  *
0007  *                           All Rights Reserved
0008  *
0009  * Permission to use, copy, modify, distribute, and sell this software and its
0010  * documentation for any purpose is hereby granted without fee, provided that
0011  * the above copyright notice appear in all copies and that both that
0012  * copyright notice and this permission notice appear in supporting
0013  * documentation, and that the names of the above listed copyright holder(s)
0014  * not be used in advertising or publicity pertaining to distribution of
0015  * the software without specific, written prior permission.  The above listed
0016  * copyright holder(s) make(s) no representations about the suitability of
0017  * this software for any purpose.  It is provided "as is" without express or
0018  * implied warranty.
0019  *
0020  * THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM(S) ALL WARRANTIES WITH REGARD
0021  * TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
0022  * AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE
0023  * LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY
0024  * DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER
0025  * IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
0026  * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
0027  */
0028 
0029 
0030 /*
0031  * Determine the machine's byte order.
0032  */
0033 
0034 /* See if it is set in the imake config first */
0035 # ifdef X_BYTE_ORDER
0036 
0037 #  define X_BIG_ENDIAN 4321
0038 #  define X_LITTLE_ENDIAN 1234
0039 
0040 # else
0041 
0042 #  if defined(SVR4) || defined(__SVR4)
0043 #   include <sys/types.h>
0044 #   include <sys/byteorder.h>
0045 #  elif defined(CSRG_BASED)
0046 #   if defined(__NetBSD__) || defined(__OpenBSD__)
0047 #    include <sys/types.h>
0048 #   endif
0049 #   include <machine/endian.h>
0050 #  elif defined(linux)
0051 #   if defined __STRICT_ANSI__
0052 #    undef __STRICT_ANSI__
0053 #    include <endian.h>
0054 #    define __STRICT_ANSI__
0055 #   else
0056 #    include <endian.h>
0057 #   endif
0058 /* 'endian.h' might have been included before 'Xarch.h' */
0059 #   if !defined(LITTLE_ENDIAN) && defined(__LITTLE_ENDIAN)
0060 #    define LITTLE_ENDIAN __LITTLE_ENDIAN
0061 #   endif
0062 #   if !defined(BIG_ENDIAN) && defined(__BIG_ENDIAN)
0063 #    define BIG_ENDIAN __BIG_ENDIAN
0064 #   endif
0065 #   if !defined(PDP_ENDIAN) && defined(__PDP_ENDIAN)
0066 #    define PDP_ENDIAN __PDP_ENDIAN
0067 #   endif
0068 #   if !defined(BYTE_ORDER) && defined(__BYTE_ORDER)
0069 #    define BYTE_ORDER __BYTE_ORDER
0070 #   endif
0071 #  endif
0072 
0073 #  ifndef BYTE_ORDER
0074 #   define LITTLE_ENDIAN 1234
0075 #   define BIG_ENDIAN    4321
0076 
0077 #   if defined(__sun) && defined(__SVR4)
0078 #    include <sys/isa_defs.h>
0079 #    ifdef _LITTLE_ENDIAN
0080 #     define BYTE_ORDER LITTLE_ENDIAN
0081 #    endif
0082 #    ifdef _BIG_ENDIAN
0083 #     define BYTE_ORDER BIG_ENDIAN
0084 #    endif
0085 #   endif /* sun */
0086 #  endif /* BYTE_ORDER */
0087 
0088 #  define X_BYTE_ORDER BYTE_ORDER
0089 #  define X_BIG_ENDIAN BIG_ENDIAN
0090 #  define X_LITTLE_ENDIAN LITTLE_ENDIAN
0091 
0092 # endif /* not in imake config */
0093 
0094 #endif /* _XARCH_H_ */