Annotation of sbbs/javascript/include/mozilla/js/jslibmath.h, revision 1.1.1.1

1.1       root        1: /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
                      2:  *
                      3:  * The contents of this file are subject to the Netscape Public
                      4:  * License Version 1.1 (the "License"); you may not use this file
                      5:  * except in compliance with the License. You may obtain a copy of
                      6:  * the License at http://www.mozilla.org/NPL/
                      7:  *
                      8:  * Software distributed under the License is distributed on an "AS
                      9:  * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
                     10:  * implied. See the License for the specific language governing
                     11:  * rights and limitations under the License.
                     12:  *
                     13:  * The Original Code is Mozilla Communicator client code, released
                     14:  * March 31, 1998.
                     15:  *
                     16:  * The Initial Developer of the Original Code is Netscape
                     17:  * Communications Corporation.  Portions created by Netscape are
                     18:  * Copyright (C) 1998 Netscape Communications Corporation. All
                     19:  * Rights Reserved.
                     20:  *
                     21:  * Contributor(s):
                     22:  *   IBM Corp. 
                     23:  *
                     24:  * Alternatively, the contents of this file may be used under the
                     25:  * terms of the GNU Public License (the "GPL"), in which case the
                     26:  * provisions of the GPL are applicable instead of those above.
                     27:  * If you wish to allow use of your version of this file only
                     28:  * under the terms of the GPL and not to allow others to use your
                     29:  * version of this file under the NPL, indicate your decision by
                     30:  * deleting the provisions above and replace them with the notice
                     31:  * and other provisions required by the GPL.  If you do not delete
                     32:  * the provisions above, a recipient may use your version of this
                     33:  * file under either the NPL or the GPL.
                     34:  */
                     35: 
                     36: /*
                     37:  * By default all math calls go to fdlibm.  The defines for each platform
                     38:  * remap the math calls to native routines.
                     39:  */
                     40: 
                     41: #ifndef _LIBMATH_H
                     42: #define _LIBMATH_H
                     43: 
                     44: #include <math.h>
                     45: #include "jsconfig.h"
                     46: 
                     47: /*
                     48:  * Define which platforms on which to use fdlibm.  Not used
                     49:  * by default since there can be problems with endian-ness and such.
                     50:  */
                     51: 
                     52: #if defined(_WIN32) && !defined(__MWERKS__)
                     53: #define JS_USE_FDLIBM_MATH 1
                     54: 
                     55: #elif defined(SUNOS4)
                     56: #define JS_USE_FDLIBM_MATH 1
                     57: 
                     58: #elif defined(IRIX)
                     59: #define JS_USE_FDLIBM_MATH 1
                     60: 
                     61: #elif defined(SOLARIS)
                     62: #define JS_USE_FDLIBM_MATH 1
                     63: 
                     64: #elif defined(HPUX)
                     65: #define JS_USE_FDLIBM_MATH 1
                     66: 
                     67: #elif defined(linux)
                     68: #define JS_USE_FDLIBM_MATH 1
                     69: 
                     70: #elif defined(OSF1)
                     71: /* Want to use some fdlibm functions but fdlibm broken on OSF1/alpha. */
                     72: #define JS_USE_FDLIBM_MATH 0
                     73: 
                     74: #elif defined(AIX)
                     75: #define JS_USE_FDLIBM_MATH 1
                     76: 
                     77: #else
                     78: #define JS_USE_FDLIBM_MATH 0
                     79: #endif
                     80: 
                     81: #if !JS_USE_FDLIBM_MATH
                     82: 
                     83: /*
                     84:  * Use system provided math routines.
                     85:  */
                     86: 
                     87: #define fd_acos acos
                     88: #define fd_asin asin
                     89: #define fd_atan atan
                     90: #define fd_atan2 atan2
                     91: #define fd_ceil ceil
                     92: #define fd_copysign copysign
                     93: #define fd_cos cos
                     94: #define fd_exp exp
                     95: #define fd_fabs fabs
                     96: #define fd_floor floor
                     97: #define fd_fmod fmod
                     98: #define fd_log log
                     99: #define fd_pow pow
                    100: #define fd_sin sin
                    101: #define fd_sqrt sqrt
                    102: #define fd_tan tan
                    103: 
                    104: #else
                    105: 
                    106: /*
                    107:  * Use math routines in fdlibm.
                    108:  */
                    109: 
                    110: #undef __P
                    111: #ifdef __STDC__
                    112: #define __P(p)  p
                    113: #else
                    114: #define __P(p)  ()
                    115: #endif
                    116: 
                    117: #if defined _WIN32 || defined SUNOS4 
                    118: 
                    119: #define fd_acos acos
                    120: #define fd_asin asin
                    121: #define fd_atan atan
                    122: #define fd_cos cos
                    123: #define fd_sin sin
                    124: #define fd_tan tan
                    125: #define fd_exp exp
                    126: #define fd_log log
                    127: #define fd_sqrt sqrt
                    128: #define fd_ceil ceil
                    129: #define fd_fabs fabs
                    130: #define fd_floor floor
                    131: #define fd_fmod fmod
                    132: 
                    133: extern double fd_atan2 __P((double, double));
                    134: extern double fd_copysign __P((double, double));
                    135: extern double fd_pow __P((double, double));
                    136: 
                    137: #elif defined IRIX
                    138: 
                    139: #define fd_acos acos
                    140: #define fd_asin asin
                    141: #define fd_atan atan
                    142: #define fd_exp exp
                    143: #define fd_log log
                    144: #define fd_log10 log10
                    145: #define fd_sqrt sqrt
                    146: #define fd_fabs fabs
                    147: #define fd_floor floor
                    148: #define fd_fmod fmod
                    149: 
                    150: extern double fd_cos __P((double));
                    151: extern double fd_sin __P((double));
                    152: extern double fd_tan __P((double));
                    153: extern double fd_atan2 __P((double, double));
                    154: extern double fd_pow __P((double, double));
                    155: extern double fd_ceil __P((double));
                    156: extern double fd_copysign __P((double, double));
                    157: 
                    158: #elif defined SOLARIS
                    159: 
                    160: #define fd_atan atan
                    161: #define fd_cos cos
                    162: #define fd_sin sin
                    163: #define fd_tan tan
                    164: #define fd_exp exp
                    165: #define fd_sqrt sqrt
                    166: #define fd_ceil ceil
                    167: #define fd_fabs fabs
                    168: #define fd_floor floor
                    169: #define fd_fmod fmod
                    170: 
                    171: extern double fd_acos __P((double));
                    172: extern double fd_asin __P((double));
                    173: extern double fd_log __P((double));
                    174: extern double fd_atan2 __P((double, double));
                    175: extern double fd_pow __P((double, double));
                    176: extern double fd_copysign __P((double, double));
                    177: 
                    178: #elif defined HPUX
                    179: 
                    180: #define fd_cos cos
                    181: #define fd_sin sin
                    182: #define fd_exp exp
                    183: #define fd_sqrt sqrt
                    184: #define fd_fabs fabs
                    185: #define fd_floor floor
                    186: #define fd_fmod fmod
                    187: 
                    188: extern double fd_ceil __P((double));
                    189: extern double fd_acos __P((double));
                    190: extern double fd_log __P((double));
                    191: extern double fd_atan2 __P((double, double));
                    192: extern double fd_tan __P((double));
                    193: extern double fd_pow __P((double, double));
                    194: extern double fd_asin __P((double));
                    195: extern double fd_atan __P((double));
                    196: extern double fd_copysign __P((double, double));
                    197: 
                    198: #elif defined(linux)
                    199: 
                    200: #define fd_atan atan
                    201: #define fd_atan2 atan2
                    202: #define fd_ceil ceil
                    203: #define fd_cos cos
                    204: #define fd_fabs fabs
                    205: #define fd_floor floor
                    206: #define fd_fmod fmod
                    207: #define fd_sin sin
                    208: #define fd_sqrt sqrt
                    209: #define fd_tan tan
                    210: #define fd_copysign copysign
                    211: 
                    212: extern double fd_asin __P((double));
                    213: extern double fd_acos __P((double));
                    214: extern double fd_exp __P((double));
                    215: extern double fd_log __P((double));
                    216: extern double fd_pow __P((double, double));
                    217: 
                    218: #elif defined(OSF1)
                    219: 
                    220: #define fd_acos acos
                    221: #define fd_asin asin
                    222: #define fd_atan atan
                    223: #define fd_copysign copysign
                    224: #define fd_cos cos
                    225: #define fd_exp exp
                    226: #define fd_fabs fabs
                    227: #define fd_fmod fmod
                    228: #define fd_sin sin
                    229: #define fd_sqrt sqrt
                    230: #define fd_tan tan
                    231: 
                    232: extern double fd_atan2 __P((double, double));
                    233: extern double fd_ceil __P((double));
                    234: extern double fd_floor __P((double));
                    235: extern double fd_log __P((double));
                    236: extern double fd_pow __P((double, double));
                    237: 
                    238: #elif defined(AIX)
                    239: 
                    240: #define fd_acos acos
                    241: #define fd_asin asin
                    242: #define fd_atan2 atan2
                    243: #define fd_copysign copysign
                    244: #define fd_cos cos
                    245: #define fd_exp exp
                    246: #define fd_fabs fabs
                    247: #define fd_floor floor
                    248: #define fd_fmod fmod
                    249: #define fd_log log
                    250: #define fd_sin sin
                    251: #define fd_sqrt sqrt
                    252: 
                    253: extern double fd_atan __P((double));
                    254: extern double fd_ceil __P((double));
                    255: extern double fd_pow __P((double,double));
                    256: extern double fd_tan __P((double));
                    257: 
                    258: #else /* other platform.. generic paranoid slow fdlibm */
                    259: 
                    260: extern double fd_acos __P((double));
                    261: extern double fd_asin __P((double));
                    262: extern double fd_atan __P((double));
                    263: extern double fd_cos __P((double));
                    264: extern double fd_sin __P((double));
                    265: extern double fd_tan __P((double));
                    266:  
                    267: extern double fd_exp __P((double));
                    268: extern double fd_log __P((double));
                    269: extern double fd_sqrt __P((double));
                    270: 
                    271: extern double fd_ceil __P((double));
                    272: extern double fd_fabs __P((double));
                    273: extern double fd_floor __P((double));
                    274: extern double fd_fmod __P((double, double));
                    275: 
                    276: extern double fd_atan2 __P((double, double));
                    277: extern double fd_pow __P((double, double));
                    278: extern double fd_copysign __P((double, double));
                    279: 
                    280: #endif
                    281: 
                    282: #endif /* JS_USE_FDLIBM_MATH */
                    283: 
                    284: #endif /* _LIBMATH_H */
                    285: 

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.