Skip to content

Commit

Permalink
fix macro that needs renaming
Browse files Browse the repository at this point in the history
  • Loading branch information
h-vetinari committed Mar 4, 2023
1 parent 4afeb1b commit 7ca20a7
Show file tree
Hide file tree
Showing 2 changed files with 71 additions and 0 deletions.
3 changes: 3 additions & 0 deletions recipe/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ package:
source:
url: https://github.com/google/or-tools/archive/v{{ version }}.tar.gz
sha256: 180fbc45f6e5ce5ff153bea2df0df59b15346f2a7f8ffbd7cb4aed0fb484b8f6
patches:
# minimal fix for https://github.com/google/or-tools/issues/3698
- patches/0001-ensure-we-re-using-the-right-abseil-macro.patch

# The meta package

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
From 57c0a635066af900be819645d11cd477f7d183c1 Mon Sep 17 00:00:00 2001
From: "H. Vetinari" <h.vetinari@gmx.com>
Date: Sat, 4 Mar 2023 19:12:41 +1100
Subject: [PATCH] ensure we're using the right abseil macro

see https://github.com/google/or-tools/issues/3698
---
ortools/base/logging.cc | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/ortools/base/logging.cc b/ortools/base/logging.cc
index 1e1fd161a..16c15f854 100644
--- a/ortools/base/logging.cc
+++ b/ortools/base/logging.cc
@@ -46,6 +46,7 @@
#include <vector>

#include "absl/debugging/stacktrace.h"
+#include "absl/synchronization/mutex.h"
#include "absl/time/time.h"
#include "ortools/base/commandlineflags.h"
#include "ortools/base/logging_utilities.h"
@@ -1269,7 +1270,7 @@ void ReprintFatalMessage() {
}

// L >= log_mutex (callers must hold the log_mutex).
-void LogMessage::SendToLog() EXCLUSIVE_LOCKS_REQUIRED(log_mutex) {
+void LogMessage::SendToLog() ABSL_EXCLUSIVE_LOCKS_REQUIRED(log_mutex) {
static bool already_warned_before_initgoogle = false;

log_mutex.AssertHeld();
@@ -1393,7 +1394,7 @@ void InstallFailureFunction(void (*fail_func)()) {
void LogMessage::Fail() { g_logging_fail_func(); }

// L >= log_mutex (callers must hold the log_mutex).
-void LogMessage::SendToSink() EXCLUSIVE_LOCKS_REQUIRED(log_mutex) {
+void LogMessage::SendToSink() ABSL_EXCLUSIVE_LOCKS_REQUIRED(log_mutex) {
if (data_->sink_ != nullptr) {
RAW_DCHECK(data_->num_chars_to_log_ > 0 &&
data_->message_text_[data_->num_chars_to_log_ - 1] == '\n',
@@ -1406,13 +1407,13 @@ void LogMessage::SendToSink() EXCLUSIVE_LOCKS_REQUIRED(log_mutex) {
}

// L >= log_mutex (callers must hold the log_mutex).
-void LogMessage::SendToSinkAndLog() EXCLUSIVE_LOCKS_REQUIRED(log_mutex) {
+void LogMessage::SendToSinkAndLog() ABSL_EXCLUSIVE_LOCKS_REQUIRED(log_mutex) {
SendToSink();
SendToLog();
}

// L >= log_mutex (callers must hold the log_mutex).
-void LogMessage::SaveOrSendToLog() EXCLUSIVE_LOCKS_REQUIRED(log_mutex) {
+void LogMessage::SaveOrSendToLog() ABSL_EXCLUSIVE_LOCKS_REQUIRED(log_mutex) {
if (data_->outvec_ != nullptr) {
RAW_DCHECK(data_->num_chars_to_log_ > 0 &&
data_->message_text_[data_->num_chars_to_log_ - 1] == '\n',
@@ -1426,7 +1427,7 @@ void LogMessage::SaveOrSendToLog() EXCLUSIVE_LOCKS_REQUIRED(log_mutex) {
}
}

-void LogMessage::WriteToStringAndLog() EXCLUSIVE_LOCKS_REQUIRED(log_mutex) {
+void LogMessage::WriteToStringAndLog() ABSL_EXCLUSIVE_LOCKS_REQUIRED(log_mutex) {
if (data_->message_ != nullptr) {
RAW_DCHECK(data_->num_chars_to_log_ > 0 &&
data_->message_text_[data_->num_chars_to_log_ - 1] == '\n',
--
2.38.1.windows.1

0 comments on commit 7ca20a7

Please sign in to comment.