src/libm/math_libm.h
author Sam Lantinga <slouken@libsdl.org>
Fri, 15 Feb 2013 08:47:44 -0800
changeset 6885 700f1b25f77f
parent 6138 4c64952a58fb
child 7351 668a3dc28361
permissions -rw-r--r--
Happy New Year!
     1 /*
     2   Simple DirectMedia Layer
     3   Copyright (C) 1997-2013 Sam Lantinga <slouken@libsdl.org>
     4 
     5   This software is provided 'as-is', without any express or implied
     6   warranty.  In no event will the authors be held liable for any damages
     7   arising from the use of this software.
     8 
     9   Permission is granted to anyone to use this software for any purpose,
    10   including commercial applications, and to alter it and redistribute it
    11   freely, subject to the following restrictions:
    12 
    13   1. The origin of this software must not be misrepresented; you must not
    14      claim that you wrote the original software. If you use this software
    15      in a product, an acknowledgment in the product documentation would be
    16      appreciated but is not required.
    17   2. Altered source versions must be plainly marked as such, and must not be
    18      misrepresented as being the original software.
    19   3. This notice may not be removed or altered from any source distribution.
    20 */
    21 #include "SDL_config.h"
    22 #include "SDL_stdinc.h"
    23 
    24 /* Math routines from uClibc: http://www.uclibc.org */
    25 
    26 #ifdef HAVE_ATAN
    27 #define atan            SDL_uclibc_atan
    28 #else
    29 #define atan            SDL_atan
    30 #endif
    31 double atan(double x);
    32 
    33 #ifndef HAVE_ATAN2
    34 #define __ieee754_atan2 SDL_atan2
    35 #endif
    36 
    37 #ifdef HAVE_COPYSIGN
    38 #define copysign        SDL_uclibc_copysign
    39 #else
    40 #define copysign        SDL_copysign
    41 #endif
    42 double copysign(double x, double y);
    43 
    44 #ifdef HAVE_COS
    45 #define cos             SDL_uclibc_cos
    46 #else
    47 #define cos             SDL_cos
    48 #endif
    49 double cos(double x);
    50 
    51 #ifdef HAVE_FABS
    52 #define fabs            SDL_uclibc_fabs
    53 #else
    54 #define fabs            SDL_fabs
    55 #endif
    56 double fabs(double x);
    57 
    58 #ifdef HAVE_FLOOR
    59 #define floor           SDL_uclibc_floor
    60 #else
    61 #define floor           SDL_floor
    62 #endif
    63 double floor(double x);
    64 
    65 #ifndef HAVE_LOG
    66 #define __ieee754_log   SDL_log
    67 #endif
    68 
    69 #ifndef HAVE_POW
    70 #define __ieee754_pow   SDL_pow
    71 #endif
    72 
    73 #ifdef HAVE_SCALBN
    74 #define scalbn          SDL_uclibc_scalbn
    75 #else
    76 #define scalbn          SDL_scalbn
    77 #endif
    78 double scalbn(double x, int n);
    79 
    80 #ifdef HAVE_SIN
    81 #define sin             SDL_uclibc_sin
    82 #else
    83 #define sin             SDL_sin
    84 #endif
    85 double sin(double x);
    86 
    87 #ifndef HAVE_SQRT
    88 #define __ieee754_sqrt  SDL_sqrt
    89 #endif
    90 
    91 /* vi: set ts=4 sw=4 expandtab: */