From cca4818eb7769d6e776bdc30516a5f871f1d6393 Mon Sep 17 00:00:00 2001 From: Joshua Haberman Date: Sat, 31 Mar 2012 12:17:32 -0700 Subject: Sync from internal Google development. --- bindings/linux/assert.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 bindings/linux/assert.h (limited to 'bindings/linux/assert.h') diff --git a/bindings/linux/assert.h b/bindings/linux/assert.h new file mode 100644 index 0000000..26d8ab6 --- /dev/null +++ b/bindings/linux/assert.h @@ -0,0 +1,20 @@ +/* + * upb - a minimalist implementation of protocol buffers. + * + * Copyright (c) 2012 Google Inc. See LICENSE for details. + * Author: Josh Haberman + */ + +#include + +#ifndef UPB_LINUX_ASSERT_H +#define UPB_LINUX_ASSERT_H + +#ifdef NDEBUG +#define assert(x) +#else +#define assert(x) \ + if (!(x)) panic("Assertion failed: %s at %s:%d", #x, __FILE__, __LINE__); +#endif + +#endif -- cgit v1.2.3