From 98ae7806e9c2187deeb25ee6d9fb67d437489017 Mon Sep 17 00:00:00 2001 From: Esun Kim Date: Wed, 31 Jul 2019 11:18:43 -0700 Subject: [PATCH] Add extern C to upb_alloc_global --- upb/upb.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/upb/upb.h b/upb/upb.h index 11aa38c5d5..79c19d281e 100644 --- a/upb/upb.h +++ b/upb/upb.h @@ -159,8 +159,16 @@ UPB_INLINE void upb_free(upb_alloc *alloc, void *ptr) { /* The global allocator used by upb. Uses the standard malloc()/free(). */ +#ifdef __cplusplus +extern "C" { +#endif + extern upb_alloc upb_alloc_global; +#ifdef __cplusplus +} /* extern "C" */ +#endif + /* Functions that hard-code the global malloc. * * We still get benefit because we can put custom logic into our global