aboutsummaryrefslogtreecommitdiffstats
path: root/main/libtirpc/fix-cdefs.patch
blob: ed5b1a1bb562050343d9c5340b0367cd8cd234c9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
--- libtirpc-0.2.3.orig/src/auth_des.c
+++ libtirpc-0.2.3/src/auth_des.c
@@ -38,7 +38,6 @@
 #include <string.h>
 #include <stdlib.h>
 #include <unistd.h>
-#include <sys/cdefs.h>
 #include <rpc/des_crypt.h>
 #include <syslog.h>
 #include <rpc/types.h>
@@ -52,7 +51,6 @@
 
 #if defined(LIBC_SCCS) && !defined(lint)
 #endif
-#include <sys/cdefs.h>
 
 #define USEC_PER_SEC		1000000
 #define RTIME_TIMEOUT		5	/* seconds to wait for sync */
--- libtirpc-0.2.3.orig/src/auth_none.c
+++ libtirpc-0.2.3/src/auth_none.c
@@ -31,7 +31,6 @@
 static char *sccsid = "@(#)auth_none.c 1.19 87/08/11 Copyr 1984 Sun Micro";
 static char *sccsid = "@(#)auth_none.c	2.1 88/07/29 4.0 RPCSRC";
 #endif
-#include <sys/cdefs.h>
 __FBSDID("$FreeBSD: src/lib/libc/rpc/auth_none.c,v 1.12 2002/03/22 23:18:35 obrien Exp $");
 */
 
--- libtirpc-0.2.3.orig/src/auth_time.c
+++ libtirpc-0.2.3/src/auth_time.c
@@ -25,7 +25,6 @@
  *	needed to deal with TCP connections.
  */
 
-#include <sys/cdefs.h>
 #include <stdio.h>
 #include <syslog.h>
 #include <string.h>
--- libtirpc-0.2.3.orig/src/auth_unix.c
+++ libtirpc-0.2.3/src/auth_unix.c
@@ -26,7 +26,6 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 
-#include <sys/cdefs.h>
 
 /*
  * auth_unix.c, Implements UNIX style authentication parameters.
--- libtirpc-0.2.3.orig/src/authdes_prot.c
+++ libtirpc-0.2.3/src/authdes_prot.c
@@ -1,4 +1,3 @@
-#include <sys/cdefs.h>
 /*
  * Copyright (c) 2009, Sun Microsystems, Inc.
  * All rights reserved.
--- libtirpc-0.2.3.orig/src/authunix_prot.c
+++ libtirpc-0.2.3/src/authunix_prot.c
@@ -26,7 +26,6 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 
-#include <sys/cdefs.h>
 
 /*
  * authunix_prot.c
--- libtirpc-0.2.3.orig/src/bindresvport.c
+++ libtirpc-0.2.3/src/bindresvport.c
@@ -26,7 +26,6 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 
-#include <sys/cdefs.h>
 
 /*
  * Copyright (c) 1987 by Sun Microsystems, Inc.
@@ -40,6 +39,7 @@
 #include <netinet/in.h>
 
 #include <errno.h>
+#include <netdb.h>
 #include <string.h>
 #include <unistd.h>
 
--- libtirpc-0.2.3.orig/src/clnt_bcast.c
+++ libtirpc-0.2.3/src/clnt_bcast.c
@@ -28,7 +28,6 @@
 /*
  * Copyright (c) 1986-1991 by Sun Microsystems Inc. 
  */
-#include <sys/cdefs.h>
 
 /*
  * clnt_bcast.c
--- libtirpc-0.2.3.orig/src/clnt_perror.c
+++ libtirpc-0.2.3/src/clnt_perror.c
@@ -27,7 +27,6 @@
  */
 
 /*
-#include <sys/cdefs.h>
 */
 /*
  * clnt_perror.c
--- libtirpc-0.2.3.orig/src/clnt_simple.c
+++ libtirpc-0.2.3/src/clnt_simple.c
@@ -29,7 +29,6 @@
  * Copyright (c) 1986-1991 by Sun Microsystems Inc. 
  */
 
-#include <sys/cdefs.h>
 
 /*
  * clnt_simple.c
--- libtirpc-0.2.3.orig/src/crypt_client.c
+++ libtirpc-0.2.3/src/crypt_client.c
@@ -30,7 +30,6 @@
  * SUCH DAMAGE.
  */
 
-#include <sys/cdefs.h>
 
 #include <err.h>
 #include <sys/types.h>
--- libtirpc-0.2.3.orig/src/des_crypt.c
+++ libtirpc-0.2.3/src/des_crypt.c
@@ -39,7 +39,6 @@
 static char sccsid[] = "@(#)des_crypt.c	2.2 88/08/10 4.0 RPCSRC; from 1.13 88/02/08 SMI";
 #endif
 #endif
-#include <sys/cdefs.h>
 
 static int common_crypt( char *, char *, unsigned, unsigned, struct desparams * );
 int (*__des_crypt_LOCAL)() = 0;
--- libtirpc-0.2.3.orig/src/des_soft.c
+++ libtirpc-0.2.3/src/des_soft.c
@@ -1,5 +1,4 @@
-//#include <sys/cdefs.h>
-
+//
 /*
  * Copyright (c) 2009, Sun Microsystems, Inc.
  * All rights reserved.
--- libtirpc-0.2.3.orig/src/getnetconfig.c
+++ libtirpc-0.2.3/src/getnetconfig.c
@@ -32,7 +32,6 @@
  
 #include <pthread.h>
 #include <reentrant.h>
-#include <sys/cdefs.h>
 #include <stdio.h>
 #include <errno.h>
 #include <netconfig.h>
--- libtirpc-0.2.3.orig/src/getnetpath.c
+++ libtirpc-0.2.3/src/getnetpath.c
@@ -25,13 +25,11 @@
  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  * POSSIBILITY OF SUCH DAMAGE.
  */
-#include <sys/cdefs.h>
 
 /*
  * Copyright (c) 1989 by Sun Microsystems, Inc.
  */
 
-#include <sys/cdefs.h>
 #include <stdio.h>
 #include <errno.h>
 #include <netconfig.h>
--- libtirpc-0.2.3.orig/src/getpeereid.c
+++ libtirpc-0.2.3/src/getpeereid.c
@@ -24,7 +24,6 @@
  * SUCH DAMAGE.
  */
 
-#include <sys/cdefs.h>
 
 #include <sys/param.h>
 #include <sys/socket.h>
--- libtirpc-0.2.3.orig/src/getpublickey.c
+++ libtirpc-0.2.3/src/getpublickey.c
@@ -26,7 +26,6 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 /*
-#include <sys/cdefs.h>
 */
 
 /*
--- libtirpc-0.2.3.orig/src/key_call.c
+++ libtirpc-0.2.3/src/key_call.c
@@ -30,7 +30,6 @@
  */
 
 
