ReactOS 0.4.15-dev-5669-g09dde2c
assert.h
Go to the documentation of this file.
1/* @(#)assert.h 1.1 09/08/07 Copyright 2009 J. Schilling */
2/*
3 * Abstraction code for assert.h
4 *
5 * Copyright (c) 2009 J. Schilling
6 */
7/*
8 * The contents of this file are subject to the terms of the
9 * Common Development and Distribution License, Version 1.0 only
10 * (the "License"). You may not use this file except in compliance
11 * with the License.
12 *
13 * See the file CDDL.Schily.txt in this distribution for details.
14 *
15 * When distributing Covered Code, include this CDDL HEADER in each
16 * file and include the License file CDDL.Schily.txt from this distribution.
17 */
18
19#ifndef _SCHILY_ASSERT_H
20#define _SCHILY_ASSERT_H
21
22#ifndef _SCHILY_MCONFIG_H
23#include <schily/mconfig.h>
24#endif
25
26#ifdef HAVE_ASSERT_H
27#ifndef _INCL_ASSERT_H
28#define _INCL_ASSERT_H
29#include <assert.h>
30#endif
31#else /* !HAVE_ASSERT_H */
32
33#undef assert
34
35#ifdef NDEBUG
36#define assert(ignore) ((void) 0)
37#else
38#if defined(__STDC__)
39#define assert(exp) (void)((exp) || (__assert(#exp, __FILE__, __LINE__), 0))
40#else
41#define assert(exp) (void)((exp) || (__assert("exp", __FILE__, __LINE__), 0))
42#endif
43#endif
44
45#endif /* !HAVE_ASSERT_H */
46
47#endif /* _SCHILY_ASSERT_H */