src/libm/math.h
author Sam Lantinga <slouken@libsdl.org>
Sat, 10 Jan 2009 18:32:24 +0000
changeset 3012 7e30c2dc7783
parent 2859 99210400e8b9
child 3697 f7b03b6838cb
permissions -rw-r--r--
Fixed Visual C++ release build for Visual C++ 2005
* Some math functions become intrinsic in release mode, so we need to
convert all the math functions into SDL math functions, like we did
with the stdlib functions.
* Constant initializers of 8-bit values become calls to memset() in
release mode, but memset() itself is an intrinsic when explicitly
called. So we'll just explicitly call memset() in those cases.
slouken@2756
     1
/*
slouken@2756
     2
    SDL - Simple DirectMedia Layer
slouken@2859
     3
    Copyright (C) 1997-2009 Sam Lantinga
slouken@2756
     4
slouken@2756
     5
    This library is free software; you can redistribute it and/or
slouken@2756
     6
    modify it under the terms of the GNU Lesser General Public
slouken@2756
     7
    License as published by the Free Software Foundation; either
slouken@2756
     8
    version 2.1 of the License, or (at your option) any later version.
slouken@2756
     9
slouken@2756
    10
    This library is distributed in the hope that it will be useful,
slouken@2756
    11
    but WITHOUT ANY WARRANTY; without even the implied warranty of
slouken@2756
    12
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
slouken@2756
    13
    Lesser General Public License for more details.
slouken@2756
    14
slouken@2756
    15
    You should have received a copy of the GNU Lesser General Public
slouken@2756
    16
    License along with this library; if not, write to the Free Software
slouken@2756
    17
    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
slouken@2756
    18
slouken@2756
    19
    Sam Lantinga
slouken@2756
    20
    slouken@libsdl.org
slouken@2756
    21
*/
slouken@2756
    22
#include "SDL_config.h"
slouken@3012
    23
#include "SDL_stdinc.h"
slouken@2756
    24
slouken@2760
    25
/* Math routines from uClibc: http://www.uclibc.org */
slouken@2760
    26
slouken@3012
    27
#ifdef HAVE_COPYSIGN
slouken@3012
    28
#define copysign        SDL_uclibc_copysign
slouken@3012
    29
#else
slouken@3012
    30
#define copysign        SDL_copysign
slouken@3012
    31
#endif
slouken@2769
    32
slouken@3012
    33
#ifdef HAVE_COS
slouken@3012
    34
#define cos             SDL_uclibc_cos
slouken@3012
    35
#else
slouken@3012
    36
#define cos             SDL_cos
slouken@3012
    37
#endif
slouken@2756
    38
slouken@3012
    39
#ifdef HAVE_FABS
slouken@3012
    40
#define fabs            SDL_uclibc_fabs
slouken@3012
    41
#else
slouken@3012
    42
#define fabs            SDL_fabs
slouken@3012
    43
#endif
slouken@2756
    44
slouken@3012
    45
#ifdef HAVE_FLOOR
slouken@3012
    46
#define floor           SDL_uclibc_floor
slouken@3012
    47
#else
slouken@3012
    48
#define floor           SDL_floor
slouken@3012
    49
#endif
slouken@2756
    50
slouken@3012
    51
#ifndef HAVE_LOG
slouken@3012
    52
#define __ieee754_log   SDL_log
slouken@3012
    53
#endif
slouken@2769
    54
slouken@3012
    55
#ifndef HAVE_POW
slouken@3012
    56
#define __ieee754_pow   SDL_pow
slouken@3012
    57
#endif
slouken@3012
    58
slouken@3012
    59
#ifdef HAVE_SCALBN
slouken@3012
    60
#define scalbn          SDL_uclibc_scalbn
slouken@3012
    61
#else
slouken@3012
    62
#define scalbn          SDL_scalbn
slouken@3012
    63
#endif
slouken@3012
    64
slouken@3012
    65
#ifdef HAVE_SIN
slouken@3012
    66
#define sin             SDL_uclibc_sin
slouken@3012
    67
#else
slouken@3012
    68
#define sin             SDL_sin
slouken@3012
    69
#endif
slouken@3012
    70
slouken@3012
    71
#ifndef HAVE_SQRT
slouken@3012
    72
#define __ieee754_sqrt  SDL_sqrt
slouken@3012
    73
#endif
slouken@2756
    74
slouken@2756
    75
/* vi: set ts=4 sw=4 expandtab: */