Skip to content

Commit eb37d35

Browse files
committed
[libc++] Future-proof generate_feature_test_macro_components.py against long names.
`__cpp_lib_default_template_type_for_algorithm_values` is 52 characters long, which is enough to reduce the multiplier to less-than-zero, producing an empty string between the name of the macro and its numeric value. Ensure there's always a space between the name of the macro and its value. Differential Revision: https://reviews.llvm.org/D98869
1 parent 64bb375 commit eb37d35

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

libcxx/utils/generate_feature_test_macro_components.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -720,7 +720,7 @@ def get_std_number(std):
720720

721721
def produce_macros_definition_for_std(std):
722722
result = ""
723-
indent = 56
723+
indent = 55
724724
for tc in feature_test_macros:
725725
if std not in tc["values"]:
726726
continue
@@ -734,7 +734,7 @@ def produce_macros_definition_for_std(std):
734734
result += "# undef %s\n" % tc["name"]
735735
line = "#%sdefine %s" % ((" " * inner_indent), tc["name"])
736736
line += " " * (indent - len(line))
737-
line += "%sL" % tc["values"][std]
737+
line += " %sL" % tc["values"][std]
738738
if 'unimplemented' in tc.keys():
739739
line = "// " + line
740740
result += line

0 commit comments

Comments
 (0)