From 08129fab91261edd18e05a095a8b6541fc1f898e Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Fri, 20 Aug 2010 15:51:40 +0000 Subject: [PATCH] On Windows use _mktemp instead of tempnam --- .../include/CGAL/Taucs_solver_traits.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Surface_mesh_parameterization/include/CGAL/Taucs_solver_traits.h b/Surface_mesh_parameterization/include/CGAL/Taucs_solver_traits.h index 46cf6200436..478fc0fd597 100644 --- a/Surface_mesh_parameterization/include/CGAL/Taucs_solver_traits.h +++ b/Surface_mesh_parameterization/include/CGAL/Taucs_solver_traits.h @@ -41,6 +41,10 @@ #include #include +#ifdef _MSC_VER +#include +#endif + namespace CGAL { @@ -280,10 +284,18 @@ public: // Create multi-file for out-of-core swapping. // Note: g++ complains that tempnam() is deprecated. You may safely ignore the warning. +#ifdef _MSC_VER + char template_name[13] = {'t', 'a', 'u', 'c', 's','.','X','X','X','X','X','X', '\0' }; + char* matrixfile = _mktemp(template_name); + if (matrixfile == NULL) + throw std::runtime_error("Cannot Create Multifile"); + boost::shared_ptr oocL(taucs_io_create_multifile(matrixfile), taucs_io_delete); +#else boost::shared_ptr matrixfile(tempnam(NULL, "taucs.L"), free); if (matrixfile == NULL) throw std::runtime_error("Cannot Create Multifile"); boost::shared_ptr oocL(taucs_io_create_multifile(matrixfile.get()), taucs_io_delete); +#endif if (oocL == NULL) throw std::runtime_error("Cannot Create Multifile");