-#include <sys/cdefs.h>
 
 /*
  * key_call.c, Interface to keyserver
--- libtirpc-0.2.3.orig/src/key_prot_xdr.c
+++ libtirpc-0.2.3/src/key_prot_xdr.c
@@ -33,7 +33,6 @@
  */
 /* Copyright (c)  1990, 1991 Sun Microsystems, Inc. */
 
-#include <sys/cdefs.h>
 
 /* 
  * Compiled from key_prot.x using rpcgen.
--- libtirpc-0.2.3.orig/src/mt_misc.c
+++ libtirpc-0.2.3/src/mt_misc.c
@@ -1,5 +1,4 @@
 
-#include <sys/cdefs.h>
 #include <pthread.h>
 #include <reentrant.h>
 #include <rpc/rpc.h>
--- libtirpc-0.2.3.orig/src/pmap_clnt.c
+++ libtirpc-0.2.3/src/pmap_clnt.c
@@ -26,7 +26,6 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 
-#include <sys/cdefs.h>
 
 /*
  * pmap_clnt.c
--- libtirpc-0.2.3.orig/src/pmap_getmaps.c
+++ libtirpc-0.2.3/src/pmap_getmaps.c
@@ -26,7 +26,6 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 
-#include <sys/cdefs.h>
 
 /*
  * pmap_getmap.c
--- libtirpc-0.2.3.orig/src/rpc_com.h
+++ libtirpc-0.2.3/src/rpc_com.h
@@ -40,7 +40,6 @@
 #ifndef _TIRPC_RPCCOM_H
 #define	_TIRPC_RPCCOM_H
 
-#include <sys/cdefs.h>
 
 /* #pragma ident	"@(#)rpc_com.h	1.11	93/07/05 SMI" */
 
@@ -54,7 +53,9 @@
 #define __RPC_GETXID(now) ((u_int32_t)getpid() ^ (u_int32_t)(now)->tv_sec ^ \
     (u_int32_t)(now)->tv_usec)
 
-__BEGIN_DECLS
+#ifdef __cplusplus
+extern "C" {
+#endif
 extern u_int __rpc_get_a_size(int);
 extern int __rpc_dtbsize(void);
 extern struct netconfig * __rpcgettp(int);
@@ -90,6 +91,8 @@
 SVCXPRT **__svc_xports;
 int __svc_maxrec;
 
-__END_DECLS
+#ifdef __cplusplus
+}
+#endif
 
 #endif /* _TIRPC_RPCCOM_H */
--- libtirpc-0.2.3.orig/src/rpc_generic.c
+++ libtirpc-0.2.3/src/rpc_generic.c
@@ -29,7 +29,6 @@
  * Copyright (c) 1986-1991 by Sun Microsystems Inc. 
  */
 
-#include <sys/cdefs.h>
 
 /*
  * rpc_generic.c, Miscl routines for RPC.
--- libtirpc-0.2.3.orig/src/rpcb_st_xdr.c
+++ libtirpc-0.2.3/src/rpcb_st_xdr.c
@@ -35,7 +35,6 @@
  * routines used with the rpcbind stats facility.
  */
 
-#include <sys/cdefs.h>
 
 #include <rpc/rpc.h>
 
--- libtirpc-0.2.3.orig/src/rpcdname.c
+++ libtirpc-0.2.3/src/rpcdname.c
@@ -25,7 +25,6 @@
  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  * POSSIBILITY OF SUCH DAMAGE.
  */
-#include <sys/cdefs.h>
 
 /*
  * rpcdname.c
--- libtirpc-0.2.3.orig/src/rpcsvc/nis.h
+++ libtirpc-0.2.3/src/rpcsvc/nis.h
@@ -35,7 +35,9 @@
 //#include <rpc/rpc.h>
 //#include <rpcsvc/nis_tags.h>
 
-__BEGIN_DECLS
+#ifdef __cplusplus
+extern "C" {
+#endif
 
 /*
  *	nis.h
@@ -537,6 +539,8 @@
 #define NIS_VERSION 3
 
 
-__END_DECLS
+#ifdef __cplusplus
+}
+#endif
 
 #endif /* ! _RPCSVC_NIS_H */
--- libtirpc-0.2.3.orig/src/svc_dg.c
+++ libtirpc-0.2.3/src/svc_dg.c
@@ -31,7 +31,6 @@
  * Copyright (c) 1986-1991 by Sun Microsystems Inc.
  */
 
-#include <sys/cdefs.h>
 
 /*
  * svc_dg.c, Server side for connectionless RPC.
--- libtirpc-0.2.3.orig/src/svc_simple.c
+++ libtirpc-0.2.3/src/svc_simple.c
@@ -29,7 +29,6 @@
  * Copyright (c) 1986-1991 by Sun Microsystems Inc. 
  */
 
-#include <sys/cdefs.h>
 
 /*
  * svc_simple.c
--- libtirpc-0.2.3.orig/src/svc_vc.c
+++ libtirpc-0.2.3/src/svc_vc.c
@@ -27,7 +27,6 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 
-#include <sys/cdefs.h>
 
 /*
  * svc_vc.c, Server side for Connection Oriented based RPC. 
--- libtirpc-0.2.3.orig/src/xdr.c
+++ libtirpc-0.2.3/src/xdr.c
@@ -26,7 +26,6 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 
-#include <sys/cdefs.h>
 
 /*
  * xdr.c, Generic XDR routines implementation.
--- libtirpc-0.2.3.orig/src/xdr_array.c
+++ libtirpc-0.2.3/src/xdr_array.c
@@ -27,7 +27,6 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 
-#include <sys/cdefs.h>
 
 /*
  * xdr_array.c, Generic XDR routines impelmentation.
--- libtirpc-0.2.3.orig/src/xdr_float.c
+++ libtirpc-0.2.3/src/xdr_float.c
@@ -27,7 +27,6 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 
-#include <sys/cdefs.h>
 
 /*
  * xdr_float.c, Generic XDR routines implementation.
--- libtirpc-0.2.3.orig/src/xdr_mem.c
+++ libtirpc-0.2.3/src/xdr_mem.c
@@ -26,7 +26,6 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 
-#include <sys/cdefs.h>
 
 /*
  * xdr_mem.h, XDR implementation using memory buffers.
--- libtirpc-0.2.3.orig/src/xdr_rec.c
+++ libtirpc-0.2.3/src/xdr_rec.c
@@ -27,8 +27,6 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 
-#include <sys/cdefs.h>
-#include <sys/cdefs.h>
 
 /*
  * xdr_rec.c, Implements TCP/IP based XDR streams with a "record marking"
--- libtirpc-0.2.3.orig/src/xdr_reference.c
+++ libtirpc-0.2.3/src/xdr_reference.c
@@ -26,8 +26,6 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 
-#include <sys/cdefs.h>
-#include <sys/cdefs.h>
 
 /*
  * xdr_reference.c, Generic XDR routines impelmentation.
--- libtirpc-0.2.3.orig/src/xdr_sizeof.c
+++ libtirpc-0.2.3/src/xdr_sizeof.c
@@ -34,7 +34,6 @@
  * when serialized using XDR.
  */
 
