Skip to content

Commit f6d350f

Browse files
committed
Making MSVC happy
1 parent b357e5c commit f6d350f

File tree

5 files changed

+26
-26
lines changed

5 files changed

+26
-26
lines changed

lib/inc/sys_string/impl/unicode/mappings_data.h

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@
1111
namespace sysstr::util::unicode
1212
{
1313

14-
constexpr char16_t is_whitespace::chars[26] =
14+
inline constexpr char16_t is_whitespace::chars[26] =
1515
u"\u0009\u000A\u000B\u000C\u000D\u0020\u0085\u00A0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007"
1616
u"\u2008\u2009\u200A\u2028\u2029\u202F\u205F\u3000";
1717

18-
constexpr char16_t case_mapper::cased_data[3940] =
18+
inline constexpr char16_t case_mapper::cased_data[3940] =
1919
u"\u0061\u0062\u0063\u0064\u0065\u0066\u0067\u0068\u0069\u006A\u006B\u006C\u006D\u006E\u006F\u0070\u0071"
2020
u"\u0072\u0073\u0074\u0075\u0076\u0077\u0078\u0079\u007A\u0041\u0042\u0043\u0044\u0045\u0046\u0047\u0048"
2121
u"\u0049\u004A\u004B\u004C\u004D\u004E\u004F\u0050\u0051\u0052\u0053\u0054\u0055\u0056\u0057\u0058\u0059"
@@ -239,7 +239,7 @@ namespace sysstr::util::unicode
239239
u"\U0001E911\U0001E912\U0001E913\U0001E914\U0001E915\U0001E916\U0001E917\U0001E918\U0001E919\U0001E91A"
240240
u"\U0001E91B\U0001E91C\U0001E91D\U0001E91E\U0001E91F\U0001E920\U0001E921";
241241

242-
constexpr std::array<uint32_t, 128> case_mapper::lookup::ascii({{
242+
inline constexpr std::array<uint32_t, 128> case_mapper::lookup::ascii({{
243243
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
244244
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
245245
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
@@ -255,7 +255,7 @@ namespace sysstr::util::unicode
255255
0x10100047, 0x10100047, 0x10100047, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000
256256
}});
257257

258-
constexpr std::array<uint8_t, 2048> case_mapper::lookup::stage1({{
258+
inline constexpr std::array<uint8_t, 2048> case_mapper::lookup::stage1({{
259259
23, 54, 55, 60, 40, 49, 59, 30, 36, 6, 0, 10, 43, 39, 37, 57, 44, 0, 20, 0, 0, 0, 56, 33, 45, 0, 0, 0, 0, 0,
260260
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
261261
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 41, 0, 14, 42, 46, 38, 0, 0, 0, 0,
@@ -327,7 +327,7 @@ namespace sysstr::util::unicode
327327
0, 0, 0, 0, 0, 0, 0, 0
328328
}});
329329

330-
constexpr std::array<std::array<uint16_t, 32>, 64> case_mapper::lookup::stage2({{
330+
inline constexpr std::array<std::array<uint16_t, 32>, 64> case_mapper::lookup::stage2({{
331331
{{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}},
332332
{{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4}},
333333
{{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17}},
@@ -394,7 +394,7 @@ namespace sysstr::util::unicode
394394
{{347, 347, 347, 331, 347, 347, 343, 54, 61, 17, 123, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}}
395395
}});
396396

397-
constexpr std::array<std::array<uint16_t, 16>, 359> case_mapper::lookup::stage3({{
397+
inline constexpr std::array<std::array<uint16_t, 16>, 359> case_mapper::lookup::stage3({{
398398
{{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}},
399399
{{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 751}},
400400
{{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 751, 0}},
@@ -756,7 +756,7 @@ namespace sysstr::util::unicode
756756
{{ 752, 752, 752, 752, 752, 752, 752, 752, 752, 752, 752, 752, 752, 752, 752, 752}}
757757
}});
758758

759-
constexpr std::array<uint32_t, 754> case_mapper::lookup::stage4({{
759+
inline constexpr std::array<uint32_t, 754> case_mapper::lookup::stage4({{
760760
0x00000000, 0x10000000, 0x10010F5C, 0x10100085, 0x10100086, 0x10100088, 0x10100089, 0x1010008A, 0x1010008B, 0x1010008C,
761761
0x1010008D, 0x1010008E, 0x1010008F, 0x10100090, 0x10100091, 0x10100092, 0x10100095, 0x10100096, 0x10100097, 0x10100099,
762762
0x1010009A, 0x1010009C, 0x101000A3, 0x101000A5, 0x101000A6, 0x101000A9, 0x101000AE, 0x101000B8, 0x10100111, 0x10100187,
@@ -836,7 +836,7 @@ namespace sysstr::util::unicode
836836
}});
837837

838838

839-
constexpr uint32_t normalizer::compositions[] = {
839+
inline constexpr uint32_t normalizer::compositions[] = {
840840
0x2000003B, 0x0000003C, 0x20200338, 0x0000226E, 0x0000003D, 0x20200338, 0x00002260, 0x0000003E, 0x20200338, 0x0000226F,
841841
0x00000041, 0x1CC00300, 0x000000C0, 0x1CC00301, 0x000000C1, 0x1CC00302, 0x000000C2, 0x1CC00303, 0x000000C3, 0x1CC00308,
842842
0x000000C4, 0x1CC0030A, 0x000000C5, 0x1CC00304, 0x00000100, 0x1CC00306, 0x00000102, 0x19400328, 0x00000104, 0x1CC0030C,
@@ -1187,7 +1187,7 @@ namespace sysstr::util::unicode
11871187
0x200295B6, 0x20029B30, 0x2002A0CE, 0x2002A105, 0x2002A20E, 0x2002A291, 0x2002A392, 0x2002A600
11881188
};
11891189

1190-
constexpr uint32_t normalizer::values[] = {
1190+
inline constexpr uint32_t normalizer::values[] = {
11911191
0x2100AFFF, 0x2200AFFF, 0x2300A332, 0x2400AFFF, 0x2500A33B, 0x2600A33E, 0x21032346, 0x2104AFFF, 0x2204AFFF, 0x2304A349,
11921192
0x2404AFFF, 0x2108EFFF, 0x2208EFFF, 0x2308EFFF, 0x2408E352, 0x210CFFFF, 0x210E2FFF, 0x220E2FFF, 0x230E2355, 0x240E235E,
11931193
0x250E2365, 0x21137FFF, 0x22137FFF, 0x23137FFF, 0x2413736B, 0x21175FFF, 0x21196FFF, 0x22196FFF, 0x23196374, 0x24196FFF,
@@ -1431,7 +1431,7 @@ namespace sysstr::util::unicode
14311431
0x80000D1B
14321432
};
14331433

1434-
constexpr std::array<uint16_t, 128> normalizer::lookup::ascii({{
1434+
inline constexpr std::array<uint16_t, 128> normalizer::lookup::ascii({{
14351435
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
14361436
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
14371437
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
@@ -1443,7 +1443,7 @@ namespace sysstr::util::unicode
14431443
0x081C, 0x081C, 0x081C, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000
14441444
}});
14451445

1446-
constexpr std::array<uint8_t, 2048> normalizer::lookup::stage1({{
1446+
inline constexpr std::array<uint8_t, 2048> normalizer::lookup::stage1({{
14471447
22, 46, 49, 42, 41, 40, 30, 32, 37, 5, 0, 10, 21, 39, 33, 51, 52, 45, 0, 0, 0, 16, 13, 0, 36, 0, 0, 0, 0, 0,
14481448
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
14491449
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 24, 44, 18, 0, 0, 0, 0,
@@ -1515,7 +1515,7 @@ namespace sysstr::util::unicode
15151515
0, 0, 0, 0, 0, 0, 0, 0
15161516
}});
15171517

1518-
constexpr std::array<std::array<uint16_t, 32>, 54> normalizer::lookup::stage2({{
1518+
inline constexpr std::array<std::array<uint16_t, 32>, 54> normalizer::lookup::stage2({{
15191519
{{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}},
15201520
{{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16}},
15211521
{{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 254}},
@@ -1572,7 +1572,7 @@ namespace sysstr::util::unicode
15721572
{{293, 296, 278, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 292, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}}
15731573
}});
15741574

1575-
constexpr std::array<std::array<uint16_t, 16>, 308> normalizer::lookup::stage3({{
1575+
inline constexpr std::array<std::array<uint16_t, 16>, 308> normalizer::lookup::stage3({{
15761576
{{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}},
15771577
{{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 179}},
15781578
{{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 439}},
@@ -1883,7 +1883,7 @@ namespace sysstr::util::unicode
18831883
{{495, 495, 478, 478, 436, 436, 436, 436, 488, 478, 478, 478, 478, 483, 483, 483}}
18841884
}});
18851885

1886-
constexpr std::array<uint16_t, 498> normalizer::lookup::stage4({{
1886+
inline constexpr std::array<uint16_t, 498> normalizer::lookup::stage4({{
18871887
0x0000, 0x0009, 0x0060, 0x0064, 0x0068, 0x006D, 0x006F, 0x0072, 0x0074, 0x00C0, 0x00C1, 0x00C2, 0x00C4, 0x00C6, 0x00C7,
18881888
0x00C8, 0x00CA, 0x00CB, 0x00CD, 0x00CF, 0x00D2, 0x00D3, 0x00D7, 0x00DA, 0x00DC, 0x00DE, 0x00E1, 0x00ED, 0x00FF, 0x0104,
18891889
0x010C, 0x0128, 0x0129, 0x012B, 0x012E, 0x0130, 0x0132, 0x0138, 0x0152, 0x0156, 0x0164, 0x016A, 0x016F, 0x01C2, 0x01F4,
@@ -1921,7 +1921,7 @@ namespace sysstr::util::unicode
19211921
}});
19221922

19231923

1924-
constexpr std::array<uint8_t, 128> grapheme_cluster_break_prop::ascii({{
1924+
inline constexpr std::array<uint8_t, 128> grapheme_cluster_break_prop::ascii({{
19251925
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x01, 0x01, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
19261926
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
19271927
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
@@ -1931,7 +1931,7 @@ namespace sysstr::util::unicode
19311931
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01
19321932
}});
19331933

1934-
constexpr std::array<uint8_t, 2048> grapheme_cluster_break_prop::stage1({{
1934+
inline constexpr std::array<uint8_t, 2048> grapheme_cluster_break_prop::stage1({{
19351935
27, 14, 26, 53, 42, 48, 70, 31, 35, 4, 0, 11, 45, 41, 40, 0, 44, 10, 21, 63, 6, 12, 17, 0,
19361936
38, 25, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
19371937
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
@@ -2020,7 +2020,7 @@ namespace sysstr::util::unicode
20202020
0, 0, 0, 0, 0, 0, 0, 0
20212021
}});
20222022

2023-
constexpr std::array<std::array<uint16_t, 32>, 74> grapheme_cluster_break_prop::stage2({{
2023+
inline constexpr std::array<std::array<uint16_t, 32>, 74> grapheme_cluster_break_prop::stage2({{
20242024
{{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}},
20252025
{{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12}},
20262026
{{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 89, 255, 252, 0, 39, 0, 0, 0, 0, 0}},
@@ -2097,7 +2097,7 @@ namespace sysstr::util::unicode
20972097
{{285, 285, 285, 269, 285, 285, 281, 84, 98, 32, 153, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}}
20982098
}});
20992099

2100-
constexpr std::array<std::array<uint8_t, 16>, 286> grapheme_cluster_break_prop::stage3({{
2100+
inline constexpr std::array<std::array<uint8_t, 16>, 286> grapheme_cluster_break_prop::stage3({{
21012101
{{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}},
21022102
{{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1}},
21032103
{{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4}},
@@ -2386,7 +2386,7 @@ namespace sysstr::util::unicode
23862386
{{14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14}}
23872387
}});
23882388

2389-
constexpr std::array<uint8_t, 16> grapheme_cluster_break_prop::stage4({{
2389+
inline constexpr std::array<uint8_t, 16> grapheme_cluster_break_prop::stage4({{
23902390
0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x10, 0x20, 0x22, 0x32
23912391
}});
23922392

unicode/scripts/case_builder.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ class props
188188

189189
def print_impl(self):
190190
ret = f'''
191-
constexpr char16_t case_mapper::cased_data[{self.__cased_data_len}] =
191+
inline constexpr char16_t case_mapper::cased_data[{self.__cased_data_len}] =
192192
{indent_insert(format_utf16_string(self.__mapped_data), 12)};
193193
194194
{indent_insert(self.__builder.print_impl("case_mapper::lookup"), 8)}

unicode/scripts/lookup_builder.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ class {name}
5353

5454
def print_impl(self, name):
5555
ret = f'''
56-
constexpr char16_t {name}::chars[{self.length}] =
56+
inline constexpr char16_t {name}::chars[{self.length}] =
5757
{indent_insert(format_utf16_string(self.chars), 12)};
5858
'''
5959
return dedent(ret)

unicode/scripts/norm_builder.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -391,11 +391,11 @@ class normalizer
391391

392392
def print_impl(self):
393393
ret = f'''
394-
constexpr uint32_t normalizer::compositions[] = {{
394+
inline constexpr uint32_t normalizer::compositions[] = {{
395395
{indent_insert(format_array(self.__compositions, ishex=True, bits=32), 12)}
396396
}};
397397
398-
constexpr uint32_t normalizer::values[] = {{
398+
inline constexpr uint32_t normalizer::values[] = {{
399399
{indent_insert(format_array(self.__values, ishex=True, bits=32), 12)}
400400
}};
401401

unicode/scripts/trie_builder.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -211,20 +211,20 @@ class {name}
211211

212212
def print_impl(self, name):
213213
ret = f'''
214-
constexpr std::array<{type_for_bits(self.__bits_for_ascii)}, {len(self.__ascii)}> {name}::ascii({{{{
214+
inline constexpr std::array<{type_for_bits(self.__bits_for_ascii)}, {len(self.__ascii)}> {name}::ascii({{{{
215215
{indent_insert(format_array(self.__ascii, ishex=True, bits=self.__bits_for_ascii), 12)}
216216
}}}});
217217
'''
218218
for idx, values in enumerate(self.__values):
219219
if isinstance(values[0], int):
220220
ret += f'''
221-
constexpr std::array<{type_for_bits(self.__bits_for_values[idx])}, {len(values)}> {name}::stage{idx + 1}({{{{
221+
inline constexpr std::array<{type_for_bits(self.__bits_for_values[idx])}, {len(values)}> {name}::stage{idx + 1}({{{{
222222
{indent_insert(format_array(values, ishex=idx!=0, bits=self.__bits_for_values[idx]), 12)}
223223
}}}});
224224
'''
225225
else:
226226
ret += f'''
227-
constexpr std::array<std::array<{type_for_bits(self.__bits_for_values[idx])}, {len(values[0])}>, {len(values)}> {name}::stage{idx + 1}({{{{
227+
inline constexpr std::array<std::array<{type_for_bits(self.__bits_for_values[idx])}, {len(values[0])}>, {len(values)}> {name}::stage{idx + 1}({{{{
228228
{indent_insert(self.__make_nested(values, bits=self.__bits_for_values[idx]), 12)}
229229
}}}});
230230
'''

0 commit comments

Comments
 (0)