File tree 2 files changed +16
-4
lines changed
Generals/Code/GameEngine/Include/Common
GeneralsMD/Code/GameEngine/Include/Common
2 files changed +16
-4
lines changed Original file line number Diff line number Diff line change @@ -190,10 +190,16 @@ namespace rts
190
190
191
191
template <> struct hash <AsciiString>
192
192
{
193
- size_t operator ()(AsciiString ast) const
194
- {
193
+ size_t operator ()(const AsciiString& ast) const
194
+ {
195
+ #ifdef USING_STLPORT
195
196
std::hash<const char *> tmp;
196
197
return tmp ((const char *) ast.str ());
198
+ #else
199
+ // TheSuperHackers @bugfix xezon 16/03/2024 Re-implements hash function that works with non-STLPort.
200
+ std::hash<std::string_view> hasher;
201
+ return hasher (std::string_view (ast.str (), ast.getLength ()));
202
+ #endif
197
203
}
198
204
};
199
205
Original file line number Diff line number Diff line change @@ -190,10 +190,16 @@ namespace rts
190
190
191
191
template <> struct hash <AsciiString>
192
192
{
193
- size_t operator ()(AsciiString ast) const
194
- {
193
+ size_t operator ()(const AsciiString& ast) const
194
+ {
195
+ #ifdef USING_STLPORT
195
196
std::hash<const char *> tmp;
196
197
return tmp ((const char *) ast.str ());
198
+ #else
199
+ // TheSuperHackers @bugfix xezon 16/03/2024 Re-implements hash function that works with non-STLPort.
200
+ std::hash<std::string_view> hasher;
201
+ return hasher (std::string_view (ast.str (), ast.getLength ()));
202
+ #endif
197
203
}
198
204
};
199
205
You can’t perform that action at this time.
0 commit comments