-#include <sys/cdefs.h>
 
 #include "namespace.h"
 #include <rpc/types.h>
--- libtirpc-0.2.3.orig/src/xdr_stdio.c
+++ libtirpc-0.2.3/src/xdr_stdio.c
@@ -26,7 +26,6 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 
-#include <sys/cdefs.h>
 
 /*
  * xdr_stdio.c, XDR implementation on standard i/o file.
--- libtirpc-0.2.3.orig/tirpc/misc/event.h
+++ libtirpc-0.2.3/tirpc/misc/event.h
@@ -186,15 +186,18 @@
 
 #else 	/* !_KERNEL */
 
-#include <sys/cdefs.h>
 struct timespec;
 
-__BEGIN_DECLS
+#ifdef __cplusplus
+extern "C" {
+#endif
 int     kqueue(void);
 int     kevent(int kq, const struct kevent *changelist, int nchanges,
 	    struct kevent *eventlist, int nevents,
 	    const struct timespec *timeout);
-__END_DECLS
+#ifdef __cplusplus
+}
+#endif
 
 #endif /* !_KERNEL */
 
--- libtirpc-0.2.3.orig/tirpc/netconfig.h
+++ libtirpc-0.2.3/tirpc/netconfig.h
@@ -74,7 +74,9 @@
 #define NC_UDP		"udp"
 #define NC_ICMP		"icmp"
 
-__BEGIN_DECLS
+#ifdef __cplusplus
+extern "C" {
+#endif
 
 extern void *setnetconfig (void);
 extern struct netconfig *getnetconfig (void *);
@@ -89,6 +91,8 @@
 extern void nc_perror (const char *);
 extern char *nc_sperror (void);
 
-__END_DECLS
+#ifdef __cplusplus
+}
+#endif
 
 #endif /* _NETCONFIG_H_ */
--- libtirpc-0.2.3.orig/tirpc/rpc/auth.h
+++ libtirpc-0.2.3/tirpc/rpc/auth.h
@@ -48,7 +48,6 @@
 
 #include <rpc/xdr.h>
 #include <rpc/clnt_stat.h>
-#include <sys/cdefs.h>
 #include <sys/socket.h>
 #include <sys/types.h>
 #include <stdio.h>
@@ -165,9 +164,13 @@
 	char c[8];
 };
 typedef union des_block des_block;
-__BEGIN_DECLS
+#ifdef __cplusplus
+extern "C" {
+#endif
 extern bool_t xdr_des_block(XDR *, des_block *);
-__END_DECLS
+#ifdef __cplusplus
+}
+#endif
 
 /*
  * Authentication info.  Opaque to client.
@@ -288,9 +291,13 @@
 		xfunc, xwhere))
 
 
-__BEGIN_DECLS
+#ifdef __cplusplus
+extern "C" {
+#endif
 extern struct opaque_auth _null_auth;
-__END_DECLS
+#ifdef __cplusplus
+}
+#endif
 
 /*
  * Any style authentication.  These routines can be used by any
@@ -311,11 +318,15 @@
  *	int len;
  *	int *aup_gids;
  */
-__BEGIN_DECLS
+#ifdef __cplusplus
+extern "C" {
+#endif
 extern AUTH *authunix_create(char *, uid_t, uid_t, int, uid_t *);
 extern AUTH *authunix_create_default(void);	/* takes no parameters */
 extern AUTH *authnone_create(void);		/* takes no parameters */
-__END_DECLS
+#ifdef __cplusplus
+}
+#endif
 /*
  * DES style authentication
  * AUTH *authsecdes_create(servername, window, timehost, ckey)
@@ -324,15 +335,23 @@
  * 	const char *timehost;			- optional hostname to sync with
  * 	des_block *ckey;		- optional conversation key to use
  */
-__BEGIN_DECLS
+#ifdef __cplusplus
+extern "C" {
+#endif
 extern AUTH *authdes_create (char *, u_int, struct sockaddr *, des_block *);
 extern AUTH *authdes_seccreate (const char *, const u_int, const  char *,
     const  des_block *);
-__END_DECLS
+#ifdef __cplusplus
+}
+#endif
 
-__BEGIN_DECLS
+#ifdef __cplusplus
+extern "C" {
+#endif
 extern bool_t xdr_opaque_auth		(XDR *, struct opaque_auth *);
-__END_DECLS
+#ifdef __cplusplus
+}
+#endif
 
 #define authsys_create(c,i1,i2,i3,ip) authunix_create((c),(i1),(i2),(i3),(ip))
 #define authsys_create_default() authunix_create_default()
@@ -340,36 +359,48 @@
 /*
  * Netname manipulation routines.
  */
-__BEGIN_DECLS
+#ifdef __cplusplus
+extern "C" {
+#endif
 extern int getnetname(char *);
 extern int host2netname(char *, const char *, const char *);
 extern int user2netname(char *, const uid_t, const char *);
 extern int netname2user(char *, uid_t *, gid_t *, int *, gid_t *);
 extern int netname2host(char *, char *, const int);
 extern void passwd2des ( char *, char * );
-__END_DECLS
+#ifdef __cplusplus
+}
+#endif
 
 /*
  *
  * These routines interface to the keyserv daemon
  *
  */
-__BEGIN_DECLS
+#ifdef __cplusplus
+extern "C" {
+#endif
 extern int key_decryptsession(const char *, des_block *);
 extern int key_encryptsession(const char *, des_block *);
 extern int key_gendes(des_block *);
 extern int key_setsecret(const char *);
 extern int key_secretkey_is_set(void);
-__END_DECLS
+#ifdef __cplusplus
+}
+#endif
 
 /*
  * Publickey routines.
  */
-__BEGIN_DECLS
+#ifdef __cplusplus
+extern "C" {
+#endif
 extern int getpublickey (const char *, char *);
 extern int getpublicandprivatekey (char *, char *);
 extern int getsecretkey (char *, char *, char *);
-__END_DECLS
+#ifdef __cplusplus
+}
+#endif
 
 #ifdef KERBEROS
 /*
@@ -382,10 +413,14 @@
  *	const char *timehost;			- optional hostname to sync with
  *	int *status;				- kerberos status returned
  */
-__BEGIN_DECLS
+#ifdef __cplusplus
+extern "C" {
+#endif
 extern AUTH	*authkerb_seccreate(const char *, const char *, const  char *,
 		    const u_int, const char *, int *);
-__END_DECLS
+#ifdef __cplusplus
+}
+#endif
 
 /*
  * Map a kerberos credential into a unix cred.
@@ -398,19 +433,27 @@
  *	int *groups;
  *
  */
-__BEGIN_DECLS
+#ifdef __cplusplus
+extern "C" {
+#endif
 extern int	authkerb_getucred(/* struct svc_req *, uid_t *, gid_t *,
 		    short *, int * */);
-__END_DECLS
+#ifdef __cplusplus
+}
+#endif
 #endif /* KERBEROS */
 
-__BEGIN_DECLS
+#ifdef __cplusplus
+extern "C" {
+#endif
 struct svc_req;
 struct rpc_msg;
 enum auth_stat _svcauth_none (struct svc_req *, struct rpc_msg *);
 enum auth_stat _svcauth_short (struct svc_req *, struct rpc_msg *);
 enum auth_stat _svcauth_unix (struct svc_req *, struct rpc_msg *);
-__END_DECLS
+#ifdef __cplusplus
+}
+#endif
 
 #define AUTH_NONE	0		/* no authentication */
 #define	AUTH_NULL	0		/* backward compatibility */
--- libtirpc-0.2.3.orig/tirpc/rpc/auth_des.h
+++ libtirpc-0.2.3/tirpc/rpc/auth_des.h
@@ -114,17 +114,25 @@
  * Map a des credential into a unix cred.
  *
  */
-__BEGIN_DECLS
+#ifdef __cplusplus
+extern "C" {
+#endif
 extern int authdes_getucred( struct authdes_cred *, uid_t *, gid_t *, int *, gid_t * );
-__END_DECLS
+#ifdef __cplusplus
+}
+#endif
 
-__BEGIN_DECLS
+#ifdef __cplusplus
+extern "C" {
+#endif
 extern bool_t	xdr_authdes_cred(XDR *, struct authdes_cred *);
 extern bool_t	xdr_authdes_verf(XDR *, struct authdes_verf *);
 extern int	rtime(dev_t, struct netbuf *, int, struct timeval *,
 		    struct timeval *);
 extern void	kgetnetname(char *);
 extern enum auth_stat _svcauth_des(struct svc_req *, struct rpc_msg *);
-__END_DECLS
+#ifdef __cplusplus
+}
+#endif
 
 #endif /* ndef _TI_AUTH_DES_ */
--- libtirpc-0.2.3.orig/tirpc/rpc/auth_gss.h
+++ libtirpc-0.2.3/tirpc/rpc/auth_gss.h
@@ -104,28 +104,32 @@
 #define MAXSEQ		0x80000000
 
 /* Prototypes. */
-__BEGIN_DECLS
-bool_t	xdr_rpc_gss_cred	__P((XDR *xdrs, struct rpc_gss_cred *p));
-bool_t	xdr_rpc_gss_init_args	__P((XDR *xdrs, gss_buffer_desc *p));
-bool_t	xdr_rpc_gss_init_res	__P((XDR *xdrs, struct rpc_gss_init_res *p));
-bool_t	xdr_rpc_gss_data	__P((XDR *xdrs, xdrproc_t xdr_func,
+#ifdef __cplusplus
+extern "C" {
+#endif
+bool_t	xdr_rpc_gss_cred	(XDR *xdrs, struct rpc_gss_cred *p);
+bool_t	xdr_rpc_gss_init_args	(XDR *xdrs, gss_buffer_desc *p);
+bool_t	xdr_rpc_gss_init_res	(XDR *xdrs, struct rpc_gss_init_res *p);
+bool_t	xdr_rpc_gss_data	(XDR *xdrs, xdrproc_t xdr_func,
 				     caddr_t xdr_ptr, gss_ctx_id_t ctx,
 				     gss_qop_t qop, rpc_gss_svc_t svc,
-				     u_int seq));
+				     u_int seq);
 
-AUTH   *authgss_create		__P((CLIENT *, gss_name_t,
-				     struct rpc_gss_sec *));
-AUTH   *authgss_create_default	__P((CLIENT *, char *, struct rpc_gss_sec *));
-bool_t authgss_service		__P((AUTH *auth, int svc));
-bool_t authgss_get_private_data	__P((AUTH *auth,
-	    			     struct authgss_private_data *));
-bool_t authgss_free_private_data __P((struct authgss_private_data *));
+AUTH   *authgss_create		(CLIENT *, gss_name_t,
+				     struct rpc_gss_sec *);
+AUTH   *authgss_create_default	(CLIENT *, char *, struct rpc_gss_sec *);
+bool_t authgss_service		(AUTH *auth, int svc);
+bool_t authgss_get_private_data	(AUTH *auth,
+	    			     struct authgss_private_data *);
+bool_t authgss_free_private_data (struct authgss_private_data *);
 
-void	gss_log_debug		__P((const char *fmt, ...));
-void	gss_log_status		__P((char *m, OM_uint32 major,
-				     OM_uint32 minor));
-void	gss_log_hexdump		__P((const u_char *buf, int len, int offset));
+void	gss_log_debug		(const char *fmt, ...);
+void	gss_log_status		(char *m, OM_uint32 major,
+				     OM_uint32 minor);
+void	gss_log_hexdump		(const u_char *buf, int len, int offset);
 
-__END_DECLS
+#ifdef __cplusplus
+}
+#endif
 
 #endif /* !_TIRPC_AUTH_GSS_H */
--- libtirpc-0.2.3.orig/tirpc/rpc/auth_unix.h
+++ libtirpc-0.2.3/tirpc/rpc/auth_unix.h
@@ -45,7 +45,6 @@
 
 #ifndef _TIRPC_AUTH_UNIX_H
 #define _TIRPC_AUTH_UNIX_H
-#include <sys/cdefs.h>
 
 /* The machine name is part of a credential; it may not exceed 255 bytes */
 #define MAX_MACHINE_NAME 255
@@ -67,9 +66,13 @@
 
 #define authsys_parms authunix_parms
 
-__BEGIN_DECLS
+#ifdef __cplusplus
+extern "C" {
+#endif
 extern bool_t xdr_authunix_parms(XDR *, struct authunix_parms *);
-__END_DECLS
+#ifdef __cplusplus
+}
+#endif
 
 /*
  * If a response verifier has flavor AUTH_SHORT,
--- libtirpc-0.2.3.orig/tirpc/rpc/clnt.h
+++ libtirpc-0.2.3/tirpc/rpc/clnt.h
@@ -42,7 +42,6 @@
 #include <rpc/clnt_stat.h>
 #include <rpc/auth.h>
 
-#include <sys/cdefs.h>
 #include <netconfig.h>
 #include <sys/un.h>
 
@@ -267,7 +266,9 @@
  * Generic client creation routine. Supported protocols are those that
  * belong to the nettype namespace (/etc/netconfig).
  */
