Mercurial > projects > ldc
annotate dmd/root/port.h @ 1195:e961851fb8be
Merged DMD 1.042.
author | Tomas Lindquist Olsen <tomas.l.olsen gmail.com> |
---|---|
date | Fri, 03 Apr 2009 17:59:34 +0200 |
parents | 1853dcd9b944 |
children | 8026319762be |
rev | line source |
---|---|
1 | 1 |
1195
e961851fb8be
Merged DMD 1.042.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1194
diff
changeset
|
2 // Copyright (c) 1999-2009 by Digital Mars |
1 | 3 // All Rights Reserved |
4 // written by Walter Bright | |
1195
e961851fb8be
Merged DMD 1.042.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1194
diff
changeset
|
5 // http://www.digitalmars.com |
1 | 6 |
7 #ifndef PORT_H | |
8 #define PORT_H | |
9 | |
10 // Portable wrapper around compiler/system specific things. | |
11 // The idea is to minimize #ifdef's in the app code. | |
12 | |
13 #ifndef TYPEDEFS | |
14 #define TYPEDEFS | |
15 | |
16 #include <wchar.h> | |
17 | |
18 #if _MSC_VER | |
19 typedef __int64 longlong; | |
20 typedef unsigned __int64 ulonglong; | |
21 #else | |
22 typedef long long longlong; | |
23 typedef unsigned long long ulonglong; | |
24 #endif | |
25 | |
26 #endif | |
27 | |
28 typedef double d_time; | |
29 | |
30 struct Port | |
31 { | |
32 static double nan; | |
33 static double infinity; | |
34 static double dbl_max; | |
35 static double dbl_min; | |
36 | |
37 #if __GNUC__ | |
38 // These conflict with macros in math.h, should rename them | |
39 #undef isnan | |
40 #undef isfinite | |
41 #undef isinfinity | |
42 #undef signbit | |
43 #endif | |
44 static int isNan(double); | |
1195
e961851fb8be
Merged DMD 1.042.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1194
diff
changeset
|
45 static int isNan(long double); |
e961851fb8be
Merged DMD 1.042.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1194
diff
changeset
|
46 |
e961851fb8be
Merged DMD 1.042.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1194
diff
changeset
|
47 static int isSignallingNan(double); |
e961851fb8be
Merged DMD 1.042.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1194
diff
changeset
|
48 static int isSignallingNan(long double); |
e961851fb8be
Merged DMD 1.042.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1194
diff
changeset
|
49 |
1 | 50 static int isFinite(double); |
51 static int isInfinity(double); | |
52 static int Signbit(double); | |
53 | |
54 static double floor(double); | |
55 static double pow(double x, double y); | |
56 | |
57 static ulonglong strtoull(const char *p, char **pend, int base); | |
58 | |
59 static char *ull_to_string(char *buffer, ulonglong ull); | |
60 static wchar_t *ull_to_string(wchar_t *buffer, ulonglong ull); | |
61 | |
62 // Convert ulonglong to double | |
63 static double ull_to_double(ulonglong ull); | |
64 | |
65 // Get locale-dependent list separator | |
1195
e961851fb8be
Merged DMD 1.042.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1194
diff
changeset
|
66 static const char *list_separator(); |
e961851fb8be
Merged DMD 1.042.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1194
diff
changeset
|
67 static const wchar_t *wlist_separator(); |
e961851fb8be
Merged DMD 1.042.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1194
diff
changeset
|
68 |
e961851fb8be
Merged DMD 1.042.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1194
diff
changeset
|
69 static char *strupr(char *); |
1 | 70 }; |
71 | |
72 #endif |