protect isnan/isinf define on c++

This commit is contained in:
Freddie Akeroyd
2024-08-29 13:14:37 +01:00
committed by Andrew Johnson
parent 052a0c7e19
commit 574fe116fc

View File

@ -19,6 +19,14 @@
#define finite(D) _finite(D)
#endif
#ifndef __cplusplus
/* these are macros in C but inline functions in C++
* so ifndef does not work as a check in c++
* and in a recent VS2022 update causes a conflict and
* compile time error
*/
#ifndef isnan
#define isnan(D) _isnan(D)
#endif
@ -27,6 +35,8 @@
#define isinf(D) ( !_finite(D) && !_isnan(D) )
#endif
#endif /* ifndef __cplusplus */
#ifdef __cplusplus
extern "C" {
#endif