-__BEGIN_DECLS
+#ifdef __cplusplus
+extern "C" {
+#endif
 extern CLIENT *clnt_create(const char *, const rpcprog_t, const rpcvers_t,
 			   const char *);
 /*
@@ -414,32 +415,46 @@
  */
 extern CLIENT *clnt_raw_create(rpcprog_t, rpcvers_t);
 
-__END_DECLS
+#ifdef __cplusplus
+}
+#endif
 
 
 /*
  * Print why creation failed
  */
-__BEGIN_DECLS
+#ifdef __cplusplus
+extern "C" {
+#endif
 extern void clnt_pcreateerror(const char *);			/* stderr */
 extern char *clnt_spcreateerror(const char *);			/* string */
-__END_DECLS
+#ifdef __cplusplus
+}
+#endif
 
 /*
  * Like clnt_perror(), but is more verbose in its output
  */
-__BEGIN_DECLS
+#ifdef __cplusplus
+extern "C" {
+#endif
 extern void clnt_perrno(enum clnt_stat);		/* stderr */
 extern char *clnt_sperrno(enum clnt_stat);		/* string */
-__END_DECLS
+#ifdef __cplusplus
+}
+#endif
 
 /*
  * Print an English error message, given the client error code
  */
-__BEGIN_DECLS
+#ifdef __cplusplus
+extern "C" {
+#endif
 extern void clnt_perror(CLIENT *, const char *);	 	/* stderr */
 extern char *clnt_sperror(CLIENT *, const char *);		/* string */
-__END_DECLS
+#ifdef __cplusplus
+}
+#endif
 
 
 /*
@@ -450,9 +465,13 @@
 	struct rpc_err cf_error; /* useful when cf_stat == RPC_PMAPFAILURE */
 };
 
-__BEGIN_DECLS
+#ifdef __cplusplus
+extern "C" {
+#endif
 extern struct rpc_createerr	*__rpc_createerr(void);
-__END_DECLS
+#ifdef __cplusplus
+}
+#endif
 #define get_rpc_createerr()	(*(__rpc_createerr()))
 #define rpc_createerr		(*(__rpc_createerr()))
 
@@ -469,12 +488,16 @@
  *	char *out;
  *	const char *nettype;
  */
-__BEGIN_DECLS
+#ifdef __cplusplus
+extern "C" {
+#endif
 extern enum clnt_stat rpc_call(const char *, const rpcprog_t,
 			       const rpcvers_t, const rpcproc_t,
 			       const xdrproc_t, const char *,
 			       const xdrproc_t, char *, const char *);
-__END_DECLS
+#ifdef __cplusplus
+}
+#endif
 
 /*
  * RPC broadcast interface
@@ -522,7 +545,9 @@
 
 typedef bool_t (*resultproc_t)(caddr_t, ...);
 
-__BEGIN_DECLS
+#ifdef __cplusplus
+extern "C" {
+#endif
 extern enum clnt_stat rpc_broadcast(const rpcprog_t, const rpcvers_t,
 				    const rpcproc_t, const xdrproc_t,
 				    caddr_t, const xdrproc_t, caddr_t,
@@ -532,7 +557,9 @@
 					caddr_t, const xdrproc_t, caddr_t,
 					const resultproc_t, const int,
 					const int, const char *);
-__END_DECLS
+#ifdef __cplusplus
+}
+#endif
 
 /* For backward compatibility */
 #include <rpc/clnt_soc.h>
--- libtirpc-0.2.3.orig/tirpc/rpc/clnt_soc.h
+++ libtirpc-0.2.3/tirpc/rpc/clnt_soc.h
@@ -46,7 +46,6 @@
  * with TS-RPC.
  */
 
-#include <sys/cdefs.h>
 
 #define UDPMSGSIZE      8800    /* rpc imposed limit on udp msg size */  
 
@@ -61,28 +60,40 @@
  *	u_int sendsz;
  *	u_int recvsz;
  */
-__BEGIN_DECLS
+#ifdef __cplusplus
+extern "C" {
+#endif
 extern CLIENT *clnttcp_create(struct sockaddr_in *, u_long, u_long, int *,
 			      u_int, u_int);
-__END_DECLS
+#ifdef __cplusplus
+}
+#endif
 
 /*
  * Raw (memory) rpc.
  */
-__BEGIN_DECLS
+#ifdef __cplusplus
+extern "C" {
+#endif
 extern CLIENT *clntraw_create(u_long, u_long);
-__END_DECLS
+#ifdef __cplusplus
+}
+#endif
 
 
 /*
 IPv6 socket version 
 */
 #ifdef INET6
-__BEGIN_DECLS
+#ifdef __cplusplus
+extern "C" {
+#endif
 extern CLIENT *clnttcp6_create(struct sockaddr_in6 *, u_long, u_long, int *,
 			      u_int, u_int);
-__END_DECLS
+#ifdef __cplusplus
+}
 #endif
+#endif
 
 /*
  * UDP based rpc.
@@ -105,7 +116,9 @@
  *	u_int sendsz;
  *	u_int recvsz;
  */
