Skip to content

Commit 5537bcd

Browse files
committed
build: added missing INET_API tags to fix link errors of dependent projects on Windows
1 parent efe7cc8 commit 5537bcd

9 files changed

Lines changed: 31 additions & 35 deletions

File tree

src/inet/common/ModuleAccess.h

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,9 @@ INET_API cModule *findModuleUnderContainingNode(const cModule *from);
6262
* Returns the pointer to a module of type T or throws an error if module not found
6363
* or type mismatch.
6464
*/
65-
template<typename T>
66-
INET_API T *findModuleFromPar(cPar& par, const cModule *from, bool required = true);
6765

6866
template<typename T>
69-
T *findModuleFromPar(cPar& par, const cModule *from, bool required)
67+
T *findModuleFromPar(cPar& par, const cModule *from, bool required = true)
7068
{
7169
const char *path = par;
7270
if (path && *path) {
@@ -91,11 +89,9 @@ T *findModuleFromPar(cPar& par, const cModule *from, bool required)
9189
* Returns the pointer to a module of type T or throws an error if module not found
9290
* or type mismatch.
9391
*/
94-
template<typename T>
95-
INET_API T *getModuleFromPar(cPar& par, const cModule *from, bool required = true);
9692

9793
template<typename T>
98-
T *getModuleFromPar(cPar& par, const cModule *from, bool required)
94+
T *getModuleFromPar(cPar& par, const cModule *from, bool required = true)
9995
{
10096
const char *path = par;
10197
cModule *mod = from->getModuleByPath(path);
@@ -128,7 +124,7 @@ INET_API InterfaceEntry *getContainingNicModule(const cModule *from);
128124
* Returns nullptr if no such module is found along the path.
129125
*/
130126
template<typename T>
131-
INET_API cGate *findConnectedGate(cGate *gate, int direction = 0)
127+
cGate *findConnectedGate(cGate *gate, int direction = 0)
132128
{
133129
if (!gate->isConnectedOutside())
134130
return nullptr;
@@ -155,7 +151,7 @@ INET_API cGate *findConnectedGate(cGate *gate, int direction = 0)
155151
* Throws an error if no such module is found along the path.
156152
*/
157153
template<typename T>
158-
INET_API cGate *getConnectedGate(cGate *gate, int direction = 0)
154+
cGate *getConnectedGate(cGate *gate, int direction = 0)
159155
{
160156
auto connectedGate = findConnectedGate<T>(gate, direction);
161157
if (connectedGate == nullptr)
@@ -168,7 +164,7 @@ INET_API cGate *getConnectedGate(cGate *gate, int direction = 0)
168164
* Returns nullptr if no such module is found along the path.
169165
*/
170166
template<typename T>
171-
INET_API T *findConnectedModule(cGate *gate, int direction = 0)
167+
T *findConnectedModule(cGate *gate, int direction = 0)
172168
{
173169
auto connectedGate = findConnectedGate<T>(gate, direction);
174170
return connectedGate != nullptr ? check_and_cast<T *>(connectedGate->getOwnerModule()) : nullptr;
@@ -179,7 +175,7 @@ INET_API T *findConnectedModule(cGate *gate, int direction = 0)
179175
* Throws an error if no such module is found along the path.
180176
*/
181177
template<typename T>
182-
INET_API T *getConnectedModule(cGate *gate, int direction = 0)
178+
T *getConnectedModule(cGate *gate, int direction = 0)
183179
{
184180
auto module = findConnectedModule<T>(gate, direction);
185181
if (module == nullptr)

src/inet/common/geometry/common/Coord.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ class INET_API Coord
8484
void setZ(double z) { this->z = z; }
8585

8686
/** @brief Returns a string with the value of the coordinate. */
87-
std::string str() const;
87+
inline std::string str() const;
8888

8989
/** @brief Returns the negated vector. */
9090
Coord operator-() const { return Coord(-x, -y, -z); }

src/inet/common/geometry/common/EulerAngles.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ class INET_API EulerAngles
5050
rad getGamma() const { return gamma; }
5151
void setGamma(rad gamma) { this->gamma = gamma; }
5252

53-
std::string str() const;
53+
inline std::string str() const;
5454

5555
bool isNil() const
5656
{

src/inet/common/geometry/common/Quaternion.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ class INET_API Quaternion
133133
*/
134134
void getSwingAndTwist(const Coord& direction, Quaternion& swing, Quaternion& twist) const;
135135

136-
std::string str() const;
136+
inline std::string str() const;
137137
};
138138

139139
inline std::ostream& operator<<(std::ostream& os, const Quaternion& q)

src/inet/common/packet/Message.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ class INET_API Message : public cMessage
112112
//@}
113113
};
114114

115-
class Request : public Message
115+
class INET_API Request : public Message
116116
{
117117
public:
118118
explicit Request(const char *name = "Req", short kind = 0);
@@ -121,7 +121,7 @@ class Request : public Message
121121
virtual Request *dup() const override { return new Request(*this); }
122122
};
123123

124-
class Indication : public Message
124+
class INET_API Indication : public Message
125125
{
126126
public:
127127
explicit Indication(const char *name = "Ind", short kind = 0);

src/inet/common/packet/tag/RegionTagSet.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,17 +106,17 @@ class INET_API RegionTagSet : public cObject
106106
/**
107107
* Returns the number of tags.
108108
*/
109-
int getNumTags() const;
109+
inline int getNumTags() const;
110110

111111
/**
112112
* Returns the tag at the given index.
113113
*/
114-
cObject *getTag(int index) const;
114+
inline cObject *getTag(int index) const;
115115

116116
/**
117117
* Returns the region tag at the given index.
118118
*/
119-
const RegionTag<cObject>& getRegionTag(int index) const;
119+
inline const RegionTag<cObject>& getRegionTag(int index) const;
120120

121121
/**
122122
* Clears the set of tags in the given region.

src/inet/common/packet/tag/TagSet.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,12 @@ class INET_API TagSet : public cObject
5252
/**
5353
* Returns the number of tags.
5454
*/
55-
int getNumTags() const;
55+
inline int getNumTags() const;
5656

5757
/**
5858
* Returns the tag at the given index. The index must be in the range [0, getNumTags()).
5959
*/
60-
cObject *getTag(int index) const;
60+
inline cObject *getTag(int index) const;
6161

6262
/**
6363
* Clears the set of tags.

src/inet/networklayer/common/L3Tools.h

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,15 @@
2424

2525
namespace inet {
2626

27-
const Protocol *findNetworkProtocol(Packet *packet);
28-
const Protocol& getNetworkProtocol(Packet *packet);
27+
INET_API const Protocol *findNetworkProtocol(Packet *packet);
28+
INET_API const Protocol& getNetworkProtocol(Packet *packet);
2929

30-
const Ptr<const NetworkHeaderBase> findNetworkProtocolHeader(Packet *packet);
31-
const Ptr<const NetworkHeaderBase> getNetworkProtocolHeader(Packet *packet);
30+
INET_API const Ptr<const NetworkHeaderBase> findNetworkProtocolHeader(Packet *packet);
31+
INET_API const Ptr<const NetworkHeaderBase> getNetworkProtocolHeader(Packet *packet);
3232

33-
const Ptr<const NetworkHeaderBase> peekNetworkProtocolHeader(const Packet *packet, const Protocol& protocol);
33+
INET_API const Ptr<const NetworkHeaderBase> peekNetworkProtocolHeader(const Packet *packet, const Protocol& protocol);
3434

35-
void insertNetworkProtocolHeader(Packet *packet, const Protocol& protocol, const Ptr<NetworkHeaderBase>& header);
35+
INET_API void insertNetworkProtocolHeader(Packet *packet, const Protocol& protocol, const Ptr<NetworkHeaderBase>& header);
3636

3737
template <typename T>
3838
const Ptr<T> removeNetworkProtocolHeader(Packet *packet)
@@ -41,7 +41,7 @@ const Ptr<T> removeNetworkProtocolHeader(Packet *packet)
4141
return removeProtocolHeader<T>(packet);
4242
}
4343

44-
const Ptr<NetworkHeaderBase> removeNetworkProtocolHeader(Packet *packet, const Protocol& protocol);
44+
INET_API const Ptr<NetworkHeaderBase> removeNetworkProtocolHeader(Packet *packet, const Protocol& protocol);
4545

4646
};
4747

src/inet/transportlayer/common/L4Tools.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,17 +24,17 @@
2424

2525
namespace inet {
2626

27-
const Protocol *findTransportProtocol(Packet *packet);
28-
const Protocol& getProtocolId(Packet *packet);
27+
INET_API const Protocol *findTransportProtocol(Packet *packet);
28+
INET_API const Protocol& getProtocolId(Packet *packet);
2929

30-
const Ptr<const TransportHeaderBase> findTransportProtocolHeader(Packet *packet);
31-
const Ptr<const TransportHeaderBase> getTransportProtocolHeader(Packet *packet);
30+
INET_API const Ptr<const TransportHeaderBase> findTransportProtocolHeader(Packet *packet);
31+
INET_API const Ptr<const TransportHeaderBase> getTransportProtocolHeader(Packet *packet);
3232

33-
bool isTransportProtocol(const Protocol& protocol);
33+
INET_API bool isTransportProtocol(const Protocol& protocol);
3434

35-
const Ptr<const TransportHeaderBase> peekTransportProtocolHeader(Packet *packet, const Protocol& protocol, int flags = 0);
35+
INET_API const Ptr<const TransportHeaderBase> peekTransportProtocolHeader(Packet *packet, const Protocol& protocol, int flags = 0);
3636

37-
void insertTransportProtocolHeader(Packet *packet, const Protocol& protocol, const Ptr<TransportHeaderBase>& header);
37+
INET_API void insertTransportProtocolHeader(Packet *packet, const Protocol& protocol, const Ptr<TransportHeaderBase>& header);
3838

3939
template <typename T>
4040
const Ptr<T> removeTransportProtocolHeader(Packet *packet)
@@ -43,7 +43,7 @@ const Ptr<T> removeTransportProtocolHeader(Packet *packet)
4343
return removeProtocolHeader<T>(packet);
4444
}
4545

46-
const Ptr<TransportHeaderBase> removeTransportProtocolHeader(Packet *packet, const Protocol& protocol);
46+
INET_API const Ptr<TransportHeaderBase> removeTransportProtocolHeader(Packet *packet, const Protocol& protocol);
4747

4848
}
4949

0 commit comments

Comments
 (0)