]> git.ipfire.org Git - thirdparty/dhcp.git/blob - includes/cdefs.h
a0459e6847554a7ff1de4ebfb292790ed8c3c1a6
[thirdparty/dhcp.git] / includes / cdefs.h
1 /* cdefs.h
2
3 Standard C definitions... */
4
5 /*
6 * Copyright (c) 1995 RadioMail Corporation. All rights reserved.
7 * Copyright (c) 2011 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 #if (defined (__GNUC__) || defined (__STDC__)) && !defined (BROKEN_ANSI)
44 #define PROTO(x) x
45 #define KandR(x)
46 #define ANSI_DECL(x) x
47 #if defined (__GNUC__)
48 #define INLINE inline
49 #else
50 #define INLINE
51 #endif /* __GNUC__ */
52 #else
53 #define PROTO(x) ()
54 #define KandR(x) x
55 #define ANSI_DECL(x)
56 #define INLINE
57 #endif /* __GNUC__ || __STDC__ */
58
59 /* The following macro handles the case of unwanted return values. In
60 * GCC one can specify an attribute for a function to generate a warning
61 * if the return value of the function is ignored and one can't dispose of
62 * the warning by the use of void. In conjunction with the use of -Werror
63 * these warnings prohibit the compilation of the package. This macro
64 * allows us to assign the return value to a variable and then ignore it.
65 */
66 #if !defined(__GNUC__) || (__GNUC__ < 4)
67 #define IGNORE_RET(x) (void) x
68 #else
69 #define IGNORE_RET(x) \
70 do { \
71 int ignore_return; \
72 ignore_return = x; \
73 } while (0)
74 #endif
75
76 #endif /* __ISC_DHCP_CDEFS_H__ */