File indexing completed on 2024-05-12 15:43:37

0001 /*
0002  * Copyright (C) 2003, 2006, 2007 Apple Inc.  All rights reserved.
0003  *
0004  * Redistribution and use in source and binary forms, with or without
0005  * modification, are permitted provided that the following conditions
0006  * are met:
0007  * 1. Redistributions of source code must retain the above copyright
0008  *    notice, this list of conditions and the following disclaimer.
0009  * 2. Redistributions in binary form must reproduce the above copyright
0010  *    notice, this list of conditions and the following disclaimer in the
0011  *    documentation and/or other materials provided with the distribution.
0012  *
0013  * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
0014  * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
0015  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
0016  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
0017  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
0018  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
0019  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
0020  * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
0021  * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
0022  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
0023  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
0024  */
0025 
0026 #ifndef WTF_Assertions_h
0027 #define WTF_Assertions_h
0028 
0029 #include <assert.h>
0030 #include <stdlib.h>
0031 
0032 #define ASSERT(x) assert(x)
0033 #define ASSERT_NOT_REACHED() assert(!"Should not be reached")
0034 
0035 /* COMPILE_ASSERT */
0036 #ifndef COMPILE_ASSERT
0037 #define COMPILE_ASSERT(exp, name) typedef int dummy##name [(exp) ? 1 : -1];
0038 #endif
0039 
0040 #ifdef NDEBUG
0041 #define ASSERT_DISABLED 1
0042 #else
0043 #define ASSERT_DISABLED 0
0044 #endif
0045 
0046 #define CRASH() abort()
0047 
0048 #endif // WTF_Assertions_h