| 1 |
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
| 2 |
/* vim: set ts=8 sts=2 et sw=2 tw=80: */ |
| 3 |
/* This Source Code Form is subject to the terms of the Mozilla Public |
| 4 |
* License, v. 2.0. If a copy of the MPL was not distributed with this |
| 5 |
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
| 6 |
|
| 7 |
/** |
| 8 |
* This is intended for use only with vendored C libraries where editing the |
| 9 |
* source files to explicitly use fdblim is not desirable due to maintenance |
| 10 |
* burden. cmath for C++ is not supported. |
| 11 |
* |
| 12 |
* Use LOCAL_INCLUDES += ['/modules/fdlibm/inexact-math-override'] to |
| 13 |
* substitute fdlibm math functions for inexact functions in system libraries. |
| 14 |
* |
| 15 |
* This is intended to remove fingerprinting entropy due to variations in |
| 16 |
* return values from system libaries. Exact functions are not substituted |
| 17 |
* because these are expected to return consistent results regardless of |
| 18 |
* implementation. sqrt() is considered exact as correct rounding is required |
| 19 |
* by IEEE-754. |
| 20 |
*/ |
| 21 |
|
| 22 |
#ifndef MODULES_FDLIBM_INEXACT_MATH_OVERRIDE_MATH_H_ |
| 23 |
#define MODULES_FDLIBM_INEXACT_MATH_OVERRIDE_MATH_H_ |
| 24 |
|
| 25 |
#include_next <math.h> |
| 26 |
|
| 27 |
#include <fdlibm.h> |
| 28 |
|
| 29 |
#define acos fdlibm_acos |
| 30 |
#define acosf fdlibm_acosf |
| 31 |
#define asin fdlibm_asin |
| 32 |
#define asinf fdlibm_asinf |
| 33 |
#define atan fdlibm_atan |
| 34 |
#define atanf fdlibm_atanf |
| 35 |
#define atan2 fdlibm_atan2 |
| 36 |
#define cos fdlibm_cos |
| 37 |
#define cosf fdlibm_cosf |
| 38 |
#define sin fdlibm_sin |
| 39 |
#define sinf fdlibm_sinf |
| 40 |
#define tan fdlibm_tan |
| 41 |
#define tanf fdlibm_tanf |
| 42 |
#define cosh fdlibm_cosh |
| 43 |
#define sinh fdlibm_sinh |
| 44 |
#define tanh fdlibm_tanh |
| 45 |
#define exp fdlibm_exp |
| 46 |
#define expf fdlibm_expf |
| 47 |
#define exp2 fdlibm_exp2 |
| 48 |
#define exp2f fdlibm_exp2f |
| 49 |
#define log fdlibm_log |
| 50 |
#define logf fdlibm_logf |
| 51 |
#define log10 fdlibm_log10 |
| 52 |
#define log10f fdlibm_log10f |
| 53 |
#define pow fdlibm_pow |
| 54 |
#define powf fdlibm_powf |
| 55 |
#define acosh fdlibm_acosh |
| 56 |
#define asinh fdlibm_asinh |
| 57 |
#define atanh fdlibm_atanh |
| 58 |
#define cbrt fdlibm_cbrt |
| 59 |
#define expm1 fdlibm_expm1 |
| 60 |
#define hypot fdlibm_hypot |
| 61 |
#define hypotf fdlibm_hypotf |
| 62 |
#define log1p fdlibm_log1p |
| 63 |
#define log2 fdlibm_log2 |
| 64 |
|
| 65 |
// These functions are not yet vendored from fdlibm but are defined here to |
| 66 |
// catch any uses that would imply that they should be vendored. |
| 67 |
#define coshf fdlibm_coshf |
| 68 |
#define sinhf fdlibm_sinhf |
| 69 |
#define tanhf fdlibm_tanhf |
| 70 |
#define acoshf fdlibm_acoshf |
| 71 |
#define asinhf fdlibm_asinhf |
| 72 |
#define atanhf fdlibm_atanhf |
| 73 |
#define cbrtf fdlibm_cbrtf |
| 74 |
#define expm1f fdlibm_expm1f |
| 75 |
#define log1pf fdlibm_log1pf |
| 76 |
#define log2f fdlibm_log2f |
| 77 |
#define erf fdlibm_erf |
| 78 |
#define erff fdlibm_erff |
| 79 |
#define erfc fdlibm_erfc |
| 80 |
#define erfcf fdlibm_erfcf |
| 81 |
#define tgamma fdlibm_tgamma |
| 82 |
#define tgammaf fdlibm_tgammaf |
| 83 |
#define lgamma fdlibm_lgamma |
| 84 |
#define lgammaf fdlibm_lgammaf |
| 85 |
|
| 86 |
#endif // MODULES_FDLIBM_INEXACT_MATH_OVERRIDE_MATH_H_ |