[api] Gate the bluetooth connection messages on their own define (#18281)

This commit is contained in:
J. Nick Koston
2026-08-11 21:31:13 -05:00
committed by GitHub
parent 9605b34c69
commit 37eae9b466
22 changed files with 238 additions and 128 deletions
+4 -1
View File
@@ -2401,7 +2401,10 @@ def get_varint64_ifdef(
# At least one 64-bit varint field is unconditional, so the guard must be unconditional.
return True, None
ifdefs.discard(None)
return True, ifdefs.pop() if len(ifdefs) == 1 else None
# Several guards: the define is needed under any of them, so emit the union.
# Falling back to unconditional would pull 64-bit varint support into builds
# that have none of them.
return True, " || ".join(sorted(ifdefs))
def build_enum_type(desc, enum_ifdef_map) -> tuple[str, str, str]: