From 54417d28a5273a8d759b28882a0c96335e192756 Mon Sep 17 00:00:00 2001 From: Tony Mak Date: Mon, 28 Sep 2020 11:50:05 +0100 Subject: Sync https://github.com/s-yata/marisa-trie/pull/32 This allows us from disabling exception support for the whole libtextclassifier. The PR was accepted. Cherrypicking the change for now until the library version is bumped. Bug: 148777789 Test: Treehugger Change-Id: If0099adaca2dc046a1870f11bf7eeeda8c4c2ce9 --- include/marisa/scoped-array.h | 2 +- include/marisa/scoped-ptr.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/marisa/scoped-array.h b/include/marisa/scoped-array.h index 12b5b9e..34cefa4 100644 --- a/include/marisa/scoped-array.h +++ b/include/marisa/scoped-array.h @@ -16,7 +16,7 @@ class scoped_array { } void reset(T *array = NULL) { - MARISA_THROW_IF((array != NULL) && (array == array_), MARISA_RESET_ERROR); + MARISA_DEBUG_IF((array != NULL) && (array == array_), MARISA_RESET_ERROR); scoped_array(array).swap(*this); } diff --git a/include/marisa/scoped-ptr.h b/include/marisa/scoped-ptr.h index 63d7a3d..abf48d8 100644 --- a/include/marisa/scoped-ptr.h +++ b/include/marisa/scoped-ptr.h @@ -16,7 +16,7 @@ class scoped_ptr { } void reset(T *ptr = NULL) { - MARISA_THROW_IF((ptr != NULL) && (ptr == ptr_), MARISA_RESET_ERROR); + MARISA_DEBUG_IF((ptr != NULL) && (ptr == ptr_), MARISA_RESET_ERROR); scoped_ptr(ptr).swap(*this); } -- cgit v1.2.3