From 101552dc82107dd2a9feceb335f553d13f3ce6af Mon Sep 17 00:00:00 2001 From: Freddie Akeroyd Date: Fri, 30 Aug 2024 11:43:10 +0100 Subject: [PATCH] Avoid isnan/isinf redefine in c++ on VS2013 and above --- modules/libcom/src/osi/os/WIN32/epicsMath.h | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/modules/libcom/src/osi/os/WIN32/epicsMath.h b/modules/libcom/src/osi/os/WIN32/epicsMath.h index a7b4bca62..d0d02330f 100644 --- a/modules/libcom/src/osi/os/WIN32/epicsMath.h +++ b/modules/libcom/src/osi/os/WIN32/epicsMath.h @@ -19,12 +19,13 @@ #define finite(D) _finite(D) #endif -#ifndef __cplusplus +#if !defined(__cplusplus) || (defined(_MSC_VER) && (_MSC_VER < 1800)) -/* 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 +/* these are macros in C but usually inline functions in C++ + * so macro ifndef does not work as a check in c++ + * In a recent VS2022 update redefining as macros causes a conflict and + * compile time error. It looks like VS2013 and above supply + * isnan and isinf functions for in C++ so no need to create them */ #ifndef isnan