Skip to content

Commit 29370a2

Browse files
committed
[cpprest-sdk]: use _XPLATSTR for string_t on Windows
1 parent 894ed06 commit 29370a2

2 files changed

Lines changed: 12 additions & 12 deletions

File tree

  • modules/openapi-generator/src/main/resources/cpp-rest-sdk-client
  • samples/client/petstore/cpp-restsdk/client/include/CppRestPetstoreClient/model

modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/model-header.mustache

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,14 +136,14 @@ public:
136136
std::map<e{{classname}},utility::string_t> enumToStrMap = {
137137
{{#allowableValues}}
138138
{{#enumVars}}
139-
{ e{{classname}}::{{{name}}}, "{{{name}}}" }{{^-last}},{{/-last}}
139+
{ e{{classname}}::{{{name}}}, _XPLATSTR("{{{name}}}") }{{^-last}},{{/-last}}
140140
{{/enumVars}}
141141
{{/allowableValues}}
142142
};
143143
std::map<utility::string_t,e{{classname}}> strToEnumMap = {
144144
{{#allowableValues}}
145145
{{#enumVars}}
146-
{ "{{{name}}}", e{{classname}}::{{{name}}} }{{^-last}},{{/-last}}
146+
{ _XPLATSTR("{{{name}}}"), e{{classname}}::{{{name}}} }{{^-last}},{{/-last}}
147147
{{/enumVars}}
148148
{{/allowableValues}}
149149
};

samples/client/petstore/cpp-restsdk/client/include/CppRestPetstoreClient/model/Color.h

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -67,18 +67,18 @@ class Color
6767
protected:
6868
eColor m_value;
6969
std::map<eColor,utility::string_t> enumToStrMap = {
70-
{ eColor::BLACK, "BLACK" },
71-
{ eColor::WHITE, "WHITE" },
72-
{ eColor::BROWN, "BROWN" },
73-
{ eColor::GOLDEN, "GOLDEN" },
74-
{ eColor::MIXED, "MIXED" }
70+
{ eColor::BLACK, _XPLATSTR("BLACK") },
71+
{ eColor::WHITE, _XPLATSTR("WHITE") },
72+
{ eColor::BROWN, _XPLATSTR("BROWN") },
73+
{ eColor::GOLDEN, _XPLATSTR("GOLDEN") },
74+
{ eColor::MIXED, _XPLATSTR("MIXED") }
7575
};
7676
std::map<utility::string_t,eColor> strToEnumMap = {
77-
{ "BLACK", eColor::BLACK },
78-
{ "WHITE", eColor::WHITE },
79-
{ "BROWN", eColor::BROWN },
80-
{ "GOLDEN", eColor::GOLDEN },
81-
{ "MIXED", eColor::MIXED }
77+
{ _XPLATSTR("BLACK"), eColor::BLACK },
78+
{ _XPLATSTR("WHITE"), eColor::WHITE },
79+
{ _XPLATSTR("BROWN"), eColor::BROWN },
80+
{ _XPLATSTR("GOLDEN"), eColor::GOLDEN },
81+
{ _XPLATSTR("MIXED"), eColor::MIXED }
8282
};
8383

8484
};

0 commit comments

Comments
 (0)