~mingw-w64/mingw-w64/experimental

« back to all changes in this revision

Viewing changes to ros-privexp/mingw-w64-crt/gdtoa/gdtoa.h

  • Committer: NightStrike
  • Date: 2010-08-11 22:20:57 UTC
  • Revision ID: svn-v4:4407c894-4637-0410-b4f5-ada5f102cad1:experimental:3266
Branch for adding option for supporting ros

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/****************************************************************
 
2
 
 
3
The author of this software is David M. Gay.
 
4
 
 
5
Copyright (C) 1998 by Lucent Technologies
 
6
All Rights Reserved
 
7
 
 
8
Permission to use, copy, modify, and distribute this software and
 
9
its documentation for any purpose and without fee is hereby
 
10
granted, provided that the above copyright notice appear in all
 
11
copies and that both that the copyright notice and this
 
12
permission notice and warranty disclaimer appear in supporting
 
13
documentation, and that the name of Lucent or any of its entities
 
14
not be used in advertising or publicity pertaining to
 
15
distribution of the software without specific, written prior
 
16
permission.
 
17
 
 
18
LUCENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
 
19
INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS.
 
20
IN NO EVENT SHALL LUCENT OR ANY OF ITS ENTITIES BE LIABLE FOR ANY
 
21
SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
 
22
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER
 
23
IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
 
24
ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
 
25
THIS SOFTWARE.
 
26
 
 
27
****************************************************************/
 
28
 
 
29
/* Please send bug reports to David M. Gay (dmg at acm dot org,
 
30
 * with " at " changed at "@" and " dot " changed to ".").      */
 
31
 
 
32
/* Modified by Danny Smith for inclusion in libmingwex.a
 
33
   Aug 2006  */
 
34
 
 
35
#ifndef GDTOA_H_INCLUDED
 
36
#define GDTOA_H_INCLUDED
 
37
 
 
38
#include "gd_arith.h"
 
39
#include <stddef.h> /* for size_t */
 
40
 
 
41
#if defined(__MINGW32__) || defined(__MINGW64__)
 
42
/* keep the 'Long' definition as 'long' for compatibility
 
43
 * with older/other software. long in w64 is 32 bits anyway..
 
44
 */
 
45
#define Long long       /* int */
 
46
#undef  NO_LONG_LONG    /* we have long long type */
 
47
#endif  /* MinGW */
 
48
 
 
49
#ifndef Long
 
50
#define Long long
 
51
#endif
 
52
#ifndef ULong
 
53
typedef unsigned Long ULong;
 
54
#endif
 
55
#ifndef UShort
 
56
typedef unsigned short UShort;
 
57
#endif
 
58
 
 
59
enum {  /* return values from strtodg */
 
60
        STRTOG_Zero     = 0,
 
61
        STRTOG_Normal   = 1,
 
62
        STRTOG_Denormal = 2,
 
63
        STRTOG_Infinite = 3,
 
64
        STRTOG_NaN      = 4,
 
65
        STRTOG_NaNbits  = 5,
 
66
        STRTOG_NoNumber = 6,
 
67
        STRTOG_Retmask  = 7,
 
68
 
 
69
        /* The following may be or-ed into one of the above values. */
 
70
 
 
71
        STRTOG_Neg      = 0x08, /* does not affect STRTOG_Inexlo or STRTOG_Inexhi */
 
72
        STRTOG_Inexlo   = 0x10, /* returned result rounded toward zero */
 
73
        STRTOG_Inexhi   = 0x20, /* returned result rounded away from zero */
 
74
        STRTOG_Inexact  = 0x30,
 
75
        STRTOG_Underflow= 0x40,
 
76
        STRTOG_Overflow = 0x80
 
77
};
 
78
 
 
79
typedef struct
 
80
FPI {
 
81
        int nbits;
 
82
        int emin;
 
83
        int emax;
 
84
        int rounding;
 
85
        int sudden_underflow;
 
86
} FPI;
 
87
 
 
88
enum {  /* FPI.rounding values: same as FLT_ROUNDS */
 
89
        FPI_Round_zero = 0,
 
90
        FPI_Round_near = 1,
 
91
        FPI_Round_up = 2,
 
92
        FPI_Round_down = 3
 
93
};
 
94
 
 
95
#ifdef __cplusplus
 
96
extern "C" {
 
97
#endif
 
98
 
 
99
extern char* __dtoa (double d, int mode, int ndigits, int *decpt,
 
100
                     int *sign, char **rve);
 
101
extern char* __gdtoa (FPI *fpi, int be, ULong *bits, int *kindp,
 
102
                     int mode, int ndigits, int *decpt, char **rve);
 
103
extern void __freedtoa (char *);
 
104
 
 
105
extern float  __strtof (const char *, char **);
 
106
extern double __strtod (const char *, char **);
 
107
extern long double __strtold (const char *, char **);
 
108
extern int __strtodg (const char *, char **, FPI *, Long *, ULong *);
 
109
 
 
110
extern char*    __g__fmt   (char*, char*, char*, int, ULong, size_t);
 
111
extern char*    __g_dfmt   (char*, double*, int, size_t);
 
112
extern char*    __g_ffmt   (char*, float*,  int, size_t);
 
113
extern char*    __g_xfmt   (char*, void*,   int, size_t);
 
114
 
 
115
#ifdef __cplusplus
 
116
}
 
117
#endif
 
118
#endif /* GDTOA_H_INCLUDED */