annotate union.h @ 191:c8d4ab9aeff0

don't use "remove" as a local variable; fails on gcc4.1 (because of remove() in stdio.h)
author David A. Holland
date Fri, 12 Jun 2015 20:06:55 -0400
parents d359d9b86327
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
184
d359d9b86327 Don't rely on anonymous unions.
David A. Holland
parents:
diff changeset
1 /*-
d359d9b86327 Don't rely on anonymous unions.
David A. Holland
parents:
diff changeset
2 * Copyright (c) 2015 The NetBSD Foundation, Inc.
d359d9b86327 Don't rely on anonymous unions.
David A. Holland
parents:
diff changeset
3 * All rights reserved.
d359d9b86327 Don't rely on anonymous unions.
David A. Holland
parents:
diff changeset
4 *
d359d9b86327 Don't rely on anonymous unions.
David A. Holland
parents:
diff changeset
5 * This code is derived from software contributed to The NetBSD Foundation
d359d9b86327 Don't rely on anonymous unions.
David A. Holland
parents:
diff changeset
6 * by David A. Holland.
d359d9b86327 Don't rely on anonymous unions.
David A. Holland
parents:
diff changeset
7 *
d359d9b86327 Don't rely on anonymous unions.
David A. Holland
parents:
diff changeset
8 * Redistribution and use in source and binary forms, with or without
d359d9b86327 Don't rely on anonymous unions.
David A. Holland
parents:
diff changeset
9 * modification, are permitted provided that the following conditions
d359d9b86327 Don't rely on anonymous unions.
David A. Holland
parents:
diff changeset
10 * are met:
d359d9b86327 Don't rely on anonymous unions.
David A. Holland
parents:
diff changeset
11 * 1. Redistributions of source code must retain the above copyright
d359d9b86327 Don't rely on anonymous unions.
David A. Holland
parents:
diff changeset
12 * notice, this list of conditions and the following disclaimer.
d359d9b86327 Don't rely on anonymous unions.
David A. Holland
parents:
diff changeset
13 * 2. Redistributions in binary form must reproduce the above copyright
d359d9b86327 Don't rely on anonymous unions.
David A. Holland
parents:
diff changeset
14 * notice, this list of conditions and the following disclaimer in the
d359d9b86327 Don't rely on anonymous unions.
David A. Holland
parents:
diff changeset
15 * documentation and/or other materials provided with the distribution.
d359d9b86327 Don't rely on anonymous unions.
David A. Holland
parents:
diff changeset
16 *
d359d9b86327 Don't rely on anonymous unions.
David A. Holland
parents:
diff changeset
17 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
d359d9b86327 Don't rely on anonymous unions.
David A. Holland
parents:
diff changeset
18 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
d359d9b86327 Don't rely on anonymous unions.
David A. Holland
parents:
diff changeset
19 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
d359d9b86327 Don't rely on anonymous unions.
David A. Holland
parents:
diff changeset
20 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
d359d9b86327 Don't rely on anonymous unions.
David A. Holland
parents:
diff changeset
21 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
d359d9b86327 Don't rely on anonymous unions.
David A. Holland
parents:
diff changeset
22 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
d359d9b86327 Don't rely on anonymous unions.
David A. Holland
parents:
diff changeset
23 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
d359d9b86327 Don't rely on anonymous unions.
David A. Holland
parents:
diff changeset
24 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
d359d9b86327 Don't rely on anonymous unions.
David A. Holland
parents:
diff changeset
25 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
d359d9b86327 Don't rely on anonymous unions.
David A. Holland
parents:
diff changeset
26 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
d359d9b86327 Don't rely on anonymous unions.
David A. Holland
parents:
diff changeset
27 * POSSIBILITY OF SUCH DAMAGE.
d359d9b86327 Don't rely on anonymous unions.
David A. Holland
parents:
diff changeset
28 */
d359d9b86327 Don't rely on anonymous unions.
David A. Holland
parents:
diff changeset
29
d359d9b86327 Don't rely on anonymous unions.
David A. Holland
parents:
diff changeset
30 #if defined(__clang__) || defined(__GNUC__) || __STDC__ > 201101
d359d9b86327 Don't rely on anonymous unions.
David A. Holland
parents:
diff changeset
31 #define UN
d359d9b86327 Don't rely on anonymous unions.
David A. Holland
parents:
diff changeset
32 #undef NEED_UNION_ACCESSORS
d359d9b86327 Don't rely on anonymous unions.
David A. Holland
parents:
diff changeset
33 #else
d359d9b86327 Don't rely on anonymous unions.
David A. Holland
parents:
diff changeset
34 #define UN un
d359d9b86327 Don't rely on anonymous unions.
David A. Holland
parents:
diff changeset
35 #define NEED_UNION_ACCESSORS
d359d9b86327 Don't rely on anonymous unions.
David A. Holland
parents:
diff changeset
36 #endif