From 1e38669119d4ce3e06bbad603799e32e6fd7feb2 Mon Sep 17 00:00:00 2001 From: Timotej Lazar Date: Sun, 12 Jun 2022 16:53:06 +0200 Subject: Replace max macro with std::max in C++ code Fixes compilation on Guix with gcc 12. Not sure which of those is relevant. --- src/win95/mishchnk.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/win95/mishchnk.cpp') diff --git a/src/win95/mishchnk.cpp b/src/win95/mishchnk.cpp index b4521c3..2c3777b 100644 --- a/src/win95/mishchnk.cpp +++ b/src/win95/mishchnk.cpp @@ -1,3 +1,5 @@ +#include + #include "chunk.hpp" #include "chnktype.hpp" #include "mishchnk.hpp" @@ -625,7 +627,7 @@ void File_Chunk::post_input_processing() LIF sli(&shplist); for (; !sli.done(); sli.next()) { - Shape_Chunk::max_id = max (Shape_Chunk::max_id,sli()->get_header()->file_id_num); + Shape_Chunk::max_id = std::max(Shape_Chunk::max_id,sli()->get_header()->file_id_num); } Shape_Chunk** shape_array=new Shape_Chunk*[Shape_Chunk::max_id+1]; @@ -803,7 +805,7 @@ BOOL File_Chunk::check_file() // Here we update max_id - Shape_Chunk::max_id = max (Shape_Chunk::max_id,id); + Shape_Chunk::max_id = std::max(Shape_Chunk::max_id,id); // go to version number SetFilePointer(rif_file,shphead.first_entry() + 100,0,FILE_BEGIN); @@ -1515,7 +1517,7 @@ void File_Chunk::build_object_array() //find the highest object index for(oblif.restart();!oblif.done();oblif.next()) { - object_array_size=max(object_array_size,oblif()->object_data.index_num+1); + object_array_size=std::max(object_array_size,oblif()->object_data.index_num+1); } if(object_array_size<=0) return; @@ -1864,7 +1866,7 @@ void RIF_File_Chunk::post_input_processing() for (LIF sli(&shplist); !sli.done(); sli.next()) { - Shape_Chunk::max_id = max (Shape_Chunk::max_id,sli()->get_header()->file_id_num); + Shape_Chunk::max_id = std::max(Shape_Chunk::max_id,sli()->get_header()->file_id_num); } Chunk_With_Children::post_input_processing(); -- cgit v1.3