Commit 6d37d53
committed
Merged PR 13588380: Add accessor functions for
Exporting data symbols from a dynamic module makes linking complicated on Windows. It requires the headers to define the symbols as `__declspec(dllimport)` only on the consuming side, which requires either two separate headers, or special macros. Without `declspec(dllimport)` the linker will not be able to find the data symbols. This has tripped up a number of consumers.
Providing accessor functions alleviates this issue, and is better practice for a dynamic library anyway, because it provides better ABI stability and encapsulation.
Background:
- [Import into an application using __declspec(dllimport)](https://learn.microsoft.com/en-us/cpp/build/importing-into-an-application-using-declspec-dllimport?view=msvc-170)
- [LNK4217 - Russ Keldorph's WebLog - Site Home - MSDN Blogs (archive.org)](https://web.archive.org/web/20140911111411/http://blogs.msdn.com/b/russellk/archive/2005/03/20/399465.aspx?wa=wsignin1.0)
Related work items: #52850075extern const data symbols1 parent 207e74d commit 6d37d53
File tree
24 files changed
+883
-184
lines changed- inc
- lib
- modules
- posix/common
- windows
- kernel
- user
- unittest
- inc
- lib
- module_windows_sys_km
- module_windows_sys_um
- module_windows
24 files changed
+883
-184
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
6 | 10 | | |
7 | 11 | | |
| 12 | + | |
8 | 13 | | |
9 | | - | |
10 | 14 | | |
11 | 15 | | |
12 | 16 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
764 | 764 | | |
765 | 765 | | |
766 | 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 | + | |
767 | 796 | | |
768 | 797 | | |
769 | 798 | | |
| |||
2540 | 2569 | | |
2541 | 2570 | | |
2542 | 2571 | | |
| 2572 | + | |
| 2573 | + | |
| 2574 | + | |
| 2575 | + | |
| 2576 | + | |
| 2577 | + | |
| 2578 | + | |
| 2579 | + | |
| 2580 | + | |
| 2581 | + | |
| 2582 | + | |
| 2583 | + | |
| 2584 | + | |
| 2585 | + | |
| 2586 | + | |
| 2587 | + | |
| 2588 | + | |
| 2589 | + | |
| 2590 | + | |
| 2591 | + | |
| 2592 | + | |
| 2593 | + | |
| 2594 | + | |
| 2595 | + | |
| 2596 | + | |
| 2597 | + | |
| 2598 | + | |
2543 | 2599 | | |
2544 | 2600 | | |
2545 | 2601 | | |
| |||
3948 | 4004 | | |
3949 | 4005 | | |
3950 | 4006 | | |
| 4007 | + | |
| 4008 | + | |
| 4009 | + | |
| 4010 | + | |
| 4011 | + | |
| 4012 | + | |
| 4013 | + | |
3951 | 4014 | | |
3952 | 4015 | | |
3953 | 4016 | | |
| |||
4552 | 4615 | | |
4553 | 4616 | | |
4554 | 4617 | | |
| 4618 | + | |
| 4619 | + | |
| 4620 | + | |
| 4621 | + | |
| 4622 | + | |
| 4623 | + | |
| 4624 | + | |
| 4625 | + | |
| 4626 | + | |
| 4627 | + | |
| 4628 | + | |
| 4629 | + | |
| 4630 | + | |
| 4631 | + | |
| 4632 | + | |
| 4633 | + | |
| 4634 | + | |
| 4635 | + | |
4555 | 4636 | | |
4556 | 4637 | | |
4557 | 4638 | | |
| |||
8213 | 8294 | | |
8214 | 8295 | | |
8215 | 8296 | | |
| 8297 | + | |
| 8298 | + | |
| 8299 | + | |
| 8300 | + | |
| 8301 | + | |
| 8302 | + | |
| 8303 | + | |
| 8304 | + | |
| 8305 | + | |
| 8306 | + | |
| 8307 | + | |
| 8308 | + | |
| 8309 | + | |
| 8310 | + | |
| 8311 | + | |
| 8312 | + | |
| 8313 | + | |
| 8314 | + | |
| 8315 | + | |
| 8316 | + | |
| 8317 | + | |
| 8318 | + | |
8216 | 8319 | | |
8217 | 8320 | | |
8218 | 8321 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1097 | 1097 | | |
1098 | 1098 | | |
1099 | 1099 | | |
| 1100 | + | |
| 1101 | + | |
| 1102 | + | |
1100 | 1103 | | |
1101 | 1104 | | |
1102 | 1105 | | |
1103 | 1106 | | |
1104 | 1107 | | |
1105 | 1108 | | |
1106 | | - | |
1107 | | - | |
1108 | | - | |
1109 | 1109 | | |
1110 | 1110 | | |
1111 | 1111 | | |
| |||
1124 | 1124 | | |
1125 | 1125 | | |
1126 | 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 | + | |
1127 | 1155 | | |
1128 | 1156 | | |
1129 | 1157 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| 25 | + | |
25 | 26 | | |
26 | 27 | | |
27 | 28 | | |
| |||
0 commit comments