Now, the include guard will be generated with all the non
alpha-numeric characters replace with an '_'
Fixes #511
Signed-off-by: Yannick Brosseau <yannick.brosseau@gmail.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
def write(self):
outputFile = open(self.outputFilename,"w")
- includeGuard = self.outputFilename.upper().replace(".","_")
+ # Include guard macro will be created by uppercasing the filename and
+ # replacing all non alphanumeric characters with '_'
+ includeGuard = re.sub('[^0-9a-zA-Z]', '_', self.outputFilename.upper())
outputFile.write(HeaderFile.HEADER_TPL.format(providerName=self.template.domain,
includeGuard = includeGuard,