Debian Codegraph @

libc/newhdrgen/class_implementation/classes/macro.py

raw
1 #!/usr/bin/env python
2 #
3 # ====-- Macro class for libc function headers ----------------*- python -*--==#
4 #
5 # Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
6 # See https://llvm.org/LICENSE.txt for license information.
7 # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
8 #
9 # ==-------------------------------------------------------------------------==#
10
11
12 class Macro:
13 def __init__(self, name, value=None):
14 self.name = name
15 self.value = value
16
17 def __str__(self):
18 if self.value != None:
19 return f"#define {self.name} {self.value}"
20 else:
21 return f"#define {self.name}"