| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: util.h,v 1.7 2012/06/05 00:42:41 christos Exp $ */ | | 1 | /* $NetBSD: util.h,v 1.8 2013/11/02 17:12:23 christos Exp $ */ |
2 | | | 2 | |
3 | /* | | 3 | /* |
4 | * Copyright (C) 2004-2007, 2010-2012 Internet Systems Consortium, Inc. ("ISC") | | 4 | * Copyright (C) 2004-2007, 2010-2012 Internet Systems Consortium, Inc. ("ISC") |
5 | * Copyright (C) 1998-2001 Internet Software Consortium. | | 5 | * Copyright (C) 1998-2001 Internet Software Consortium. |
6 | * | | 6 | * |
7 | * Permission to use, copy, modify, and/or distribute this software for any | | 7 | * Permission to use, copy, modify, and/or distribute this software for any |
8 | * purpose with or without fee is hereby granted, provided that the above | | 8 | * purpose with or without fee is hereby granted, provided that the above |
9 | * copyright notice and this permission notice appear in all copies. | | 9 | * copyright notice and this permission notice appear in all copies. |
10 | * | | 10 | * |
11 | * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH | | 11 | * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH |
12 | * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY | | 12 | * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY |
13 | * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, | | 13 | * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, |
14 | * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM | | 14 | * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM |
| @@ -67,27 +67,27 @@ | | | @@ -67,27 +67,27 @@ |
67 | * situation. | | 67 | * situation. |
68 | */ | | 68 | */ |
69 | #define DE_CONST(konst, var) \ | | 69 | #define DE_CONST(konst, var) \ |
70 | do { \ | | 70 | do { \ |
71 | union { const void *k; void *v; } _u; \ | | 71 | union { const void *k; void *v; } _u; \ |
72 | _u.k = konst; \ | | 72 | _u.k = konst; \ |
73 | var = _u.v; \ | | 73 | var = _u.v; \ |
74 | } while (/*CONSTCOND*/0) | | 74 | } while (/*CONSTCOND*/0) |
75 | | | 75 | |
76 | /*% | | 76 | /*% |
77 | * Use this in translation units that would otherwise be empty, to | | 77 | * Use this in translation units that would otherwise be empty, to |
78 | * suppress compiler warnings. | | 78 | * suppress compiler warnings. |
79 | */ | | 79 | */ |
80 | #define EMPTY_TRANSLATION_UNIT static void isc__empty(void) { isc__empty(); } | | 80 | #define EMPTY_TRANSLATION_UNIT static void __used isc__empty(void) { isc__empty(); } |
81 | | | 81 | |
82 | /*% | | 82 | /*% |
83 | * We use macros instead of calling the routines directly because | | 83 | * We use macros instead of calling the routines directly because |
84 | * the capital letters make the locking stand out. | | 84 | * the capital letters make the locking stand out. |
85 | * We RUNTIME_CHECK for success since in general there's no way | | 85 | * We RUNTIME_CHECK for success since in general there's no way |
86 | * for us to continue if they fail. | | 86 | * for us to continue if they fail. |
87 | */ | | 87 | */ |
88 | | | 88 | |
89 | #ifdef ISC_UTIL_TRACEON | | 89 | #ifdef ISC_UTIL_TRACEON |
90 | #define ISC_UTIL_TRACE(a) a | | 90 | #define ISC_UTIL_TRACE(a) a |
91 | #include <stdio.h> /* Required for fprintf/stderr when tracing. */ | | 91 | #include <stdio.h> /* Required for fprintf/stderr when tracing. */ |
92 | #include <isc/msgs.h> /* Required for isc_msgcat when tracing. */ | | 92 | #include <isc/msgs.h> /* Required for isc_msgcat when tracing. */ |
93 | #else | | 93 | #else |