From 7cae89a7ba4a4dd1affdf84370eb2d66b9966571 Mon Sep 17 00:00:00 2001 From: Laurent Perron Date: Thu, 5 Jan 2023 17:45:46 +0100 Subject: [PATCH] protect code againt PORTABLE --- ortools/sat/cp_model_utils.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ortools/sat/cp_model_utils.cc b/ortools/sat/cp_model_utils.cc index 16805bad1b..17dbb3df9e 100644 --- a/ortools/sat/cp_model_utils.cc +++ b/ortools/sat/cp_model_utils.cc @@ -747,11 +747,15 @@ uint64_t FingerprintModel(const CpModelProto& model, uint64_t seed) { bool WriteModelProtoToFile(const CpModelProto& model, const std::string& filename) { +#if defined(__PORTABLE_PLATFORM__) + return false; +#else if (absl::EndsWith(filename, "txt")) { return file::SetTextProto(filename, model, file::Defaults()).ok(); } else { return file::SetBinaryProto(filename, model, file::Defaults()).ok(); } +#endif } } // namespace sat