[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
This commit is contained in:
Arthur O'Dwyer 2021-03-18 10:28:56 -04:00
parent 64bb3759dd
commit eb37d3546c
1 changed files with 2 additions and 2 deletions

View File

@ -720,7 +720,7 @@ def get_std_number(std):
def produce_macros_definition_for_std(std):
result = ""
indent = 56
indent = 55
for tc in feature_test_macros:
if std not in tc["values"]:
continue
@ -734,7 +734,7 @@ def produce_macros_definition_for_std(std):
result += "# undef %s\n" % tc["name"]
line = "#%sdefine %s" % ((" " * inner_indent), tc["name"])
line += " " * (indent - len(line))
line += "%sL" % tc["values"][std]
line += " %sL" % tc["values"][std]
if 'unimplemented' in tc.keys():
line = "// " + line
result += line