Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset 713b8ce7 in mainline


Ignore:
Timestamp:
2014-08-27T21:29:07Z (7 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master
Children:
6ecc6ba6
Parents:
32e3cdf
Message:

Allow to specify guards for emitted includes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tools/autogen.py

    r32e3cdf r713b8ce7  
    3939def generate_includes(struct):
    4040        code = ""
    41         for i in range(len(struct['includes'])):
    42                 code = code + "#include %s\n" % struct['includes'][i]
     41        for include in struct['includes']:
     42                if 'guard' in include.keys():
     43                        code = code + "#ifdef %s\n" % include['guard']
     44                if 'negative-guard' in include.keys():
     45                        code = code + "#ifndef %s\n" % include['negative-guard']
     46                code = code + "#include %s\n" % include['include']
     47                if 'guard' in include.keys():
     48                        code = code + "#endif\n"
     49                if 'negative-guard' in include.keys():
     50                        code = code + "#endif\n"
    4351        return code.strip()
    4452
Note: See TracChangeset for help on using the changeset viewer.