From d8b215486245e84e33283b6047fb253bbb418e00 Mon Sep 17 00:00:00 2001 From: Joshua Haberman Date: Thu, 17 Feb 2011 23:07:17 -0800 Subject: First version of an assembly language decoder. It is slower than the C decoder for now because it falls off the fast path too often. But it can successfully decode varints, fixed32 and fixed64. --- src/upb.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/upb.h') diff --git a/src/upb.h b/src/upb.h index c5b4310..0698748 100644 --- a/src/upb.h +++ b/src/upb.h @@ -29,6 +29,16 @@ extern "C" { #define UPB_MIN(x, y) ((x) < (y) ? (x) : (y)) #define UPB_INDEX(base, i, m) (void*)((char*)(base) + ((i)*(m))) +INLINE void nop_printf(const char *fmt, ...) { + (void)fmt; +} + +#ifdef NDEBUG +#define DEBUGPRINTF nop_printf +#else +#define DEBUGPRINTF printf +#endif + // Rounds val up to the next multiple of align. INLINE size_t upb_align_up(size_t val, size_t align) { return val % align == 0 ? val : val + align - (val % align); -- cgit v1.2.3