go-assert.h 611 B

123456789101112131415161718
  1. /* go-assert.h -- libgo specific assertions
  2. Copyright 2010 The Go Authors. All rights reserved.
  3. Use of this source code is governed by a BSD-style
  4. license that can be found in the LICENSE file. */
  5. #ifndef LIBGO_GO_ASSERT_H
  6. #define LIBGO_GO_ASSERT_H
  7. /* We use a Go specific assert function so that functions which call
  8. assert aren't required to always split the stack. */
  9. extern void __go_assert_fail (const char *file, unsigned int lineno)
  10. __attribute__ ((noreturn));
  11. #define __go_assert(e) ((e) ? (void) 0 : __go_assert_fail (__FILE__, __LINE__))
  12. #endif /* !defined(LIBGO_GO_ASSERT_H) */