00001 /* 00002 * Copyright 2007-2008 the V8 project authors. All rights reserved. 00003 * Redistribution and use in source and binary forms, with or without 00004 * modification, are permitted provided that the following conditions are 00005 * met: 00006 * 00007 * * Redistributions of source code must retain the above copyright 00008 * notice, this list of conditions and the following disclaimer. 00009 * * Redistributions in binary form must reproduce the above 00010 * copyright notice, this list of conditions and the following 00011 * disclaimer in the documentation and/or other materials provided 00012 * with the distribution. 00013 * * Neither the name of Google Inc. nor the names of its 00014 * contributors may be used to endorse or promote products derived 00015 * from this software without specific prior written permission. 00016 * 00017 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 00018 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 00019 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 00020 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 00021 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 00022 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 00023 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 00024 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 00025 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 00026 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 00027 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 00028 */ 00029 00040 #if !(defined(__APPLE__) && defined(__MACH__)) && !defined(WIN32) 00041 #include <endian.h> 00042 #endif 00043 #include <math.h> 00044 #include <float.h> 00045 00046 /* The floating point word order on ARM is big endian when floating point 00047 * emulation is used, even if the byte order is little endian */ 00048 #if !(defined(__APPLE__) && defined(__MACH__)) && !defined(WIN32) && \ 00049 __FLOAT_WORD_ORDER == __BIG_ENDIAN 00050 #define IEEE_MC68k 00051 #else 00052 #define IEEE_8087 00053 #endif 00054 00055 #define __MATH_H__ 00056 #if defined(__APPLE__) && defined(__MACH__) 00057 /* stdlib.h on Apple's 10.5 and later SDKs will mangle the name of strtod. 00058 * If it's included after strtod is redefined as gay_strtod, it will mangle 00059 * the name of gay_strtod, which is unwanted. */ 00060 #include <stdlib.h> 00061 #endif 00062 /* Make sure we use the David M. Gay version of strtod(). On Linux, we 00063 * cannot use the same name (maybe the function does not have weak 00064 * linkage?). */ 00065 #define strtod gay_strtod 00066 #include "third_party/dtoa/dtoa.c"