| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
| 4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
| 5 | 5 |
| 6 """ Generator for C++ style thunks """ | 6 """ Generator for C++ style thunks """ |
| 7 | 7 |
| 8 import glob | 8 import glob |
| 9 import os | 9 import os |
| 10 import re | 10 import re |
| (...skipping 437 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 448 cright_node = filenode.GetChildren()[0] | 448 cright_node = filenode.GetChildren()[0] |
| 449 assert(cright_node.IsA('Copyright')) | 449 assert(cright_node.IsA('Copyright')) |
| 450 out.Write('%s\n' % cgen.Copyright(cright_node, cpp_style=True)) | 450 out.Write('%s\n' % cgen.Copyright(cright_node, cpp_style=True)) |
| 451 | 451 |
| 452 from_text = 'From %s' % ( | 452 from_text = 'From %s' % ( |
| 453 filenode.GetProperty('NAME').replace(os.sep,'/')) | 453 filenode.GetProperty('NAME').replace(os.sep,'/')) |
| 454 modified_text = 'modified %s.' % ( | 454 modified_text = 'modified %s.' % ( |
| 455 filenode.GetProperty('DATETIME')) | 455 filenode.GetProperty('DATETIME')) |
| 456 out.Write('// %s %s\n\n' % (from_text, modified_text)) | 456 out.Write('// %s %s\n\n' % (from_text, modified_text)) |
| 457 | 457 |
| 458 meta.AddBuiltinInclude('stdint.h') |
| 458 if meta.BuiltinIncludes(): | 459 if meta.BuiltinIncludes(): |
| 459 for include in sorted(meta.BuiltinIncludes()): | 460 for include in sorted(meta.BuiltinIncludes()): |
| 460 out.Write('#include <%s>\n' % include) | 461 out.Write('#include <%s>\n' % include) |
| 461 out.Write('\n') | 462 out.Write('\n') |
| 462 | 463 |
| 463 # TODO(teravest): Don't emit includes we don't need. | 464 # TODO(teravest): Don't emit includes we don't need. |
| 464 includes = ['ppapi/c/pp_errors.h', | 465 includes = ['ppapi/c/pp_errors.h', |
| 465 'ppapi/shared_impl/tracked_callback.h', | 466 'ppapi/shared_impl/tracked_callback.h', |
| 466 'ppapi/thunk/enter.h', | 467 'ppapi/thunk/enter.h', |
| 467 'ppapi/thunk/ppapi_thunk_export.h'] | 468 'ppapi/thunk/ppapi_thunk_export.h'] |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 574 print "Golden file for M13-M15 failed." | 575 print "Golden file for M13-M15 failed." |
| 575 failed = 1 | 576 failed = 1 |
| 576 else: | 577 else: |
| 577 print "Golden file for M13-M15 passed." | 578 print "Golden file for M13-M15 passed." |
| 578 | 579 |
| 579 return failed | 580 return failed |
| 580 | 581 |
| 581 | 582 |
| 582 if __name__ == '__main__': | 583 if __name__ == '__main__': |
| 583 sys.exit(Main(sys.argv[1:])) | 584 sys.exit(Main(sys.argv[1:])) |
| OLD | NEW |