| OLD | NEW |
| 1 #!/usr/bin/python | 1 #!/usr/bin/python |
| 2 # Copyright (c) 2009 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2009 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 import string | 6 import string |
| 7 | 7 |
| 8 HEADER = """\ | 8 HEADER = """\ |
| 9 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 9 // Copyright (c) 2009 The Chromium Authors. All rights reserved. |
| 10 // Use of this source code is governed by a BSD-style license that can be | 10 // Use of this source code is governed by a BSD-style license that can be |
| (...skipping 400 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 411 print "\n#ifdef GMOCK_MUTANT_INCLUDE_LATE_OBJECT_BINDING" | 411 print "\n#ifdef GMOCK_MUTANT_INCLUDE_LATE_OBJECT_BINDING" |
| 412 mutant2 = mutant.replace("CreateFunctor(T* obj,", "CreateFunctor(T** obj,") | 412 mutant2 = mutant.replace("CreateFunctor(T* obj,", "CreateFunctor(T** obj,") |
| 413 mutant2 = mutant2.replace("new Mutant", "new MutantLateObjectBind") | 413 mutant2 = mutant2.replace("new Mutant", "new MutantLateObjectBind") |
| 414 mutant2 = mutant2.replace(" " * 17 + "Tuple", " " * 31 + "Tuple") | 414 mutant2 = mutant2.replace(" " * 17 + "Tuple", " " * 31 + "Tuple") |
| 415 print mutant2 | 415 print mutant2 |
| 416 print "#endif // GMOCK_MUTANT_INCLUDE_LATE_OBJECT_BINDING\n" | 416 print "#endif // GMOCK_MUTANT_INCLUDE_LATE_OBJECT_BINDING\n" |
| 417 | 417 |
| 418 # Functor for method with __stdcall calling conventions. | 418 # Functor for method with __stdcall calling conventions. |
| 419 print "#if defined (OS_WIN)" | 419 print "#if defined (OS_WIN)" |
| 420 stdcall = CREATE_METHOD_FUNCTOR_TEMPLATE.replace("U::", "__stdcall U::") | 420 stdcall = CREATE_METHOD_FUNCTOR_TEMPLATE.replace("U::", "__stdcall U::") |
| 421 print FixCode(stdcall % args) | 421 stdcall = FixCode(stdcall % args) |
| 422 print stdcall |
| 423 print "#ifdef GMOCK_MUTANT_INCLUDE_LATE_OBJECT_BINDING" |
| 424 stdcall2 = stdcall.replace("CreateFunctor(T* obj,", "CreateFunctor(T** obj,") |
| 425 stdcall2 = stdcall2.replace("new Mutant", "new MutantLateObjectBind") |
| 426 stdcall2 = stdcall2.replace(" " * 17 + "Tuple", " " * 31 + "Tuple") |
| 427 print stdcall2 |
| 428 print "#endif // GMOCK_MUTANT_INCLUDE_LATE_OBJECT_BINDING" |
| 422 print "#endif // OS_WIN\n" | 429 print "#endif // OS_WIN\n" |
| 423 | 430 |
| 424 | 431 |
| 425 def main(): | 432 def main(): |
| 426 print HEADER | 433 print HEADER |
| 427 for prebound in xrange(0, 4 + 1): | 434 for prebound in xrange(0, 4 + 1): |
| 428 for args in xrange(0, 4 + 1): | 435 for args in xrange(0, 4 + 1): |
| 429 GenerateDispatch(prebound, args) | 436 GenerateDispatch(prebound, args) |
| 430 print MUTANT | 437 print MUTANT |
| 431 for prebound in xrange(0, 4 + 1): | 438 for prebound in xrange(0, 4 + 1): |
| 432 for args in xrange(0, 4 + 1): | 439 for args in xrange(0, 4 + 1): |
| 433 GenerateCreateFunctor(prebound, args) | 440 GenerateCreateFunctor(prebound, args) |
| 434 print FOOTER | 441 print FOOTER |
| 435 | 442 |
| 436 if __name__ == "__main__": | 443 if __name__ == "__main__": |
| 437 main() | 444 main() |
| OLD | NEW |