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 19 matching lines...) Expand all Loading... |
30 /** | 30 /** |
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__)) && !defined(WIN32) | 40 #if !(defined(__APPLE__) && defined(__MACH__)) && \ |
| 41 !defined(WIN32) && !defined(__FreeBSD__) |
41 #include <endian.h> | 42 #include <endian.h> |
42 #endif | 43 #endif |
43 #include <math.h> | 44 #include <math.h> |
44 #include <float.h> | 45 #include <float.h> |
45 | 46 |
46 /* 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 |
47 * emulation is used, even if the byte order is little endian */ | 48 * emulation is used, even if the byte order is little endian */ |
48 #if !(defined(__APPLE__) && defined(__MACH__)) && !defined(WIN32) && \ | 49 #if !(defined(__APPLE__) && defined(__MACH__)) && !defined(WIN32) && \ |
49 __FLOAT_WORD_ORDER == __BIG_ENDIAN | 50 !defined(__FreeBSD__) && __FLOAT_WORD_ORDER == __BIG_ENDIAN |
50 #define IEEE_MC68k | 51 #define IEEE_MC68k |
51 #else | 52 #else |
52 #define IEEE_8087 | 53 #define IEEE_8087 |
53 #endif | 54 #endif |
54 | 55 |
55 #define __MATH_H__ | 56 #define __MATH_H__ |
56 #if defined(__APPLE__) && defined(__MACH__) | 57 #if defined(__APPLE__) && defined(__MACH__) || defined(__FreeBSD__) |
57 /* stdlib.h on Apple's 10.5 and later SDKs will mangle the name of strtod. | 58 /* stdlib.h on FreeBSD and Apple's 10.5 and later SDKs will mangle the |
58 * If it's included after strtod is redefined as gay_strtod, it will mangle | 59 * name of strtod. If it's included after strtod is redefined as |
59 * the name of gay_strtod, which is unwanted. */ | 60 * gay_strtod, it will mangle the name of gay_strtod, which is |
| 61 * unwanted. */ |
60 #include <stdlib.h> | 62 #include <stdlib.h> |
61 #endif | 63 #endif |
62 /* Make sure we use the David M. Gay version of strtod(). On Linux, we | 64 /* Make sure we use the David M. Gay version of strtod(). On Linux, we |
63 * cannot use the same name (maybe the function does not have weak | 65 * cannot use the same name (maybe the function does not have weak |
64 * linkage?). */ | 66 * linkage?). */ |
65 #define strtod gay_strtod | 67 #define strtod gay_strtod |
66 #include "third_party/dtoa/dtoa.c" | 68 #include "third_party/dtoa/dtoa.c" |
OLD | NEW |