[Bug 292590] math/vtk9: fix build with libc++ 21

From: <bugzilla-noreply_at_freebsd.org>
Date: Mon, 19 Jan 2026 19:58:09 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=292590

            Bug ID: 292590
           Summary: math/vtk9: fix build with libc++ 21
           Product: Ports & Packages
           Version: Latest
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Some People
          Priority: ---
         Component: Individual Port(s)
          Assignee: yuri@freebsd.org
          Reporter: dim@FreeBSD.org
          Assignee: yuri@freebsd.org
             Flags: maintainer-feedback?(yuri@freebsd.org)

With libc++ 21, math/vtk9 fails to compile, resulting in errors similar
to:

    In file included from
/wrkdirs/usr/ports/math/vtk9/work/VTK-9.5.2/ThirdParty/fmt/vtkfmt/src/os.cc:14:
    In file included from
/wrkdirs/usr/ports/math/vtk9/work/VTK-9.5.2/ThirdParty/fmt/vtkfmt/vtkfmt/os.h:11:
   
/wrkdirs/usr/ports/math/vtk9/work/VTK-9.5.2/ThirdParty/fmt/vtkfmt/vtkfmt/format.h:747:28:
error: use of undeclared identifier 'malloc'
      747 |     T* p = static_cast<T*>(malloc(n * sizeof(T)));
          |                            ^~~~~~
   
/wrkdirs/usr/ports/math/vtk9/work/VTK-9.5.2/ThirdParty/fmt/vtkfmt/vtkfmt/format.h:752:35:
error: use of undeclared identifier 'free'
      752 |   void deallocate(T* p, size_t) { free(p); }
          |                                   ^~~~

This is because malloc and free are defined in <cstdlib>, which is not
included in vtk's format.h. Add the include to fix the build.

-- 
You are receiving this mail because:
You are the assignee for the bug.