Commit 15b6b90
committed
common: fix: export CodeFragment/SharedDataManager with INET_API (Windows link error)
On Windows/MinGW, linking a project against INET's shared library failed to
resolve symbols defined in Compat.h -- e.g. CodeFragment's constructor, which
backs Register_Serializer and the other EXECUTE_* / Define_InitStage macros --
because the OMNETPP_BUILDNUM<2000 compat classes CodeFragment and
SharedDataManager were declared without INET_API and so were never dllexported.
Simply adding INET_API to the two classes does not compile, because INETDefs.h
included Compat.h before defining INET_API (the macro was an undefined token at
the declarations). Fix the ordering: move the Compat.h/ParsimPacking.h includes
below the INET_API definition in INETDefs.h, and make the two files that
included Compat.h directly (Compat.cc, QueueVisualizerBase.h) include INETDefs.h
instead. Add a guard to Compat.h that rejects direct inclusion with a clear
error, since it uses INET_API but does not define it.
No effect on non-Windows builds (INET_API is empty there). Verified by a full
release build.
Fixes #1108.1 parent c5dff26 commit 15b6b90
4 files changed
Lines changed: 17 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
| 8 | + | |
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
11 | 18 | | |
12 | 19 | | |
13 | 20 | | |
| |||
39 | 46 | | |
40 | 47 | | |
41 | 48 | | |
42 | | - | |
| 49 | + | |
43 | 50 | | |
44 | 51 | | |
45 | 52 | | |
| |||
186 | 193 | | |
187 | 194 | | |
188 | 195 | | |
189 | | - | |
| 196 | + | |
190 | 197 | | |
191 | 198 | | |
192 | 199 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | 28 | | |
32 | 29 | | |
33 | 30 | | |
| |||
48 | 45 | | |
49 | 46 | | |
50 | 47 | | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
51 | 54 | | |
52 | 55 | | |
53 | 56 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
| 11 | + | |
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| |||
0 commit comments