-__BEGIN_DECLS
+#ifdef __cplusplus
+extern "C" {
+#endif
 extern CLIENT *clntudp_create(struct sockaddr_in *, u_long, u_long, 
 			      struct timeval, int *);
 extern CLIENT *clntudp_bufcreate(struct sockaddr_in *, u_long, u_long,
@@ -116,7 +129,9 @@
 extern CLIENT *clntudp6_bufcreate(struct sockaddr_in6 *, u_long, u_long,
 				 struct timeval, int *, u_int, u_int);
 #endif
-__END_DECLS
+#ifdef __cplusplus
+}
+#endif
 
 
 #endif /* _RPC_CLNT_SOC_H */
--- libtirpc-0.2.3.orig/tirpc/rpc/des_crypt.h
+++ libtirpc-0.2.3/tirpc/rpc/des_crypt.h
@@ -43,7 +43,6 @@
 #ifndef _DES_DES_CRYPT_H
 #define _DES_DES_CRYPT_H
 
-#include <sys/cdefs.h>
 #include <rpc/rpc.h>
 
 #define DES_MAXDATA 8192	/* max bytes encrypted in one call */
@@ -83,23 +82,35 @@
 /*
  * Cipher Block Chaining mode
  */
-__BEGIN_DECLS
+#ifdef __cplusplus
+extern "C" {
+#endif
 int cbc_crypt( char *, char *, unsigned int, unsigned int, char *);
-__END_DECLS
+#ifdef __cplusplus
+}
+#endif
 
 /*
  * Electronic Code Book mode
  */
-__BEGIN_DECLS
+#ifdef __cplusplus
+extern "C" {
+#endif
 int ecb_crypt( char *, char *, unsigned int, unsigned int );
-__END_DECLS
+#ifdef __cplusplus
+}
+#endif
 
 /* 
  * Set des parity for a key.
  * DES parity is odd and in the low bit of each byte
  */
-__BEGIN_DECLS
+#ifdef __cplusplus
+extern "C" {
+#endif
 void des_setparity( char *);
-__END_DECLS
+#ifdef __cplusplus
+}
+#endif
 
 #endif  /* _DES_DES_CRYPT_H */
--- libtirpc-0.2.3.orig/tirpc/rpc/nettype.h
+++ libtirpc-0.2.3/tirpc/rpc/nettype.h
@@ -53,11 +53,15 @@
 #define	_RPC_TCP	7
 #define	_RPC_UDP	8
 
-__BEGIN_DECLS
+#ifdef __cplusplus
+extern "C" {
+#endif
 extern void *__rpc_setconf(const char *);
 extern void __rpc_endconf(void *);
 extern struct netconfig *__rpc_getconf(void *);
 extern struct netconfig *__rpc_getconfip(const char *);
-__END_DECLS
+#ifdef __cplusplus
+}
+#endif
 
 #endif	/* !_TIRPC_NETTYPE_H */
--- libtirpc-0.2.3.orig/tirpc/rpc/pmap_clnt.h
+++ libtirpc-0.2.3/tirpc/rpc/pmap_clnt.h
@@ -63,9 +63,10 @@
 
 #ifndef _RPC_PMAP_CLNT_H_
 #define _RPC_PMAP_CLNT_H_
-#include <sys/cdefs.h>
 
-__BEGIN_DECLS
+#ifdef __cplusplus
+extern "C" {
+#endif
 extern bool_t		pmap_set(u_long, u_long, int, int);
 extern bool_t		pmap_unset(u_long, u_long);
 extern struct pmaplist	*pmap_getmaps(struct sockaddr_in *);
@@ -80,6 +81,8 @@
 				       resultproc_t);
 extern u_short		pmap_getport(struct sockaddr_in *,
 				     u_long, u_long, u_int);
-__END_DECLS
+#ifdef __cplusplus
+}
+#endif
 
 #endif /* !_RPC_PMAP_CLNT_H_ */
--- libtirpc-0.2.3.orig/tirpc/rpc/pmap_prot.h
+++ libtirpc-0.2.3/tirpc/rpc/pmap_prot.h
@@ -71,7 +71,6 @@
 
 #ifndef _RPC_PMAP_PROT_H
 #define _RPC_PMAP_PROT_H
-#include <sys/cdefs.h>
 
 #define PMAPPORT		((u_short)111)
 #define PMAPPROG		((u_long)100000)
@@ -97,10 +96,14 @@
 	struct pmaplist *pml_next;
 };
 
-__BEGIN_DECLS
+#ifdef __cplusplus
+extern "C" {
+#endif
 extern bool_t xdr_pmap(XDR *, struct pmap *);
 extern bool_t xdr_pmaplist(XDR *, struct pmaplist **);
 extern bool_t xdr_pmaplist_ptr(XDR *, struct pmaplist *);
-__END_DECLS
+#ifdef __cplusplus
+}
+#endif
 
 #endif /* !_RPC_PMAP_PROT_H */
--- libtirpc-0.2.3.orig/tirpc/rpc/pmap_rmt.h
+++ libtirpc-0.2.3/tirpc/rpc/pmap_rmt.h
@@ -41,7 +41,6 @@
 
 #ifndef _RPC_PMAP_RMT_H
 #define _RPC_PMAP_RMT_H
-#include <sys/cdefs.h>
 
 struct rmtcallargs {
 	u_long prog, vers, proc, arglen;
@@ -56,9 +55,13 @@
 	xdrproc_t xdr_results;
 };
 
-__BEGIN_DECLS
+#ifdef __cplusplus
+extern "C" {
+#endif
 extern bool_t xdr_rmtcall_args(XDR *, struct rmtcallargs *);
 extern bool_t xdr_rmtcallres(XDR *, struct rmtcallres *);
-__END_DECLS
+#ifdef __cplusplus
+}
+#endif
 
 #endif /* !_RPC_PMAP_RMT_H */
--- libtirpc-0.2.3.orig/tirpc/rpc/rpc.h
+++ libtirpc-0.2.3/tirpc/rpc/rpc.h
@@ -79,9 +79,11 @@
 #define UDPMSGSIZE 8800
 #endif
 
-__BEGIN_DECLS
+#ifdef __cplusplus
+extern "C" {
+#endif
 extern int get_myaddress(struct sockaddr_in *);
-extern int bindresvport(int, struct sockaddr_in *) __THROW;
+extern int bindresvport(int, struct sockaddr_in *);
 extern int registerrpc(int, int, int, char *(*)(char [UDPMSGSIZE]),
     xdrproc_t, xdrproc_t);
 extern int callrpc(const char *, int, int, int, xdrproc_t, void *,
@@ -93,18 +95,24 @@
 
 struct sockaddr;
 extern int bindresvport_sa(int, struct sockaddr *);
-__END_DECLS
+#ifdef __cplusplus
+}
+#endif
 
 /*
  * The following are not exported interfaces, they are for internal library
  * and rpcbind use only. Do not use, they may change without notice.
  */
-__BEGIN_DECLS
+#ifdef __cplusplus
+extern "C" {
+#endif
 int __rpc_nconf2fd(const struct netconfig *);
 int __rpc_nconf2fd_flags(const struct netconfig *, int);
 int __rpc_nconf2sockinfo(const struct netconfig *, struct __rpc_sockinfo *);
 int __rpc_fd2sockinfo(int, struct __rpc_sockinfo *);
 u_int __rpc_get_t_size(int, int, int);
-__END_DECLS
+#ifdef __cplusplus
+}
+#endif
 
 #endif /* !_RPC_RPC_H */
--- libtirpc-0.2.3.orig/tirpc/rpc/rpc_com.h
+++ libtirpc-0.2.3/tirpc/rpc/rpc_com.h
@@ -41,7 +41,6 @@
 #ifndef _RPC_RPCCOM_H
 #define	_RPC_RPCCOM_H
 
-#include <sys/cdefs.h>
 
 /* #pragma ident	"@(#)rpc_com.h	1.11	93/07/05 SMI" */
 
@@ -55,7 +54,9 @@
 #define __RPC_GETXID(now) ((u_int32_t)getpid() ^ (u_int32_t)(now)->tv_sec ^ \
     (u_int32_t)(now)->tv_usec)
 
