Skip to content

Commit

Permalink
protect isnan/isinf define on c++
Browse files Browse the repository at this point in the history
  • Loading branch information
FreddieAkeroyd authored and mdavidsaver committed Sep 16, 2024
1 parent accb99f commit 0c4907f
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions modules/libcom/src/osi/os/WIN32/epicsMath.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -27,6 +35,8 @@
#define isinf(D) ( !_finite(D) && !_isnan(D) )
#endif

#endif /* ifndef __cplusplus */

#ifdef __cplusplus
extern "C" {
#endif
Expand Down

0 comments on commit 0c4907f

Please sign in to comment.