summaryrefslogtreecommitdiff
blob: d86109c38e026004d76fb25af86654fabd60c3c1 (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
--- a/include//asio/detail/impl/descriptor_ops.ipp
+++ b/include//asio/detail/impl/descriptor_ops.ipp
@@ -28,6 +28,7 @@ namespace asio {
 namespace detail {
 namespace descriptor_ops {
 
+ASIO_DECL
 int open(const char* path, int flags, asio::error_code& ec)
 {
   errno = 0;
@@ -37,6 +38,7 @@ int open(const char* path, int flags, asio::error_code& ec)
   return result;
 }
 
+ASIO_DECL
 int close(int d, state_type& state, asio::error_code& ec)
 {
   int result = 0;
@@ -64,6 +66,7 @@ int close(int d, state_type& state, asio::error_code& ec)
   return result;
 }
 
+ASIO_DECL
 bool set_internal_non_blocking(int d,
     state_type& state, asio::error_code& ec)
 {
@@ -96,6 +99,7 @@ bool set_internal_non_blocking(int d,
   return false;
 }
 
+ASIO_DECL
 std::size_t sync_read(int d, state_type state, buf* bufs,
     std::size_t count, bool all_empty, asio::error_code& ec)
 {
@@ -142,6 +146,7 @@ std::size_t sync_read(int d, state_type state, buf* bufs,
   }
 }
 
+ASIO_DECL
 bool non_blocking_read(int d, buf* bufs, std::size_t count,
     asio::error_code& ec, std::size_t& bytes_transferred)
 {
@@ -180,6 +185,7 @@ bool non_blocking_read(int d, buf* bufs, std::size_t count,
   }
 }
 
+ASIO_DECL
 std::size_t sync_write(int d, state_type state, const buf* bufs,
     std::size_t count, bool all_empty, asio::error_code& ec)
 {
@@ -219,6 +225,7 @@ std::size_t sync_write(int d, state_type state, const buf* bufs,
   }
 }
 
+ASIO_DECL
 bool non_blocking_write(int d, const buf* bufs, std::size_t count,
     asio::error_code& ec, std::size_t& bytes_transferred)
 {
@@ -250,6 +257,7 @@ bool non_blocking_write(int d, const buf* bufs, std::size_t count,
   }
 }
 
+ASIO_DECL
 int ioctl(int d, state_type& state, long cmd,
     ioctl_arg_type* arg, asio::error_code& ec)
 {
@@ -291,6 +299,7 @@ int ioctl(int d, state_type& state, long cmd,
   return result;
 }
 
+ASIO_DECL
 int fcntl(int d, long cmd, asio::error_code& ec)
 {
   if (d == -1)
@@ -306,6 +315,7 @@ int fcntl(int d, long cmd, asio::error_code& ec)
   return result;
 }
 
+ASIO_DECL
 int fcntl(int d, long cmd, long arg, asio::error_code& ec)
 {
   if (d == -1)
@@ -321,6 +331,7 @@ int fcntl(int d, long cmd, long arg, asio::error_code& ec)
   return result;
 }
 
+ASIO_DECL
 int poll_read(int d, asio::error_code& ec)
 {
   if (d == -1)
@@ -340,6 +351,7 @@ int poll_read(int d, asio::error_code& ec)
   return result;
 }
 
+ASIO_DECL
 int poll_write(int d, asio::error_code& ec)
 {
   if (d == -1)
--- a/include//asio/detail/impl/socket_ops.ipp
+++ b/include//asio/detail/impl/socket_ops.ipp
@@ -77,6 +77,7 @@ inline socket_type call_accept(SockLenType msghdr::*,
   return result;
 }
 
+ASIO_DECL
 socket_type accept(socket_type s, socket_addr_type* addr,
     std::size_t* addrlen, asio::error_code& ec)
 {
@@ -108,6 +109,7 @@ socket_type accept(socket_type s, socket_addr_type* addr,
   return new_s;
 }
 
+ASIO_DECL
 socket_type sync_accept(socket_type s, state_type state,
     socket_addr_type* addr, std::size_t* addrlen, asio::error_code& ec)
 {
@@ -199,6 +201,7 @@ void complete_iocp_accept(socket_type s,
 
 #else // defined(ASIO_HAS_IOCP)
 
+ASIO_DECL
 bool non_blocking_accept(socket_type s,
     state_type state, socket_addr_type* addr, std::size_t* addrlen,
     asio::error_code& ec, socket_type& new_socket)
@@ -254,6 +257,7 @@ inline int call_bind(SockLenType msghdr::*,
   return ::bind(s, addr, (SockLenType)addrlen);
 }
 
+ASIO_DECL
 int bind(socket_type s, const socket_addr_type* addr,
     std::size_t addrlen, asio::error_code& ec)
 {
@@ -271,6 +275,7 @@ int bind(socket_type s, const socket_addr_type* addr,
   return result;
 }
 
+ASIO_DECL
 int close(socket_type s, state_type& state,
     bool destruction, asio::error_code& ec)
 {
@@ -322,6 +327,7 @@ int close(socket_type s, state_type& state,
   return result;
 }
 
+ASIO_DECL
 bool set_internal_non_blocking(socket_type s,
     state_type& state, asio::error_code& ec)
 {
@@ -357,6 +363,7 @@ bool set_internal_non_blocking(socket_type s,
   return false;
 }
 
+ASIO_DECL
 int shutdown(socket_type s, int what, asio::error_code& ec)
 {
   if (s == invalid_socket)
@@ -379,6 +386,7 @@ inline int call_connect(SockLenType msghdr::*,
   return ::connect(s, addr, (SockLenType)addrlen);
 }
 
+ASIO_DECL
 int connect(socket_type s, const socket_addr_type* addr,
     std::size_t addrlen, asio::error_code& ec)
 {
@@ -396,6 +404,7 @@ int connect(socket_type s, const socket_addr_type* addr,
   return result;
 }
 
+ASIO_DECL
 void sync_connect(socket_type s, const socket_addr_type* addr,
     std::size_t addrlen, asio::error_code& ec)
 {
@@ -424,6 +433,7 @@ void sync_connect(socket_type s, const socket_addr_type* addr,
       asio::error::get_system_category());
 }
 
+ASIO_DECL
 bool non_blocking_connect(socket_type s, asio::error_code& ec)
 {
   // Get the error code from the connect operation.
@@ -444,6 +454,7 @@ bool non_blocking_connect(socket_type s, asio::error_code& ec)
   return true;
 }
 
+ASIO_DECL
 int socketpair(int af, int type, int protocol,
     socket_type sv[2], asio::error_code& ec)
 {
@@ -463,6 +474,7 @@ int socketpair(int af, int type, int protocol,
 #endif
 }
 
+ASIO_DECL
 bool sockatmark(socket_type s, asio::error_code& ec)
 {
   if (s == invalid_socket)
@@ -493,6 +505,7 @@ bool sockatmark(socket_type s, asio::error_code& ec)
   return ec ? false : value != 0;
 }
 
+ASIO_DECL
 size_t available(socket_type s, asio::error_code& ec)
 {
   if (s == invalid_socket)
@@ -517,6 +530,7 @@ size_t available(socket_type s, asio::error_code& ec)
   return ec ? static_cast<size_t>(0) : static_cast<size_t>(value);
 }
 
+ASIO_DECL
 int listen(socket_type s, int backlog, asio::error_code& ec)
 {
   if (s == invalid_socket)
@@ -549,6 +563,7 @@ typedef WSABUF buf;
 typedef iovec buf;
 #endif // defined(BOOST_WINDOWS) || defined(__CYGWIN__)
 
+ASIO_DECL
 void init_buf(buf& b, void* data, size_t size)
 {
 #if defined(BOOST_WINDOWS) || defined(__CYGWIN__)
@@ -560,6 +575,7 @@ void init_buf(buf& b, void* data, size_t size)
 #endif // defined(BOOST_WINDOWS) || defined(__CYGWIN__)
 }
 
+ASIO_DECL
 void init_buf(buf& b, const void* data, size_t size)
 {
 #if defined(BOOST_WINDOWS) || defined(__CYGWIN__)
@@ -593,6 +609,7 @@ inline void init_msghdr_msg_name(T& name, const socket_addr_type* addr)
   name = reinterpret_cast<T>(const_cast<socket_addr_type*>(addr));
 }
 
+ASIO_DECL
 int recv(socket_type s, buf* bufs, size_t count, int flags,
     asio::error_code& ec)
 {
@@ -623,6 +640,7 @@ int recv(socket_type s, buf* bufs, size_t count, int flags,
 #endif // defined(BOOST_WINDOWS) || defined(__CYGWIN__)
 }
 
+ASIO_DECL
 size_t sync_recv(socket_type s, state_type state, buf* bufs,
     size_t count, int flags, bool all_empty, asio::error_code& ec)
 {
@@ -670,6 +688,7 @@ size_t sync_recv(socket_type s, state_type state, buf* bufs,
 
 #if defined(ASIO_HAS_IOCP)
 
+ASIO_DECL
 void complete_iocp_recv(state_type state,
     const weak_cancel_token_type& cancel_token, bool all_empty,
     asio::error_code& ec, size_t bytes_transferred)
@@ -698,6 +717,7 @@ void complete_iocp_recv(state_type state,
 
 #else // defined(ASIO_HAS_IOCP)
 
+ASIO_DECL
 bool non_blocking_recv(socket_type s,
     buf* bufs, size_t count, int flags, bool is_stream,
     asio::error_code& ec, size_t& bytes_transferred)
@@ -738,6 +758,7 @@ bool non_blocking_recv(socket_type s,
 
 #endif // defined(ASIO_HAS_IOCP)
 
+ASIO_DECL
 int recvfrom(socket_type s, buf* bufs, size_t count, int flags,
     socket_addr_type* addr, std::size_t* addrlen,
     asio::error_code& ec)
@@ -774,6 +795,7 @@ int recvfrom(socket_type s, buf* bufs, size_t count, int flags,
 #endif // defined(BOOST_WINDOWS) || defined(__CYGWIN__)
 }
 
+ASIO_DECL
 size_t sync_recvfrom(socket_type s, state_type state, buf* bufs,
     size_t count, int flags, socket_addr_type* addr,
     std::size_t* addrlen, asio::error_code& ec)
@@ -808,6 +830,7 @@ size_t sync_recvfrom(socket_type s, state_type state, buf* bufs,
 
 #if defined(ASIO_HAS_IOCP)
 
+ASIO_DECL
 void complete_iocp_recvfrom(
     const weak_cancel_token_type& cancel_token,
     asio::error_code& ec)
@@ -828,6 +851,7 @@ void complete_iocp_recvfrom(
 
 #else // defined(ASIO_HAS_IOCP)
 
+ASIO_DECL
 bool non_blocking_recvfrom(socket_type s,
     buf* bufs, size_t count, int flags,
     socket_addr_type* addr, std::size_t* addrlen,
@@ -862,6 +886,7 @@ bool non_blocking_recvfrom(socket_type s,
 
 #endif // defined(ASIO_HAS_IOCP)
 
+ASIO_DECL
 int send(socket_type s, const buf* bufs, size_t count, int flags,
     asio::error_code& ec)
 {
@@ -895,6 +920,7 @@ int send(socket_type s, const buf* bufs, size_t count, int flags,
 #endif // defined(BOOST_WINDOWS) || defined(__CYGWIN__)
 }
 
+ASIO_DECL
 size_t sync_send(socket_type s, state_type state, const buf* bufs,
     size_t count, int flags, bool all_empty, asio::error_code& ec)
 {
@@ -935,6 +961,7 @@ size_t sync_send(socket_type s, state_type state, const buf* bufs,
 
 #if defined(ASIO_HAS_IOCP)
 
+ASIO_DECL
 void complete_iocp_send(
     const weak_cancel_token_type& cancel_token,
     asio::error_code& ec)
@@ -955,6 +982,7 @@ void complete_iocp_send(
 
 #else // defined(ASIO_HAS_IOCP)
 
+ASIO_DECL
 bool non_blocking_send(socket_type s,
     const buf* bufs, size_t count, int flags,
     asio::error_code& ec, size_t& bytes_transferred)
@@ -988,6 +1016,7 @@ bool non_blocking_send(socket_type s,
 
 #endif // defined(ASIO_HAS_IOCP)
 
+ASIO_DECL
 int sendto(socket_type s, const buf* bufs, size_t count, int flags,
     const socket_addr_type* addr, std::size_t addrlen,
     asio::error_code& ec)
@@ -1024,6 +1053,7 @@ int sendto(socket_type s, const buf* bufs, size_t count, int flags,
 #endif // defined(BOOST_WINDOWS) || defined(__CYGWIN__)
 }
 
+ASIO_DECL
 size_t sync_sendto(socket_type s, state_type state, const buf* bufs,
     size_t count, int flags, const socket_addr_type* addr,
     std::size_t addrlen, asio::error_code& ec)
@@ -1058,6 +1088,7 @@ size_t sync_sendto(socket_type s, state_type state, const buf* bufs,
 
 #if !defined(ASIO_HAS_IOCP)
 
+ASIO_DECL
 bool non_blocking_sendto(socket_type s,
     const buf* bufs, size_t count, int flags,
     const socket_addr_type* addr, std::size_t addrlen,
@@ -1092,6 +1123,7 @@ bool non_blocking_sendto(socket_type s,
 
 #endif // !defined(ASIO_HAS_IOCP)
 
+ASIO_DECL
 socket_type socket(int af, int type, int protocol,
     asio::error_code& ec)
 {
@@ -1147,6 +1179,7 @@ inline int call_setsockopt(SockLenType msghdr::*,
       (const char*)optval, (SockLenType)optlen);
 }
 
+ASIO_DECL
 int setsockopt(socket_type s, state_type& state, int level, int optname,
     const void* optval, std::size_t optlen, asio::error_code& ec)
 {
@@ -1235,6 +1268,7 @@ inline int call_getsockopt(SockLenType msghdr::*,
   return result;
 }
 
+ASIO_DECL
 int getsockopt(socket_type s, state_type state, int level, int optname,
     void* optval, size_t* optlen, asio::error_code& ec)
 {
@@ -1344,6 +1378,7 @@ inline int call_getpeername(SockLenType msghdr::*,
   return result;
 }
 
+ASIO_DECL
 int getpeername(socket_type s, socket_addr_type* addr,
     std::size_t* addrlen, bool cached, asio::error_code& ec)
 {
@@ -1396,6 +1431,7 @@ inline int call_getsockname(SockLenType msghdr::*,
   return result;
 }
 
+ASIO_DECL
 int getsockname(socket_type s, socket_addr_type* addr,
     std::size_t* addrlen, asio::error_code& ec)
 {
@@ -1413,6 +1449,7 @@ int getsockname(socket_type s, socket_addr_type* addr,
   return result;
 }
 
+ASIO_DECL
 int ioctl(socket_type s, state_type& state, int cmd,
     ioctl_arg_type* arg, asio::error_code& ec)
 {
@@ -1460,6 +1497,7 @@ int ioctl(socket_type s, state_type& state, int cmd,
   return result;
 }
 
+ASIO_DECL
 int select(int nfds, fd_set* readfds, fd_set* writefds,
     fd_set* exceptfds, timeval* timeout, asio::error_code& ec)
 {
@@ -1501,6 +1539,7 @@ int select(int nfds, fd_set* readfds, fd_set* writefds,
 #endif
 }
 
+ASIO_DECL
 int poll_read(socket_type s, asio::error_code& ec)
 {
   if (s == invalid_socket)
@@ -1537,6 +1576,7 @@ int poll_read(socket_type s, asio::error_code& ec)
        // || defined(__SYMBIAN32__)
 }
 
+ASIO_DECL
 int poll_write(socket_type s, asio::error_code& ec)
 {
   if (s == invalid_socket)
@@ -1573,6 +1613,7 @@ int poll_write(socket_type s, asio::error_code& ec)
        // || defined(__SYMBIAN32__)
 }
 
+ASIO_DECL
 int poll_connect(socket_type s, asio::error_code& ec)
 {
   if (s == invalid_socket)
@@ -1612,6 +1653,7 @@ int poll_connect(socket_type s, asio::error_code& ec)
        // || defined(__SYMBIAN32__)
 }
 
+ASIO_DECL
 const char* inet_ntop(int af, const void* src, char* dest, size_t length,
     unsigned long scope_id, asio::error_code& ec)
 {
@@ -1688,6 +1730,7 @@ const char* inet_ntop(int af, const void* src, char* dest, size_t length,
 #endif // defined(BOOST_WINDOWS) || defined(__CYGWIN__)
 }
 
+ASIO_DECL
 int inet_pton(int af, const char* src, void* dest,
     unsigned long* scope_id, asio::error_code& ec)
 {
@@ -1774,6 +1817,7 @@ int inet_pton(int af, const char* src, void* dest,
 #endif // defined(BOOST_WINDOWS) || defined(__CYGWIN__)
 }
 
+ASIO_DECL
 int gethostname(char* name, int namelen, asio::error_code& ec)
 {
   clear_last_error();
@@ -2667,6 +2711,7 @@ inline asio::error_code translate_addrinfo_error(int error)
   }
 }
 
+ASIO_DECL
 asio::error_code getaddrinfo(const char* host,
     const char* service, const addrinfo_type& hints,
     addrinfo_type** result, asio::error_code& ec)
@@ -2703,6 +2748,7 @@ asio::error_code getaddrinfo(const char* host,
 #endif
 }
 
+ASIO_DECL
 asio::error_code background_getaddrinfo(
     const weak_cancel_token_type& cancel_token, const char* host,
     const char* service, const addrinfo_type& hints,
@@ -2715,6 +2761,7 @@ asio::error_code background_getaddrinfo(
   return ec;
 }
 
+ASIO_DECL
 void freeaddrinfo(addrinfo_type* ai)
 {
 #if defined(BOOST_WINDOWS) || defined(__CYGWIN__)
@@ -2741,6 +2788,7 @@ void freeaddrinfo(addrinfo_type* ai)
 #endif
 }
 
+ASIO_DECL
 asio::error_code getnameinfo(const socket_addr_type* addr,
     std::size_t addrlen, char* host, std::size_t hostlen,
     char* serv, std::size_t servlen, int flags, asio::error_code& ec)
@@ -2788,6 +2836,7 @@ asio::error_code getnameinfo(const socket_addr_type* addr,
 #endif
 }
 
+ASIO_DECL
 asio::error_code sync_getnameinfo(
     const socket_addr_type* addr, std::size_t addrlen,
     char* host, std::size_t hostlen, char* serv,
@@ -2807,6 +2856,7 @@ asio::error_code sync_getnameinfo(
   return ec;
 }
 
+ASIO_DECL
 asio::error_code background_getnameinfo(
     const weak_cancel_token_type& cancel_token,
     const socket_addr_type* addr, std::size_t addrlen,
@@ -2834,21 +2884,25 @@ asio::error_code background_getnameinfo(
   return ec;
 }
 
+ASIO_DECL
 u_long_type network_to_host_long(u_long_type value)
 {
   return ntohl(value);
 }
 
+ASIO_DECL
 u_long_type host_to_network_long(u_long_type value)
 {
   return htonl(value);
 }
 
+ASIO_DECL
 u_short_type network_to_host_short(u_short_type value)
 {
   return ntohs(value);
 }
 
+ASIO_DECL
 u_short_type host_to_network_short(u_short_type value)
 {
   return htons(value);
--- a/include//asio/detail/impl/throw_error.ipp
+++ b/include//asio/detail/impl/throw_error.ipp
@@ -25,12 +25,14 @@
 namespace asio {
 namespace detail {
 
+ASIO_DECL
 void do_throw_error(const asio::error_code& err)
 {
   asio::system_error e(err);
   boost::throw_exception(e);
 }
 
+ASIO_DECL
 void do_throw_error(const asio::error_code& err, const char* location)
 {
   asio::system_error e(err, location);
--- a/include//asio/ip/detail/impl/endpoint.ipp
+++ b/include//asio/ip/detail/impl/endpoint.ipp
@@ -31,6 +31,7 @@ namespace asio {
 namespace ip {
 namespace detail {
 
+ASIO_DECL
 endpoint::endpoint()
   : data_()
 {
@@ -39,6 +40,7 @@ endpoint::endpoint()
   data_.v4.sin_addr.s_addr = INADDR_ANY;
 }
 
+ASIO_DECL
 endpoint::endpoint(int family, unsigned short port_num)
   : data_()
 {
@@ -62,6 +64,7 @@ endpoint::endpoint(int family, unsigned short port_num)
   }
 }
 
+ASIO_DECL
 endpoint::endpoint(const asio::ip::address& addr,
     unsigned short port_num)
   : data_()
@@ -89,6 +92,7 @@ endpoint::endpoint(const asio::ip::address& addr,
   }
 }
 
+ASIO_DECL
 void endpoint::resize(std::size_t size)
 {
   if (size > sizeof(asio::detail::sockaddr_storage_type))
@@ -98,6 +102,7 @@ void endpoint::resize(std::size_t size)
   }
 }
 
+ASIO_DECL
 unsigned short endpoint::port() const
 {
   if (is_v4())
@@ -112,6 +117,7 @@ unsigned short endpoint::port() const
   }
 }
 
+ASIO_DECL
 void endpoint::port(unsigned short port_num)
 {
   if (is_v4())
@@ -126,6 +132,7 @@ void endpoint::port(unsigned short port_num)
   }
 }
 
+ASIO_DECL
 asio::ip::address endpoint::address() const
 {
   using namespace std; // For memcpy.
@@ -143,17 +150,20 @@ asio::ip::address endpoint::address() const
   }
 }
 
+ASIO_DECL
 void endpoint::address(const asio::ip::address& addr)
 {
   endpoint tmp_endpoint(addr, port());
   data_ = tmp_endpoint.data_;
 }
 
+ASIO_DECL
 bool operator==(const endpoint& e1, const endpoint& e2)
 {
   return e1.address() == e2.address() && e1.port() == e2.port();
 }
 
+ASIO_DECL
 bool operator<(const endpoint& e1, const endpoint& e2)
 {
   if (e1.address() < e2.address())
@@ -164,6 +174,7 @@ bool operator<(const endpoint& e1, const endpoint& e2)
 }
 
 #if !defined(BOOST_NO_IOSTREAM)
+ASIO_DECL
 std::string endpoint::to_string(asio::error_code& ec) const
 {
   std::string a = address().to_string(ec);
--- a/include//asio/ip/impl/address.ipp
+++ b/include//asio/ip/impl/address.ipp
@@ -28,6 +28,7 @@
 namespace asio {
 namespace ip {
 
+ASIO_DECL
 address::address()
   : type_(ipv4),
     ipv4_address_(),
@@ -35,6 +36,7 @@ address::address()
 {
 }
 
+ASIO_DECL
 address::address(const asio::ip::address_v4& ipv4_address)
   : type_(ipv4),
     ipv4_address_(ipv4_address),
@@ -42,6 +44,7 @@ address::address(const asio::ip::address_v4& ipv4_address)
 {
 }
 
+ASIO_DECL
 address::address(const asio::ip::address_v6& ipv6_address)
   : type_(ipv6),
     ipv4_address_(),
@@ -49,6 +52,7 @@ address::address(const asio::ip::address_v6& ipv6_address)
 {
 }
 
+ASIO_DECL
 address::address(const address& other)
   : type_(other.type_),
     ipv4_address_(other.ipv4_address_),
@@ -56,6 +60,7 @@ address::address(const address& other)
 {
 }
 
+ASIO_DECL
 address& address::operator=(const address& other)
 {
   type_ = other.type_;
@@ -64,6 +69,7 @@ address& address::operator=(const address& other)
   return *this;
 }
 
+ASIO_DECL
 address& address::operator=(const asio::ip::address_v4& ipv4_address)
 {
   type_ = ipv4;
@@ -72,6 +78,7 @@ address& address::operator=(const asio::ip::address_v4& ipv4_address)
   return *this;
 }
 
+ASIO_DECL
 address& address::operator=(const asio::ip::address_v6& ipv6_address)
 {
   type_ = ipv6;
@@ -80,6 +87,7 @@ address& address::operator=(const asio::ip::address_v6& ipv6_address)
   return *this;
 }
 
+ASIO_DECL
 asio::ip::address_v4 address::to_v4() const
 {
   if (type_ != ipv4)
@@ -90,6 +98,7 @@ asio::ip::address_v4 address::to_v4() const
   return ipv4_address_;
 }
 
+ASIO_DECL
 asio::ip::address_v6 address::to_v6() const
 {
   if (type_ != ipv6)
@@ -100,6 +109,7 @@ asio::ip::address_v6 address::to_v6() const
   return ipv6_address_;
 }
 
+ASIO_DECL
 std::string address::to_string() const
 {
   if (type_ == ipv6)
@@ -107,6 +117,7 @@ std::string address::to_string() const
   return ipv4_address_.to_string();
 }
 
+ASIO_DECL
 std::string address::to_string(asio::error_code& ec) const
 {
   if (type_ == ipv6)
@@ -114,6 +125,7 @@ std::string address::to_string(asio::error_code& ec) const
   return ipv4_address_.to_string(ec);
 }
 
+ASIO_DECL
 address address::from_string(const char* str)
 {
   asio::error_code ec;
@@ -122,6 +134,7 @@ address address::from_string(const char* str)
   return addr;
 }
 
+ASIO_DECL
 address address::from_string(const char* str, asio::error_code& ec)
 {
   asio::ip::address_v6 ipv6_address =
@@ -147,17 +160,20 @@ address address::from_string(const char* str, asio::error_code& ec)
   return address();
 }
 
+ASIO_DECL
 address address::from_string(const std::string& str)
 {
   return from_string(str.c_str());
 }
 
+ASIO_DECL
 address address::from_string(const std::string& str,
     asio::error_code& ec)
 {
   return from_string(str.c_str(), ec);
 }
 
+ASIO_DECL
 bool operator==(const address& a1, const address& a2)
 {
   if (a1.type_ != a2.type_)
@@ -167,6 +183,7 @@ bool operator==(const address& a1, const address& a2)
   return a1.ipv4_address_ == a2.ipv4_address_;
 }
 
+ASIO_DECL
 bool operator<(const address& a1, const address& a2)
 {
   if (a1.type_ < a2.type_)
--- a/include//asio/ip/impl/address_v4.ipp
+++ b/include//asio/ip/impl/address_v4.ipp
@@ -29,6 +29,7 @@
 namespace asio {
 namespace ip {
 
+ASIO_DECL
 address_v4::address_v4(const address_v4::bytes_type& bytes)
 {
 #if UCHAR_MAX > 0xFF
@@ -44,6 +45,7 @@ address_v4::address_v4(const address_v4::bytes_type& bytes)
   memcpy(&addr_.s_addr, bytes.elems, 4);
 }
 
+ASIO_DECL
 address_v4::address_v4(unsigned long addr)
 {
 #if ULONG_MAX > 0xFFFFFFFF
@@ -57,6 +59,7 @@ address_v4::address_v4(unsigned long addr)
   addr_.s_addr = asio::detail::socket_ops::host_to_network_long(addr);
 }
 
+ASIO_DECL
 address_v4::bytes_type address_v4::to_bytes() const
 {
   using namespace std; // For memcpy.
@@ -65,11 +68,13 @@ address_v4::bytes_type address_v4::to_bytes() const
   return bytes;
 }
 
+ASIO_DECL
 unsigned long address_v4::to_ulong() const
 {
   return asio::detail::socket_ops::network_to_host_long(addr_.s_addr);
 }
 
+ASIO_DECL
 std::string address_v4::to_string() const
 {
   asio::error_code ec;
@@ -78,6 +83,7 @@ std::string address_v4::to_string() const
   return addr;
 }
 
+ASIO_DECL
 std::string address_v4::to_string(asio::error_code& ec) const
 {
   char addr_str[asio::detail::max_addr_v4_str_len];
@@ -89,6 +95,7 @@ std::string address_v4::to_string(asio::error_code& ec) const
   return addr;
 }
 
+ASIO_DECL
 address_v4 address_v4::from_string(const char* str)
 {
   asio::error_code ec;
@@ -97,6 +104,7 @@ address_v4 address_v4::from_string(const char* str)
   return addr;
 }
 
+ASIO_DECL
 address_v4 address_v4::from_string(
     const char* str, asio::error_code& ec)
 {
@@ -107,42 +115,50 @@ address_v4 address_v4::from_string(
   return tmp;
 }
 
+ASIO_DECL
 address_v4 address_v4::from_string(const std::string& str)
 {
   return from_string(str.c_str());
 }
 
+ASIO_DECL
 address_v4 address_v4::from_string(
     const std::string& str, asio::error_code& ec)
 {
   return from_string(str.c_str(), ec);
 }
 
+ASIO_DECL
 bool address_v4::is_class_a() const
 {
   return IN_CLASSA(to_ulong());
 }
 
+ASIO_DECL
 bool address_v4::is_class_b() const
 {
   return IN_CLASSB(to_ulong());
 }
 
+ASIO_DECL
 bool address_v4::is_class_c() const
 {
   return IN_CLASSC(to_ulong());
 }
 
+ASIO_DECL
 bool address_v4::is_multicast() const
 {
   return IN_MULTICAST(to_ulong());
 }
 
+ASIO_DECL
 address_v4 address_v4::broadcast(const address_v4& addr, const address_v4& mask)
 {
   return address_v4(addr.to_ulong() | (mask.to_ulong() ^ 0xFFFFFFFF));
 }
 
+ASIO_DECL
 address_v4 address_v4::netmask(const address_v4& addr)
 {
   if (addr.is_class_a())
--- a/include//asio/ip/impl/address_v6.ipp
+++ b/include//asio/ip/impl/address_v6.ipp
@@ -30,6 +30,7 @@
 namespace asio {
 namespace ip {
 
+ASIO_DECL
 address_v6::address_v6()
   : scope_id_(0)
 {
@@ -37,6 +38,7 @@ address_v6::address_v6()
   addr_ = tmp_addr;
 }
 
+ASIO_DECL
 address_v6::address_v6(const address_v6::bytes_type& bytes,
     unsigned long scope_id)
   : scope_id_(scope_id)
@@ -56,12 +58,14 @@ address_v6::address_v6(const address_v6::bytes_type& bytes,
   memcpy(addr_.s6_addr, bytes.elems, 16);
 }
 
+ASIO_DECL
 address_v6::address_v6(const address_v6& other)
   : addr_(other.addr_),
     scope_id_(other.scope_id_)
 {
 }
 
+ASIO_DECL
 address_v6& address_v6::operator=(const address_v6& other)
 {
   addr_ = other.addr_;
@@ -69,6 +73,7 @@ address_v6& address_v6::operator=(const address_v6& other)
   return *this;
 }
 
+ASIO_DECL
 address_v6::bytes_type address_v6::to_bytes() const
 {
   using namespace std; // For memcpy.
@@ -77,6 +82,7 @@ address_v6::bytes_type address_v6::to_bytes() const
   return bytes;
 }
 
+ASIO_DECL
 std::string address_v6::to_string() const
 {
   asio::error_code ec;
@@ -85,6 +91,7 @@ std::string address_v6::to_string() const
   return addr;
 }
 
+ASIO_DECL
 std::string address_v6::to_string(asio::error_code& ec) const
 {
   char addr_str[asio::detail::max_addr_v6_str_len];
@@ -96,6 +103,7 @@ std::string address_v6::to_string(asio::error_code& ec) const
   return addr;
 }
 
+ASIO_DECL
 address_v6 address_v6::from_string(const char* str)
 {
   asio::error_code ec;
@@ -104,6 +112,7 @@ address_v6 address_v6::from_string(const char* str)
   return addr;
 }
 
+ASIO_DECL
 address_v6 address_v6::from_string(
     const char* str, asio::error_code& ec)
 {
@@ -114,17 +123,20 @@ address_v6 address_v6::from_string(
   return tmp;
 }
 
+ASIO_DECL
 address_v6 address_v6::from_string(const std::string& str)
 {
   return from_string(str.c_str());
 }
 
+ASIO_DECL
 address_v6 address_v6::from_string(
     const std::string& str, asio::error_code& ec)
 {
   return from_string(str.c_str(), ec);
 }
 
+ASIO_DECL
 address_v4 address_v6::to_v4() const
 {
   if (!is_v4_mapped() && !is_v4_compatible())
@@ -138,6 +150,7 @@ address_v4 address_v6::to_v4() const
   return address_v4(v4_bytes);
 }
 
+ASIO_DECL
 bool address_v6::is_loopback() const
 {
 #if defined(__BORLANDC__)
@@ -155,6 +168,7 @@ bool address_v6::is_loopback() const
 #endif
 }
 
+ASIO_DECL
 bool address_v6::is_unspecified() const
 {
 #if defined(__BORLANDC__)
@@ -172,66 +186,77 @@ bool address_v6::is_unspecified() const
 #endif
 }
 
+ASIO_DECL
 bool address_v6::is_link_local() const
 {
   using namespace asio::detail;
   return IN6_IS_ADDR_LINKLOCAL(&addr_) != 0;
 }
 
+ASIO_DECL
 bool address_v6::is_site_local() const
 {
   using namespace asio::detail;
   return IN6_IS_ADDR_SITELOCAL(&addr_) != 0;
 }
 
+ASIO_DECL
 bool address_v6::is_v4_mapped() const
 {
   using namespace asio::detail;
   return IN6_IS_ADDR_V4MAPPED(&addr_) != 0;
 }
 
+ASIO_DECL
 bool address_v6::is_v4_compatible() const
 {
   using namespace asio::detail;
   return IN6_IS_ADDR_V4COMPAT(&addr_) != 0;
 }
 
+ASIO_DECL
 bool address_v6::is_multicast() const
 {
   using namespace asio::detail;
   return IN6_IS_ADDR_MULTICAST(&addr_) != 0;
 }
 
+ASIO_DECL
 bool address_v6::is_multicast_global() const
 {
   using namespace asio::detail;
   return IN6_IS_ADDR_MC_GLOBAL(&addr_) != 0;
 }
 
+ASIO_DECL
 bool address_v6::is_multicast_link_local() const
 {
   using namespace asio::detail;
   return IN6_IS_ADDR_MC_LINKLOCAL(&addr_) != 0;
 }
 
+ASIO_DECL
 bool address_v6::is_multicast_node_local() const
 {
   using namespace asio::detail;
   return IN6_IS_ADDR_MC_NODELOCAL(&addr_) != 0;
 }
 
+ASIO_DECL
 bool address_v6::is_multicast_org_local() const
 {
   using namespace asio::detail;
   return IN6_IS_ADDR_MC_ORGLOCAL(&addr_) != 0;
 }
 
+ASIO_DECL
 bool address_v6::is_multicast_site_local() const
 {
   using namespace asio::detail;
   return IN6_IS_ADDR_MC_SITELOCAL(&addr_) != 0;
 }
 
+ASIO_DECL
 bool operator==(const address_v6& a1, const address_v6& a2)
 {
   using namespace std; // For memcmp.
@@ -240,6 +265,7 @@ bool operator==(const address_v6& a1, const address_v6& a2)
     && a1.scope_id_ == a2.scope_id_;
 }
 
+ASIO_DECL
 bool operator<(const address_v6& a1, const address_v6& a2)
 {
   using namespace std; // For memcmp.
@@ -252,6 +278,7 @@ bool operator<(const address_v6& a1, const address_v6& a2)
   return a1.scope_id_ < a2.scope_id_;
 }
 
+ASIO_DECL
 address_v6 address_v6::loopback()
 {
   address_v6 tmp;
@@ -260,6 +287,7 @@ address_v6 address_v6::loopback()
   return tmp;
 }
 
+ASIO_DECL
 address_v6 address_v6::v4_mapped(const address_v4& addr)
 {
   address_v4::bytes_type v4_bytes = addr.to_bytes();
@@ -268,6 +296,7 @@ address_v6 address_v6::v4_mapped(const address_v4& addr)
   return address_v6(v6_bytes);
 }
 
+ASIO_DECL
 address_v6 address_v6::v4_compatible(const address_v4& addr)
 {
   address_v4::bytes_type v4_bytes = addr.to_bytes();
--- a/include//asio/ip/impl/host_name.ipp
+++ b/include//asio/ip/impl/host_name.ipp
@@ -26,6 +26,7 @@
 namespace asio {
 namespace ip {
 
+ASIO_DECL
 std::string host_name()
 {
   char name[1024];
@@ -38,6 +39,7 @@ std::string host_name()
   return std::string(name);
 }
 
+ASIO_DECL
 std::string host_name(asio::error_code& ec)
 {
   char name[1024];
--- a/include//asio/local/detail/impl/endpoint.ipp
+++ b/include//asio/local/detail/impl/endpoint.ipp
@@ -32,22 +32,26 @@ namespace asio {
 namespace local {
 namespace detail {
 
+ASIO_DECL
 endpoint::endpoint()
 {
   init("", 0);
 }
 
+ASIO_DECL
 endpoint::endpoint(const char* path)
 {
   using namespace std; // For strlen.
   init(path, strlen(path));
 }
 
+ASIO_DECL
 endpoint::endpoint(const std::string& path)
 {
   init(path.data(), path.length());
 }
 
+ASIO_DECL
 void endpoint::resize(std::size_t size)
 {
   if (size > sizeof(asio::detail::sockaddr_un_type))
@@ -70,32 +74,38 @@ void endpoint::resize(std::size_t size)
   }
 }
 
+ASIO_DECL
 std::string endpoint::path() const
 {
   return std::string(data_.local.sun_path, path_length_);
 }
 
+ASIO_DECL
 void endpoint::path(const char* p)
 {
   using namespace std; // For strlen.
   init(p, strlen(p));
 }
 
+ASIO_DECL
 void endpoint::path(const std::string& p)
 {
   init(p.data(), p.length());
 }
 
+ASIO_DECL
 bool operator==(const endpoint& e1, const endpoint& e2)
 {
   return e1.path() == e2.path();
 }
 
+ASIO_DECL
 bool operator<(const endpoint& e1, const endpoint& e2)
 {
   return e1.path() < e2.path();
 }
 
+ASIO_DECL
 void endpoint::init(const char* path, std::size_t path_length)
 {
   if (path_length > sizeof(data_.local.sun_path) - 1)