Skip to content

Commit 3e2dbad

Browse files
h-g-sCopilot
andcommitted
OsiClpSolverInterface: use _WIN32 guard for dlfcn.h (not _MSC_VER)
MinGW (GCC on Windows) does not define _MSC_VER but also lacks dlfcn.h, causing a fatal build error. Use _WIN32 to exclude the entire POSIX dlsym path on all Windows targets (both MSVC and MinGW), falling back to the CLP_USE_OPENBLAS compile-time guard on Windows. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 52375f0 commit 3e2dbad

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/OsiClp/OsiClpSolverInterface.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
// the symbol via dlsym(RTLD_DEFAULT) on first call: the helper is a no-op
99
// when the symbol is absent and fires automatically when OpenBLAS is linked
1010
// directly or transitively — regardless of compiler or -DCLP_USE_OPENBLAS.
11-
// On MSVC we fall back to the compile-time CLP_USE_OPENBLAS guard.
12-
#if !defined(_MSC_VER)
11+
// On Windows (MSVC and MinGW) we fall back to the compile-time guard.
12+
#if !defined(_WIN32)
1313
#include <dlfcn.h>
1414
namespace {
1515
inline void set_openblas_threads(int n)
@@ -970,7 +970,7 @@ void OsiClpSolverInterface::resolve()
970970
// reset random
971971
modelPtr_->randomNumberGenerator()->setSeed(123456789);
972972
#endif
973-
#if !defined(_MSC_VER)
973+
#if !defined(_WIN32)
974974
// Apply the BLAS thread cap if one was set (e.g. by CbcModel during parallel
975975
// B&B) to avoid N_cbc × M_blas thread explosion.
976976
if (modelPtr_->blasNumThreads() >= 0)

0 commit comments

Comments
 (0)