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