From a215493c01ce800d2f15a17bcdc603d1df501245 Mon Sep 17 00:00:00 2001 From: Andy Maloney Date: Fri, 21 Apr 2023 18:16:19 -0400 Subject: [PATCH] Fix several places where we are checking for WIN32 when we should be checking for MSVC Part of #247 --- cmake/E57ExportHeader.cmake | 2 +- src/CheckedFile.cpp | 4 ++-- src/E57SimpleData.cpp | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/cmake/E57ExportHeader.cmake b/cmake/E57ExportHeader.cmake index 7f82be1..838da0f 100644 --- a/cmake/E57ExportHeader.cmake +++ b/cmake/E57ExportHeader.cmake @@ -7,7 +7,7 @@ include( GenerateExportHeader ) set( comment "\r // Windows DLLs can't include the extern keyword when declaring templates \r -#ifdef _WIN32 \r +#ifdef _MSC_VER \r #define TEMPLATE_EXTERN \r #else \r #define TEMPLATE_EXTERN extern \r diff --git a/src/CheckedFile.cpp b/src/CheckedFile.cpp index d49487d..876a6b9 100644 --- a/src/CheckedFile.cpp +++ b/src/CheckedFile.cpp @@ -68,13 +68,13 @@ // This is fixed in a newer version of CRCpp. // https://github.com/d-bahr/CRCpp/issues/17 // TODO: Remove when new CRCpp is released. -#if defined( WIN32 ) || defined( _WIN32 ) || defined( WINCE ) +#if defined( _MSC_VER ) // Disable warning about "conditional expression is constant". #pragma warning( push ) #pragma warning( disable : 4127 ) #endif #include "CRC.h" -#if defined( WIN32 ) || defined( _WIN32 ) || defined( WINCE ) +#if defined( _MSC_VER ) #pragma warning( pop ) #endif diff --git a/src/E57SimpleData.cpp b/src/E57SimpleData.cpp index c2a1223..7bb73c3 100644 --- a/src/E57SimpleData.cpp +++ b/src/E57SimpleData.cpp @@ -247,7 +247,7 @@ namespace e57 *this = Data3DPointsData_t(); } -#if defined( WIN32 ) || defined( _WIN32 ) || defined( WINCE ) +#if defined( _MSC_VER ) template struct E57_DLL Data3DPointsData_t; template struct E57_DLL Data3DPointsData_t; #else