Print this page
5910 libnisdb won't build with modern GCC
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/lib/libnisdb/db_vers_c.x
+++ new/usr/src/lib/libnisdb/db_vers_c.x
1 1 /*
2 2 * CDDL HEADER START
3 3 *
4 4 * The contents of this file are subject to the terms of the
5 5 * Common Development and Distribution License, Version 1.0 only
6 6 * (the "License"). You may not use this file except in compliance
7 7 * with the License.
8 8 *
9 9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 10 * or http://www.opensolaris.org/os/licensing.
11 11 * See the License for the specific language governing permissions
12 12 * and limitations under the License.
13 13 *
14 14 * When distributing Covered Code, include this CDDL HEADER in each
↓ open down ↓ |
14 lines elided |
↑ open up ↑ |
15 15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 16 * If applicable, add the following below this CDDL HEADER, with the
17 17 * fields enclosed by brackets "[]" replaced with your own identifying
18 18 * information: Portions Copyright [yyyy] [name of copyright owner]
19 19 *
20 20 * CDDL HEADER END
21 21 */
22 22 /*
23 23 * db_vers_c.x
24 24 *
25 + * Copyright 2015 Gary Mills
25 26 * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
26 27 * Use is subject to license terms.
27 28 */
28 29
29 -%#pragma ident "%Z%%M% %I% %E% SMI"
30 +#if RPC_XDR
31 +%#include "ldap_xdr.h"
32 +#endif /* RPC_XDR */
30 33
31 34 #if RPC_HDR
32 35 %#ifndef _DB_VERS_H
33 36 %#define _DB_VERS_H
34 37 #endif /* RPC_HDR */
35 38
36 39 %/* 'vers' is the version identifier. */
37 40
38 41 %
39 42 %#include "nisdb_rw.h"
40 43 %
41 44 #if RPC_HDR || RPC_XDR
42 45 #ifdef USINGC
43 46 struct vers {
44 47 u_int vers_high;
45 48 u_int vers_low;
46 49 u_int time_sec;
47 50 u_int time_usec;
48 51 __nisdb_rwlock_t vers_rwlock;
49 52 };
50 53 #endif /* USINGC */
51 54 #endif /* RPC_HDR */
52 55
53 56 #ifndef USINGC
54 57 #ifdef RPC_HDR
55 58 %class vers {
56 59 % unsigned int vers_high; /* major version number, tracks checkpoints */
57 60 % unsigned int vers_low; /* minor version number, tracks updates. */
58 61 % unsigned int time_sec; /* time stamp */
59 62 % unsigned int time_usec;
60 63 % STRUCTRWLOCK(vers);
61 64 % public:
62 65 %/* No argument constructor. All entries initialized to zero. */
63 66 % vers() {
64 67 % vers_high = vers_low = time_sec = time_usec = 0;
65 68 % INITRW(vers);
66 69 % }
67 70 %
68 71 %/* Constructor that makes copy of 'other'. */
69 72 % vers( vers *other );
70 73 %
71 74 %/* Constructor: create version with specified version numbers */
72 75 % vers( unsigned int high, unsigned int low) {
73 76 % vers_high = high; vers_low = low; time_sec = time_usec = 0;
74 77 % INITRW(vers);
75 78 % }
76 79 %
77 80 %/* Creates new 'vers' with next higher minor version.
78 81 % If minor version exceeds MAXLOW, bump up major version instead.
79 82 % Set timestamp to that of the current time. */
80 83 % vers* nextminor();
81 84 %
82 85 %/* Creates new 'vers' with next higher major version.
83 86 % Set timestamp to that of the current time. */
84 87 % vers* nextmajor();
85 88 %
86 89 %/* Set this 'vers' to hold values found in 'others'. */
87 90 % void assign( vers *other );
88 91 %
89 92 %/* Predicate indicating whether this vers is earlier than 'other' in
90 93 % terms of version numbers. */
91 94 % bool_t earlier_than( vers *other );
92 95 %
93 96 %/* Print the value of this 'vers' to specified file. */
94 97 % void print( FILE *file );
95 98 %
96 99 %/* Zero out this vers. */
97 100 % void zero();
98 101 %
99 102 %/* Predicate indicating whether this vers is equal to 'other'. */
100 103 % bool_t equal( vers *other);
101 104 %
102 105 %/* Locking methods */
103 106 %
104 107 % int acqexcl(void) {
105 108 % return (WLOCK(vers));
106 109 % }
107 110 %
108 111 % int relexcl(void) {
109 112 % return (WULOCK(vers));
110 113 % }
111 114 %
112 115 % int acqnonexcl(void) {
113 116 % return (RLOCK(vers));
114 117 % }
115 118 %
116 119 % int relnonexcl(void) {
117 120 % return (RULOCK(vers));
118 121 % }
119 122 %};
120 123 #endif /* RPC_HDR */
121 124 #endif /* USINGC */
122 125
123 126 #if RPC_HDR
124 127 %#endif /* VERS_H */
125 128 #endif /* RPC_HDR */
↓ open down ↓ |
86 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX