diff --git a/src/hb-machinery.hh b/src/hb-machinery.hh index 7457a099e..56e279e6c 100644 --- a/src/hb-machinery.hh +++ b/src/hb-machinery.hh @@ -480,6 +480,23 @@ struct hb_sanitize_context_t : bool num_glyphs_set; }; +struct hb_sanitize_with_object_t +{ + template + inline hb_sanitize_with_object_t (hb_sanitize_context_t *c, + const T& obj) : c (c) + { + c->set_object (obj); + } + inline ~hb_sanitize_with_object_t (void) + { + c->set_object (); + } + + private: + hb_sanitize_context_t *c; +}; + /* * Serialize