comparison dmd2/root/port.h @ 1452:638d16625da2

LDC 2 compiles again.
author Robert Clipsham <robert@octarineparrot.com>
date Sat, 30 May 2009 17:23:32 +0100
parents
children
comparison
equal deleted inserted replaced
1423:42bd767ec5a4 1452:638d16625da2
1
2 // Copyright (c) 1999-2009 by Digital Mars
3 // All Rights Reserved
4 // written by Walter Bright
5 // http://www.digitalmars.com
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
22 // According to VC 8.0 docs, long double is the same as double
23 #define strtold strtod
24 #define strtof strtod
25
26 #else
27 typedef long long longlong;
28 typedef unsigned long long ulonglong;
29 #endif
30
31 #endif
32
33 typedef double d_time;
34
35 struct Port
36 {
37 static double nan;
38 static double infinity;
39 static double dbl_max;
40 static double dbl_min;
41 static long double ldbl_max;
42
43 #if __GNUC__
44 // These conflict with macros in math.h, should rename them
45 #undef isnan
46 #undef isfinite
47 #undef isinfinity
48 #undef signbit
49 #endif
50 static int isNan(double);
51 static int isNan(long double);
52
53 static int isSignallingNan(double);
54 static int isSignallingNan(long double);
55
56 static int isFinite(double);
57 static int isInfinity(double);
58 static int Signbit(double);
59
60 static double floor(double);
61 static double pow(double x, double y);
62
63 static ulonglong strtoull(const char *p, char **pend, int base);
64
65 static char *ull_to_string(char *buffer, ulonglong ull);
66 static wchar_t *ull_to_string(wchar_t *buffer, ulonglong ull);
67
68 // Convert ulonglong to double
69 static double ull_to_double(ulonglong ull);
70
71 // Get locale-dependent list separator
72 static const char *list_separator();
73 static const wchar_t *wlist_separator();
74
75 static char *strupr(char *);
76 };
77
78 #endif