-__BEGIN_DECLS
+#ifdef __cplusplus
+extern "C" {
+#endif
 extern u_int __rpc_get_a_size(int);
 extern int __rpc_dtbsize(void);
 extern int _rpc_dtablesize(void);
@@ -77,6 +78,8 @@
 
 char *_get_next_token(char *, int);
 
-__END_DECLS
+#ifdef __cplusplus
+}
+#endif
 
 #endif /* _RPC_RPCCOM_H */
--- libtirpc-0.2.3.orig/tirpc/rpc/rpc_msg.h
+++ libtirpc-0.2.3/tirpc/rpc/rpc_msg.h
@@ -161,7 +161,9 @@
 #define	acpted_rply	ru.RM_rmb.ru.RP_ar
 #define	rjcted_rply	ru.RM_rmb.ru.RP_dr
 
-__BEGIN_DECLS
+#ifdef __cplusplus
+extern "C" {
+#endif
 /*
  * XDR routine to handle a rpc message.
  * xdr_callmsg(xdrs, cmsg)
@@ -210,6 +212,8 @@
  * 	struct rpc_err *error;
  */
 extern void	_seterr_reply(struct rpc_msg *, struct rpc_err *);
-__END_DECLS
+#ifdef __cplusplus
+}
+#endif
 
 #endif /* !_TIRPC_RPC_MSG_H */
--- libtirpc-0.2.3.orig/tirpc/rpc/rpcb_clnt.h
+++ libtirpc-0.2.3/tirpc/rpc/rpcb_clnt.h
@@ -59,7 +59,9 @@
 
 #include <rpc/types.h>
 #include <rpc/rpcb_prot.h>
