| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Mesa 3-D graphics library | 2 * Mesa 3-D graphics library |
| 3 * Version: 7.5 | 3 * Version: 7.5 |
| 4 * | 4 * |
| 5 * Copyright (C) 1999-2008 Brian Paul All Rights Reserved. | 5 * Copyright (C) 1999-2008 Brian Paul All Rights Reserved. |
| 6 * | 6 * |
| 7 * Permission is hereby granted, free of charge, to any person obtaining a | 7 * Permission is hereby granted, free of charge, to any person obtaining a |
| 8 * copy of this software and associated documentation files (the "Software"), | 8 * copy of this software and associated documentation files (the "Software"), |
| 9 * to deal in the Software without restriction, including without limitation | 9 * to deal in the Software without restriction, including without limitation |
| 10 * the rights to use, copy, modify, merge, publish, distribute, sublicense, | 10 * the rights to use, copy, modify, merge, publish, distribute, sublicense, |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 138 #define sinhf(f) ((float) sinh(f)) | 138 #define sinhf(f) ((float) sinh(f)) |
| 139 #define sqrtf(f) ((float) sqrt(f)) | 139 #define sqrtf(f) ((float) sqrt(f)) |
| 140 #define tanf(f) ((float) tan(f)) | 140 #define tanf(f) ((float) tan(f)) |
| 141 #define tanhf(f) ((float) tanh(f)) | 141 #define tanhf(f) ((float) tanh(f)) |
| 142 #define acoshf(f) ((float) acosh(f)) | 142 #define acoshf(f) ((float) acosh(f)) |
| 143 #define asinhf(f) ((float) asinh(f)) | 143 #define asinhf(f) ((float) asinh(f)) |
| 144 #define atanhf(f) ((float) atanh(f)) | 144 #define atanhf(f) ((float) atanh(f)) |
| 145 #endif | 145 #endif |
| 146 | 146 |
| 147 #if defined(_MSC_VER) | 147 #if defined(_MSC_VER) |
| 148 #if _MSC_VER < 1800 /* Not required on VS2013 and above. */ |
| 148 static inline float truncf(float x) { return x < 0.0f ? ceilf(x) : floorf(x); } | 149 static inline float truncf(float x) { return x < 0.0f ? ceilf(x) : floorf(x); } |
| 149 static inline float exp2f(float x) { return powf(2.0f, x); } | 150 static inline float exp2f(float x) { return powf(2.0f, x); } |
| 150 static inline float log2f(float x) { return logf(x) * 1.442695041f; } | 151 static inline float log2f(float x) { return logf(x) * 1.442695041f; } |
| 151 static inline float asinhf(float x) { return logf(x + sqrtf(x * x + 1.0f)); } | 152 static inline float asinhf(float x) { return logf(x + sqrtf(x * x + 1.0f)); } |
| 152 static inline float acoshf(float x) { return logf(x + sqrtf(x * x - 1.0f)); } | 153 static inline float acoshf(float x) { return logf(x + sqrtf(x * x - 1.0f)); } |
| 153 static inline float atanhf(float x) { return (logf(1.0f + x) - logf(1.0f - x)) /
2.0f; } | 154 static inline float atanhf(float x) { return (logf(1.0f + x) - logf(1.0f - x)) /
2.0f; } |
| 154 static inline int isblank(int ch) { return ch == ' ' || ch == '\t'; } | 155 static inline int isblank(int ch) { return ch == ' ' || ch == '\t'; } |
| 155 #define strtoll(p, e, b) _strtoi64(p, e, b) | 156 #define strtoll(p, e, b) _strtoi64(p, e, b) |
| 157 #endif /* _MSC_VER < 1800 */ |
| 156 #endif | 158 #endif |
| 157 /*@}*/ | 159 /*@}*/ |
| 158 | 160 |
| 159 /*** | 161 /*** |
| 160 *** LOG2: Log base 2 of float | 162 *** LOG2: Log base 2 of float |
| 161 ***/ | 163 ***/ |
| 162 #ifdef USE_IEEE | 164 #ifdef USE_IEEE |
| 163 #if 0 | 165 #if 0 |
| 164 /* This is pretty fast, but not accurate enough (only 2 fractional bits). | 166 /* This is pretty fast, but not accurate enough (only 2 fractional bits). |
| 165 * Based on code from http://www.stereopsis.com/log2.html | 167 * Based on code from http://www.stereopsis.com/log2.html |
| (...skipping 478 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 644 #define snprintf _snprintf | 646 #define snprintf _snprintf |
| 645 #endif | 647 #endif |
| 646 | 648 |
| 647 | 649 |
| 648 #ifdef __cplusplus | 650 #ifdef __cplusplus |
| 649 } | 651 } |
| 650 #endif | 652 #endif |
| 651 | 653 |
| 652 | 654 |
| 653 #endif /* IMPORTS_H */ | 655 #endif /* IMPORTS_H */ |
| OLD | NEW |