os/ossrv/genericopenlibs/cstdlib/LINCMACH/IEEEFP.H
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
     1 /*
     2 * Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
     3 * All rights reserved.
     4 * This component and the accompanying materials are made available
     5 * under the terms of "Eclipse Public License v1.0"
     6 * which accompanies this distribution, and is available
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
     8 *
     9 * Initial Contributors:
    10 * Nokia Corporation - initial contribution.
    11 *
    12 * Contributors:
    13 *
    14 * Description:
    15 *
    16 */
    17 
    18 
    19 
    20 /**
    21  @file
    22  @publishedAll
    23  @released
    24 */
    25 
    26 #ifndef __IEEE_BIG_ENDIAN
    27 #ifndef __IEEE_LITTLE_ENDIAN
    28 
    29 /**
    30 EPOC safety net - Check various EPOC defines to ensure that
    31 we get an appropriate endianness choice
    32 */
    33 #if (defined(__WINS__) || defined(__MX86__) || defined(__X86GCC__)) && !defined(__i386__)
    34 #define __i386__
    35 #elif defined(__MARM__) && !defined(__arm__)
    36 #define __arm__
    37 #endif
    38 
    39 #ifdef __arm__
    40 	#ifdef __EABI__
    41 	/**
    42 	EABI supports the VFP specification, where the ordering of the words
    43 	matches the endianness.
    44 	*/
    45 	#define __IEEE_LITTLE_ENDIAN
    46 #else
    47 	/** 
    48 	Pre-VFP, ARM used the big endian ordering of the words, regardless of
    49 	the endianess. 
    50 	*/
    51 	#define __IEEE_BIG_ENDIAN
    52 	#endif
    53 #endif
    54 
    55 #ifdef __hppa__
    56 
    57 #define __IEEE_BIG_ENDIAN
    58 #endif
    59 
    60 #ifdef __sparc__
    61 
    62 #define __IEEE_BIG_ENDIAN
    63 #endif
    64 
    65 #if defined(__m68k__) || defined(__mc68000__)
    66 
    67 #define __IEEE_BIG_ENDIAN
    68 #endif
    69 
    70 #if defined (__H8300__) || defined (__H8300H__)
    71 
    72 #define __IEEE_BIG_ENDIAN
    73 #define __SMALL_BITFIELDS
    74 #define _DOUBLE_IS_32BITS
    75 #endif
    76 
    77 #ifdef __H8500__
    78 
    79 #define __IEEE_BIG_ENDIAN
    80 #define __SMALL_BITFIELDS
    81 #define _DOUBLE_IS_32BITS
    82 #endif
    83 
    84 #ifdef __sh__
    85 #ifdef __LITTLE_ENDIAN__
    86 
    87 #define __IEEE_LITTLE_ENDIAN
    88 #else
    89 #define __IEEE_BIG_ENDIAN
    90 #endif
    91 #ifdef __SH3E__
    92 
    93 #define _DOUBLE_IS_32BITS
    94 #endif
    95 #endif
    96 
    97 #ifdef _AM29K
    98 
    99 #define __IEEE_BIG_ENDIAN
   100 #endif
   101 
   102 /* Added "&& !defined(__arm__)" to avoid the duplicate definition of the
   103    __ieee_[float|double]_shape_type structures in stdlib\LINC\IEEEFP.h 
   104    conditionally compiled using the __IEEE_LITTLE_ENDIAN && __IEEE_BIG_ENDIAN 
   105    in GCCXML builds. This is a work around as we can't get gccxml to stop 
   106    defining __i386__ as it's defined in the "<built-in>" header file of the 
   107    compiler.
   108 */
   109 #if defined(__i386__) && !defined(__arm__)
   110 
   111 #define __IEEE_LITTLE_ENDIAN
   112 #endif
   113 
   114 #ifdef __i960__
   115 
   116 #define __IEEE_LITTLE_ENDIAN
   117 #endif
   118 
   119 #ifdef __MIPSEL__
   120 
   121 #define __IEEE_LITTLE_ENDIAN
   122 #endif
   123 #ifdef __MIPSEB__
   124 
   125 #define __IEEE_BIG_ENDIAN
   126 #endif
   127 
   128 /**
   129 necv70 was __IEEE_LITTLE_ENDIAN. 
   130 */
   131 
   132 #ifdef __W65__
   133 
   134 #define __IEEE_LITTLE_ENDIAN
   135 #define __SMALL_BITFIELDS
   136 #define _DOUBLE_IS_32BITS
   137 #endif
   138 
   139 #if defined(__Z8001__) || defined(__Z8002__)
   140 
   141 #define __IEEE_BIG_ENDIAN
   142 #endif
   143 
   144 #ifdef __m88k__
   145 
   146 #define __IEEE_BIG_ENDIAN
   147 #endif
   148 
   149 #ifdef __v800
   150 
   151 #define __IEEE_LITTLE_ENDIAN
   152 #endif
   153 
   154 #ifdef __PPC__
   155 #ifdef _BIG_ENDIAN
   156 
   157 #define __IEEE_BIG_ENDIAN
   158 #else
   159 
   160 #define __IEEE_LITTLE_ENDIAN
   161 #endif
   162 #endif
   163 
   164 #ifdef __mcore__
   165 
   166 #define __IEEE_LITTLE_ENDIAN	/* always little-endian M*Core for EPOC */
   167 #endif
   168 
   169 #ifndef __IEEE_BIG_ENDIAN
   170 #ifndef __IEEE_LITTLE_ENDIAN
   171 #error Endianess not declared!!
   172 #endif /* not __IEEE_LITTLE_ENDIAN */
   173 #endif /* not __IEEE_BIG_ENDIAN */
   174 
   175 #endif /* not __IEEE_LITTLE_ENDIAN */
   176 #endif /* not __IEEE_BIG_ENDIAN */
   177