1: /* cdefs.h
2:
3: Standard C definitions... */
4:
5: /*
6: * Copyright (c) 1995 RadioMail Corporation. All rights reserved.
7: * Copyright (c) 2011,2012 by Internet Systems Consortium, Inc. ("ISC")
8: * Copyright (c) 2004,2009 by Internet Systems Consortium, Inc. ("ISC")
9: * Copyright (c) 1996-2003 by Internet Software Consortium
10: *
11: * Permission to use, copy, modify, and distribute this software for any
12: * purpose with or without fee is hereby granted, provided that the above
13: * copyright notice and this permission notice appear in all copies.
14: *
15: * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES
16: * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
17: * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR
18: * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
19: * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
20: * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
21: * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
22: *
23: * Internet Systems Consortium, Inc.
24: * 950 Charter Street
25: * Redwood City, CA 94063
26: * <info@isc.org>
27: * https://www.isc.org/
28: *
29: * This software was written for RadioMail Corporation by Ted Lemon
30: * under a contract with Vixie Enterprises. Further modifications have
31: * been made for Internet Systems Consortium under a contract
32: * with Vixie Laboratories.
33: */
34:
35: #if !defined (__ISC_DHCP_CDEFS_H__)
36: #define __ISC_DHCP_CDEFS_H__
37: /* Delete attributes if not gcc or not the right version of gcc. */
38: #if !defined(__GNUC__) || __GNUC__ < 2 || \
39: (__GNUC__ == 2 && __GNUC_MINOR__ < 5) || defined (darwin)
40: #define __attribute__(x)
41: #endif
42:
43: /* The following macro handles the case of unwanted return values. In
44: * GCC one can specify an attribute for a function to generate a warning
45: * if the return value of the function is ignored and one can't dispose of
46: * the warning by the use of void. In conjunction with the use of -Werror
47: * these warnings prohibit the compilation of the package. This macro
48: * allows us to assign the return value to a variable and then ignore it.
49: *
50: * __attribute__((unused)) is added for avoiding another warning about set,
51: * but unused variable. This is produced by unused-but-set-variable switch
52: * that is enabled by default in gcc 4.6.
53: */
54: #if !defined(__GNUC__) || (__GNUC__ < 4)
55: #define IGNORE_RET(x) (void) x
56: #else
57: #define IGNORE_RET(x) \
58: do { \
59: int __attribute__((unused)) ignore_return ;\
60: ignore_return = x; \
61: } while (0)
62: #endif
63:
64: /* This macro is defined to avoid unused-but-set-variable warning
65: * that is enabled in gcc 4.6
66: */
67:
68: #define IGNORE_UNUSED(x) { x = x; }
69:
70: #endif /* __ISC_DHCP_CDEFS_H__ */
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>