-__BEGIN_DECLS
+#ifdef __cplusplus
+extern "C" {
+#endif
 extern bool_t rpcb_set(const rpcprog_t, const rpcvers_t,
 		       const struct netconfig  *, const struct netbuf *);
 extern bool_t rpcb_unset(const rpcprog_t, const rpcvers_t,
@@ -78,6 +80,8 @@
 extern bool_t rpcb_gettime(const char *, time_t *);
 extern char *rpcb_taddr2uaddr(struct netconfig *, struct netbuf *);
 extern struct netbuf *rpcb_uaddr2taddr(struct netconfig *, char *);
-__END_DECLS
+#ifdef __cplusplus
+}
+#endif
 
 #endif	/* !_RPC_RPCB_CLNT_H */
--- libtirpc-0.2.3.orig/tirpc/rpc/rpcent.h
+++ libtirpc-0.2.3/tirpc/rpc/rpcent.h
@@ -44,10 +44,12 @@
 /*	#pragma ident "@(#)rpcent.h   1.13    94/04/25 SMI"	*/
 /*      @(#)rpcent.h 1.1 88/12/06 SMI   */
 
-__BEGIN_DECLS
+#ifdef __cplusplus
+extern "C" {
+#endif
 
 /* These are defined in /usr/include/rpc/netdb.h */
-#if 0
+#if !defined(__GLIBC__)
 struct rpcent {
 	char	*r_name;	/* name of server for this rpc program */
 	char	**r_aliases;	/* alias list */
@@ -60,8 +62,10 @@
 extern struct rpcent *getrpcent(void);
 #endif
 
-extern void setrpcent(int) __THROW;
-extern void endrpcent(void) __THROW;
-__END_DECLS
+extern void setrpcent(int);
+extern void endrpcent(void);
+#ifdef __cplusplus
+}
+#endif
 
 #endif /* !_RPC_CENT_H */
--- libtirpc-0.2.3.orig/tirpc/rpc/svc.h
+++ libtirpc-0.2.3/tirpc/rpc/svc.h
@@ -40,7 +40,6 @@
 
 #ifndef _TIRPC_SVC_H
 #define _TIRPC_SVC_H
-#include <sys/cdefs.h>
 
 /*
  * This interface must manage two items concerning remote procedure calling:
@@ -200,11 +199,15 @@
  *	const struct netconfig *nconf;
  */
 
-__BEGIN_DECLS
+#ifdef __cplusplus
+extern "C" {
+#endif
 extern bool_t	svc_reg(SVCXPRT *, const rpcprog_t, const rpcvers_t,
 			void (*)(struct svc_req *, SVCXPRT *),
 			const struct netconfig *);
-__END_DECLS
+#ifdef __cplusplus
+}
+#endif
 
 /*
  * Service un-registration
@@ -214,9 +217,13 @@
  *	const rpcvers_t vers;
  */
 
-__BEGIN_DECLS
+#ifdef __cplusplus
+extern "C" {
+#endif
 extern void	svc_unreg(const rpcprog_t, const rpcvers_t);
-__END_DECLS
+#ifdef __cplusplus
+}
+#endif
 
 /*
  * Transport registration.
@@ -224,9 +231,13 @@
  * xprt_register(xprt)
  *	SVCXPRT *xprt;
  */
-__BEGIN_DECLS
+#ifdef __cplusplus
+extern "C" {
+#endif
 extern void	xprt_register(SVCXPRT *);
-__END_DECLS
+#ifdef __cplusplus
+}
+#endif
 
 /*
  * Transport un-register
@@ -234,9 +245,13 @@
  * xprt_unregister(xprt)
  *	SVCXPRT *xprt;
  */
-__BEGIN_DECLS
+#ifdef __cplusplus
+extern "C" {
+#endif
 extern void	xprt_unregister(SVCXPRT *);
-__END_DECLS
+#ifdef __cplusplus
+}
+#endif
 
 
 /*
@@ -265,7 +280,9 @@
  * deadlock the caller and server processes!
  */
 
-__BEGIN_DECLS
+#ifdef __cplusplus
+extern "C" {
+#endif
 extern bool_t	svc_sendreply(SVCXPRT *, xdrproc_t, void *);
 extern void	svcerr_decode(SVCXPRT *);
 extern void	svcerr_weakauth(SVCXPRT *);
@@ -277,7 +294,9 @@
 extern int	rpc_reg(rpcprog_t, rpcvers_t, rpcproc_t,
 			char *(*)(char *), xdrproc_t, xdrproc_t,
 			char *);
-__END_DECLS
+#ifdef __cplusplus
+}
+#endif
 
 /*
  * Lowest level dispatching -OR- who owns this process anyway.
@@ -306,11 +325,17 @@
  * a small program implemented by the svc_rpc implementation itself;
  * also see clnt.h for protocol numbers.
  */
-__BEGIN_DECLS
+#ifdef __cplusplus
+extern "C" {
+#endif
 extern void rpctest_service(void);
-__END_DECLS
+#ifdef __cplusplus
+}
+#endif
 
-__BEGIN_DECLS
+#ifdef __cplusplus
+extern "C" {
+#endif
 extern void	svc_getreq(int);
 extern void	svc_getreqset(fd_set *);
 extern void	svc_getreq_common(int);
@@ -319,7 +344,9 @@
 
 extern void	svc_run(void);
 extern void	svc_exit(void);
-__END_DECLS
+#ifdef __cplusplus
+}
+#endif
 
 /*
  * Socket to use on svcxxx_create call to get default socket
@@ -331,7 +358,9 @@
  * These are the existing service side transport implementations
  */
 
-__BEGIN_DECLS
+#ifdef __cplusplus
+extern "C" {
+#endif
 /*
  * Transport independent svc_create routine.
  */
@@ -427,7 +456,9 @@
 
 int __rpc_get_local_uid(SVCXPRT *_transp, uid_t *_uid);
 
-__END_DECLS
+#ifdef __cplusplus
+}
+#endif
 
 
 /* for backward compatibility */
--- libtirpc-0.2.3.orig/tirpc/rpc/svc_auth.h
+++ libtirpc-0.2.3/tirpc/rpc/svc_auth.h
@@ -65,11 +65,15 @@
 /*
  * Server side authenticator
  */
-__BEGIN_DECLS
+#ifdef __cplusplus
+extern "C" {
+#endif
 extern enum auth_stat _authenticate(struct svc_req *, struct rpc_msg *);
 extern int svc_auth_reg(int, enum auth_stat (*)(struct svc_req *,
 			  struct rpc_msg *));
 
-__END_DECLS
+#ifdef __cplusplus
+}
+#endif
 
 #endif /* !_RPC_SVC_AUTH_H */
--- libtirpc-0.2.3.orig/tirpc/rpc/svc_soc.h
+++ libtirpc-0.2.3/tirpc/rpc/svc_soc.h
@@ -38,7 +38,6 @@
 
 #ifndef _RPC_SVC_SOC_H
 #define _RPC_SVC_SOC_H
-#include <sys/cdefs.h>
 
 /* #pragma ident   "@(#)svc_soc.h  1.11    94/04/25 SMI" */
 /*      svc_soc.h 1.8 89/05/01 SMI      */
@@ -64,10 +63,14 @@
  *	void (*dispatch)();
  *	int protocol;    like TCP or UDP, zero means do not register 
  */
-__BEGIN_DECLS
+#ifdef __cplusplus
+extern "C" {
+#endif
 extern bool_t	svc_register(SVCXPRT *, u_long, u_long,
 		    void (*)(struct svc_req *, SVCXPRT *), int);
-__END_DECLS
+#ifdef __cplusplus
+}
+#endif
 
 /*
  * Service un-registration
@@ -76,44 +79,64 @@
  *	u_long prog;
  *	u_long vers;
  */
-__BEGIN_DECLS
+#ifdef __cplusplus
+extern "C" {
+#endif
 extern void	svc_unregister(u_long, u_long);
-__END_DECLS
+#ifdef __cplusplus
+}
+#endif
 
 
 /*
  * Memory based rpc for testing and timing.
  */
-__BEGIN_DECLS
+#ifdef __cplusplus
+extern "C" {
+#endif
 extern SVCXPRT *svcraw_create(void);
-__END_DECLS
+#ifdef __cplusplus
+}
+#endif
 
 
 /*
  * Udp based rpc.
  */
-__BEGIN_DECLS
+#ifdef __cplusplus
+extern "C" {
+#endif
 extern SVCXPRT *svcudp_create(int);
 extern SVCXPRT *svcudp_bufcreate(int, u_int, u_int);
 extern int svcudp_enablecache(SVCXPRT *, u_long);
 extern SVCXPRT *svcudp6_create(int);
 extern SVCXPRT *svcudp6_bufcreate(int, u_int, u_int);
-__END_DECLS
+#ifdef __cplusplus
+}
+#endif
 
 
 /*
  * Tcp based rpc.
  */
-__BEGIN_DECLS
+#ifdef __cplusplus
+extern "C" {
+#endif
 extern SVCXPRT *svctcp_create(int, u_int, u_int);
 extern SVCXPRT *svctcp6_create(int, u_int, u_int);
-__END_DECLS
+#ifdef __cplusplus
+}
+#endif
 
 /*
  * Fd based rpc.
  */
-__BEGIN_DECLS
+#ifdef __cplusplus
+extern "C" {
+#endif
 extern SVCXPRT *svcfd_create(int, u_int, u_int);
-__END_DECLS
+#ifdef __cplusplus
+}
+#endif
 
 #endif /* !_RPC_SVC_SOC_H */
--- libtirpc-0.2.3.orig/tirpc/rpc/xdr.h
+++ libtirpc-0.2.3/tirpc/rpc/xdr.h
@@ -40,7 +40,6 @@
 
 #ifndef _TIRPC_XDR_H
 #define _TIRPC_XDR_H
-#include <sys/cdefs.h>
 #include <stdio.h>
 #include <netinet/in.h>
 
@@ -287,7 +286,9 @@
 /*
  * These are the "generic" xdr routines.
  */
-__BEGIN_DECLS
+#ifdef __cplusplus
+extern "C" {
+#endif
 extern bool_t	xdr_void(void);
 extern bool_t	xdr_int(XDR *, int *);
 extern bool_t	xdr_u_int(XDR *, u_int *);
@@ -322,7 +323,9 @@
 extern bool_t	xdr_u_hyper(XDR *, u_quad_t *);
 extern bool_t	xdr_longlong_t(XDR *, quad_t *);
 extern bool_t	xdr_u_longlong_t(XDR *, u_quad_t *);
-__END_DECLS
+#ifdef __cplusplus
+}
+#endif
 
 /*
  * Common opaque bytes objects used by many rpc protocols;
@@ -340,7 +343,9 @@
  * These are the public routines for the various implementations of
  * xdr streams.
  */
-__BEGIN_DECLS
+#ifdef __cplusplus
+extern "C" {
+#endif
 /* XDR using memory buffers */
 extern void   xdrmem_create(XDR *, char *, u_int, enum xdr_op);
 
@@ -361,6 +366,8 @@
 /* true if no more input */
 extern bool_t xdrrec_eof(XDR *);
 extern u_int xdrrec_readbytes(XDR *, caddr_t, u_int);
-__END_DECLS
+#ifdef __cplusplus
+}
+#endif
 
 #endif /* !_TIRPC_XDR_H */