From 0826f15d0b448e2e88c65df26450d301c4cda09e Mon Sep 17 00:00:00 2001 From: Serge Lamikhov-Center Date: Sat, 17 Oct 2020 22:51:53 +0300 Subject: [PATCH] Use funny syntax to prevent min() macro in MSVS --- elfio/elfio_dynamic.hpp | 2 +- tests/ELFIOTest.cpp | 3 --- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/elfio/elfio_dynamic.hpp b/elfio/elfio_dynamic.hpp index 3464a03..efe4cbb 100644 --- a/elfio/elfio_dynamic.hpp +++ b/elfio/elfio_dynamic.hpp @@ -53,7 +53,7 @@ template class dynamic_section_accessor_template if ( tag == DT_NULL ) break; } - entries_num = std::min( entries_num, i + 1 ); + entries_num = (std::min)( entries_num, i + 1 ); } return entries_num; diff --git a/tests/ELFIOTest.cpp b/tests/ELFIOTest.cpp index b47ce94..68ea71f 100644 --- a/tests/ELFIOTest.cpp +++ b/tests/ELFIOTest.cpp @@ -22,9 +22,6 @@ THE SOFTWARE. #ifdef _MSC_VER #define _SCL_SECURE_NO_WARNINGS - -// Prevent usage of min() macro when compiled with VS -#define NOMINMAX #endif #define BOOST_TEST_MODULE ELFIO_Test