1139825Simp/*-
2123257Smarcel * Copyright (c) 2003 Marcel Moolenaar
3123257Smarcel * All rights reserved.
4123257Smarcel *
5123257Smarcel * Redistribution and use in source and binary forms, with or without
6123257Smarcel * modification, are permitted provided that the following conditions
7123257Smarcel * are met:
8123257Smarcel *
9123257Smarcel * 1. Redistributions of source code must retain the above copyright
10123257Smarcel *    notice, this list of conditions and the following disclaimer.
11123257Smarcel * 2. Redistributions in binary form must reproduce the above copyright
12123257Smarcel *    notice, this list of conditions and the following disclaimer in the
13123257Smarcel *    documentation and/or other materials provided with the distribution.
14123257Smarcel *
15123257Smarcel * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
16123257Smarcel * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
17123257Smarcel * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
18123257Smarcel * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
19123257Smarcel * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
20123257Smarcel * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
21123257Smarcel * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
22123257Smarcel * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23123257Smarcel * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
24123257Smarcel * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25123257Smarcel *
26123257Smarcel * $FreeBSD$
27123257Smarcel */
28123257Smarcel
29123257Smarcel#ifndef NULL
30123257Smarcel
31192002Sjhb#if !defined(__cplusplus)
32192002Sjhb#define	NULL	((void *)0)
33192002Sjhb#else
34228918Stheraven#if __cplusplus >= 201103L
35228918Stheraven#define	NULL	nullptr
36228918Stheraven#elif defined(__GNUG__) && defined(__GNUC__) && __GNUC__ >= 4
37187895Srdivacky#define	NULL	__null
38187895Srdivacky#else
39123855Sobrien#if defined(__LP64__)
40126643Smarkm#define	NULL	(0L)
41123257Smarcel#else
42123257Smarcel#define	NULL	0
43126643Smarkm#endif	/* __LP64__ */
44187895Srdivacky#endif	/* __GNUG__ */
45192002Sjhb#endif	/* !__cplusplus */
46123257Smarcel
47123257Smarcel#endif
48