Skip to content

Commit

Permalink
Fix Header Guard generation
Browse files Browse the repository at this point in the history
All symbols that start with one underscore followed by uppercase letter,
or all symbols that contain two underscores are reserved for the
compiler and the standard library. They should not be used in user code.
  • Loading branch information
andre-hartmann authored and Thomas Pircher committed Aug 4, 2017
1 parent f069ef9 commit afd2441
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions crc_symtable.py
Expand Up @@ -195,14 +195,14 @@ def _pretty_header_filename(filename):

def _pretty_hdrprotection(opt):
"""
Return the name of a C header protection (e.g. __CRC_IMPLEMENTATION_H__).
Return the name of a C header protection (e.g. CRC_IMPLEMENTATION_H).
"""
if opt.output_file is None:
filename = 'pycrc_stdout'
else:
filename = os.path.basename(opt.output_file)
out_str = ''.join([s.upper() if s.isalnum() else '_' for s in filename])
return '__' + out_str + '__'
return out_str


def _get_underlying_crc_t(opt):
Expand Down

0 comments on commit afd2441

Please sign in to comment.