Opened 10 years ago

Closed 10 years ago

Last modified 8 years ago

#674 closed defect (fixed)

VoronoiDiagramBuilder uses fmax which breaks MSVC11 build

Reported by: Twiddeldidu Owned by: strk
Priority: major Milestone: 3.6.1
Component: Default Version: main
Severity: Unassigned Keywords: msvc
Cc:

Description

The build configuration already has defined NOMINMAX in the CMakeLists.txt but there is still a compiling issue with msvc11 (x64) and CMake.

elseif(MSVC)
    
  # Set pedantic mode by default
  #set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4")
  string(REGEX REPLACE "/W[0-9]" "/W4" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")

  if(MSVC80 OR MSVC90 OR MSVC10 OR MSVC11)

    # Option is to enable the /MP switch for Visual Studio 2005 or later
    option(GEOS_MSVC_ENABLE_MP
      "Set to ON to build GEOS with the /MP option (Visual Studio 2005 and above)." ON)
    mark_as_advanced(GEOS_MSVC_ENABLE_MP)
    if(GEOS_MSVC_ENABLE_MP)
      set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP")
    endif()
    message(STATUS "Setting Visual Studio 2005+ option /MP to ${GEOS_MSVC_ENABLE_MP}")
    
    add_definitions(-D_SCL_SECURE_NO_WARNINGS)
    add_definitions(-D_CRT_SECURE_NO_WARNINGS)

==     add_definitions(-DNOMINMAX) ==

  endif()

endif()

There is a problem with VoronoiDiagramBuilder.cpp because it uses fmax. I made a quick patch changing this to the generic std::max instead of using fmax.

Attachments (2)

VoronoiDiagramBuilder.cpp.patch (568 bytes ) - added by Twiddeldidu 10 years ago.
Patch for VoronoiDiagramBuilder
QuadEdgeSubdivisionTest.cpp.patch (864 bytes ) - added by Twiddeldidu 10 years ago.
Fix for QuadEdgeSubdivisionTest

Download all attachments as: .zip

Change History (6)

by Twiddeldidu, 10 years ago

comment:1 by Twiddeldidu, 10 years ago

QuadEdgeSubdivisionTest has same issue.

comment:2 by strk, 10 years ago

Owner: changed from geos-devel@… to strk
Status: newassigned

r3962 in trunk. Please check.

comment:3 by strk, 10 years ago

Resolution: fixed
Status: assignedclosed

Assuming fixed (after 10 months of no feedback...)

comment:4 by strk, 8 years ago

Milestone: 3.4.33.6.1

Ticket retargeted after milestone deleted

Note: See TracTickets for help on using tickets.