includes/cdefs.h

Go to the documentation of this file.
00001 /* cdefs.h
00002 
00003    Standard C definitions... */
00004 
00005 /*
00006  * Copyright (c) 1995 RadioMail Corporation.  All rights reserved.
00007  * Copyright (c) 2011,2012 by Internet Systems Consortium, Inc. ("ISC")
00008  * Copyright (c) 2004,2009 by Internet Systems Consortium, Inc. ("ISC")
00009  * Copyright (c) 1996-2003 by Internet Software Consortium
00010  *
00011  * Permission to use, copy, modify, and distribute this software for any
00012  * purpose with or without fee is hereby granted, provided that the above
00013  * copyright notice and this permission notice appear in all copies.
00014  *
00015  * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES
00016  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
00017  * MERCHANTABILITY AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR
00018  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
00019  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
00020  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
00021  * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
00022  *
00023  *   Internet Systems Consortium, Inc.
00024  *   950 Charter Street
00025  *   Redwood City, CA 94063
00026  *   <info@isc.org>
00027  *   https://www.isc.org/
00028  *
00029  * This software was written for RadioMail Corporation by Ted Lemon
00030  * under a contract with Vixie Enterprises.   Further modifications have
00031  * been made for Internet Systems Consortium under a contract
00032  * with Vixie Laboratories.
00033  */
00034 
00035 #if !defined (__ISC_DHCP_CDEFS_H__)
00036 #define __ISC_DHCP_CDEFS_H__
00037 /* Delete attributes if not gcc or not the right version of gcc. */
00038 #if !defined(__GNUC__) || __GNUC__ < 2 || \
00039         (__GNUC__ == 2 && __GNUC_MINOR__ < 5) || defined (darwin)
00040 #define __attribute__(x)
00041 #endif
00042 
00043 /* The following macro handles the case of unwanted return values.  In
00044  * GCC one can specify an attribute for a function to generate a warning
00045  * if the return value of the function is ignored and one can't dispose of
00046  * the warning by the use of void.  In conjunction with the use of -Werror
00047  * these warnings prohibit the compilation of the package.  This macro
00048  * allows us to assign the return value to a variable and then ignore it.
00049  *
00050  * __attribute__((unused)) is added for avoiding another warning about set,
00051  * but unused variable. This is produced by unused-but-set-variable switch
00052  * that is enabled by default in gcc 4.6.
00053  */
00054 #if !defined(__GNUC__) || (__GNUC__ < 4)
00055 #define IGNORE_RET(x) (void) x
00056 #else
00057 #define IGNORE_RET(x)                   \
00058         do {                            \
00059                 int __attribute__((unused)) ignore_return ;\
00060                 ignore_return = x;                         \
00061         } while (0)
00062 #endif
00063 
00064 /* This macro is defined to avoid unused-but-set-variable warning
00065  * that is enabled in gcc 4.6 
00066  */
00067 
00068 #define IGNORE_UNUSED(x) { x = x; }
00069 
00070 #endif /* __ISC_DHCP_CDEFS_H__ */

Generated on 5 Apr 2014 for ISC DHCP by  doxygen 1.6.1