ReactOS 0.4.16-dev-2104-gb84fa49
mathf.c
Go to the documentation of this file.
1/*
2 * msvcrt float functions
3 *
4 * Copyright 2019 Jacek Caban for CodeWeavers
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
10 *
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19 */
20
21/* this function is part of the import lib to provide floating */
22#if 0
23#pragma makedep implib
24#endif
25
26#include <corecrt.h>
27#include <wine/asm.h>
28
29double __cdecl sin(double);
30double __cdecl cos(double);
31double __cdecl tan(double);
32double __cdecl atan2(double, double);
33double __cdecl exp(double);
34double __cdecl log(double);
35double __cdecl pow(double, double);
36double __cdecl sqrt(double);
37double __cdecl floor(double);
38double __cdecl ceil(double);
39float __cdecl powf(float, float);
40
41#if defined(__i386__) || (_MSVCR_VER > 0 && _MSVCR_VER < 80)
42float sinf(float x) { return sin(x); }
43float cosf(float x) { return cos(x); }
44float tanf(float x) { return tan(x); }
45float atan2f(float x, float y) { return atan2(x, y); }
46float expf(float x) { return exp(x); }
47float logf(float x) { return log(x); }
48float sqrtf(float x) { return sqrt(x); }
49float floorf(float x) { return floor(x); }
50float ceilf(float x) { return ceil(x); }
60
61#if _MSVCR_VER < 140
62float powf(float x, float y) { return pow(x, y); }
64#endif
65#endif
66
67#if _MSVCR_VER < 120
68double exp2(double x) { return pow(2.0, x); }
69float exp2f(float x) { return powf(2.0f, x); }
72#endif
#define __cdecl
Definition: corecrt.h:121
_ACRTIMP float __cdecl cosf(float)
Definition: cosf.c:13
_ACRTIMP float __cdecl sinf(float)
Definition: sinf.c:13
_ACRTIMP float __cdecl logf(float)
Definition: logf.c:12
_ACRTIMP float __cdecl tanf(float)
Definition: tanf.c:72
_ACRTIMP float __cdecl expf(float)
_ACRTIMP float __cdecl atan2f(float, float)
Definition: atan2f.c:51
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
double __cdecl pow(double, double)
Definition: freeldr.c:178
float __cdecl powf(float, float)
Definition: powf.c:14
double __cdecl floor(double)
Definition: floor.c:18
double __cdecl sin(double)
Definition: sin.c:21
double __cdecl ceil(double)
Definition: ceil.c:18
double __cdecl cos(double)
Definition: cos.c:21
double exp2(double x)
Definition: mathf.c:68
double __cdecl tan(double)
Definition: tan.c:122
double __cdecl sqrt(double)
Definition: sqrt.c:5
float exp2f(float x)
Definition: mathf.c:69
double __cdecl atan2(double, double)
Definition: atan2.c:52
DWORD exp
Definition: msg.c:16058
#define ceilf(x)
Definition: mymath.h:62
#define floorf(x)
Definition: mymath.h:65
#define sqrtf(x)
Definition: mymath.h:59
#define log(outFile, fmt,...)
Definition: util.h:15
#define __ASM_GLOBAL_IMPORT(name)
Definition: asm.h:118