OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2007-2008 the V8 project authors. All rights reserved. | 2 * Copyright 2007-2008 the V8 project authors. All rights reserved. |
3 * Redistribution and use in source and binary forms, with or without | 3 * Redistribution and use in source and binary forms, with or without |
4 * modification, are permitted provided that the following conditions are | 4 * modification, are permitted provided that the following conditions are |
5 * met: | 5 * met: |
6 * | 6 * |
7 * * Redistributions of source code must retain the above copyright | 7 * * Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * * Redistributions in binary form must reproduce the above | 9 * * Redistributions in binary form must reproduce the above |
10 * copyright notice, this list of conditions and the following | 10 * copyright notice, this list of conditions and the following |
(...skipping 20 matching lines...) Expand all Loading... |
31 * Dtoa needs to have a particular environment set up for it so | 31 * Dtoa needs to have a particular environment set up for it so |
32 * instead of using it directly you should use this file. | 32 * instead of using it directly you should use this file. |
33 * | 33 * |
34 * The way it works is that when you link with it, its definitions | 34 * The way it works is that when you link with it, its definitions |
35 * of dtoa, strtod etc. override the default ones. So if you fail | 35 * of dtoa, strtod etc. override the default ones. So if you fail |
36 * to link with this library everything will still work, it's just | 36 * to link with this library everything will still work, it's just |
37 * subtly wrong. | 37 * subtly wrong. |
38 */ | 38 */ |
39 | 39 |
40 #if !(defined(__APPLE__) && defined(__MACH__)) && \ | 40 #if !(defined(__APPLE__) && defined(__MACH__)) && \ |
41 !defined(WIN32) && !defined(__FreeBSD__) | 41 !defined(WIN32) && !defined(__FreeBSD__) && !defined(__OpenBSD__) |
42 #include <endian.h> | 42 #include <endian.h> |
43 #endif | 43 #endif |
44 #include <math.h> | 44 #include <math.h> |
45 #include <float.h> | 45 #include <float.h> |
46 | 46 |
47 /* The floating point word order on ARM is big endian when floating point | 47 /* The floating point word order on ARM is big endian when floating point |
48 * emulation is used, even if the byte order is little endian */ | 48 * emulation is used, even if the byte order is little endian */ |
49 #if !(defined(__APPLE__) && defined(__MACH__)) && !defined(WIN32) && \ | 49 #if !(defined(__APPLE__) && defined(__MACH__)) && !defined(WIN32) && \ |
50 !defined(__FreeBSD__) && __FLOAT_WORD_ORDER == __BIG_ENDIAN | 50 !defined(__FreeBSD__) && !defined(__OpenBSD__) && \ |
| 51 __FLOAT_WORD_ORDER == __BIG_ENDIAN |
51 #define IEEE_MC68k | 52 #define IEEE_MC68k |
52 #else | 53 #else |
53 #define IEEE_8087 | 54 #define IEEE_8087 |
54 #endif | 55 #endif |
55 | 56 |
56 #define __MATH_H__ | 57 #define __MATH_H__ |
57 #if defined(__APPLE__) && defined(__MACH__) || defined(__FreeBSD__) | 58 #if defined(__APPLE__) && defined(__MACH__) || defined(__FreeBSD__) || \ |
| 59 defined(__OpenBSD__) |
58 /* stdlib.h on FreeBSD and Apple's 10.5 and later SDKs will mangle the | 60 /* stdlib.h on FreeBSD and Apple's 10.5 and later SDKs will mangle the |
59 * name of strtod. If it's included after strtod is redefined as | 61 * name of strtod. If it's included after strtod is redefined as |
60 * gay_strtod, it will mangle the name of gay_strtod, which is | 62 * gay_strtod, it will mangle the name of gay_strtod, which is |
61 * unwanted. */ | 63 * unwanted. */ |
62 #include <stdlib.h> | 64 #include <stdlib.h> |
63 | 65 |
64 #endif | 66 #endif |
65 /* stdlib.h on Windows adds __declspec(dllimport) to all functions when using | 67 /* stdlib.h on Windows adds __declspec(dllimport) to all functions when using |
66 * the DLL version of the CRT (compiling with /MD or /MDd). If stdlib.h is | 68 * the DLL version of the CRT (compiling with /MD or /MDd). If stdlib.h is |
67 * included after strtod is redefined as gay_strtod, it will add | 69 * included after strtod is redefined as gay_strtod, it will add |
(...skipping 12 matching lines...) Expand all Loading... |
80 /* On 64-bit systems, we need to make sure that a Long is only 32 bits. */ | 82 /* On 64-bit systems, we need to make sure that a Long is only 32 bits. */ |
81 #ifdef V8_TARGET_ARCH_X64 | 83 #ifdef V8_TARGET_ARCH_X64 |
82 #define Long int | 84 #define Long int |
83 #endif /* V8_TARGET_ARCH_X64 */ | 85 #endif /* V8_TARGET_ARCH_X64 */ |
84 | 86 |
85 /* Make sure we use the David M. Gay version of strtod(). On Linux, we | 87 /* Make sure we use the David M. Gay version of strtod(). On Linux, we |
86 * cannot use the same name (maybe the function does not have weak | 88 * cannot use the same name (maybe the function does not have weak |
87 * linkage?). */ | 89 * linkage?). */ |
88 #define strtod gay_strtod | 90 #define strtod gay_strtod |
89 #include "third_party/dtoa/dtoa.c" | 91 #include "third_party/dtoa/dtoa.c" |
OLD | NEW |