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