_null.h revision 187895
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: head/sys/sys/_null.h 187895 2009-01-29 16:51:09Z rdivacky $ 27123257Smarcel */ 28123257Smarcel 29123257Smarcel#ifndef NULL 30123257Smarcel 31126643Smarkm#if defined(_KERNEL) || !defined(__cplusplus) 32126643Smarkm#define NULL ((void *)0) 33123739Speter#else 34187895Srdivacky#if defined(__GNUG__) && defined(__GNUC__) && __GNUC__ >= 4 35187895Srdivacky#define NULL __null 36187895Srdivacky#else 37123855Sobrien#if defined(__LP64__) 38126643Smarkm#define NULL (0L) 39123257Smarcel#else 40123257Smarcel#define NULL 0 41126643Smarkm#endif /* __LP64__ */ 42187895Srdivacky#endif /* __GNUG__ */ 43126643Smarkm#endif /* _KERNEL || !__cplusplus */ 44123257Smarcel 45123257Smarcel#endif 46