VirtualBox

Ignore:
Timestamp:
Sep 22, 2016 7:58:05 AM (9 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
110825
Message:

Build/scripts (bugref:6627): Python build scripts updated to generate the same code when used with Python 2 and 3.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/GuestHost/OpenGL/error/error.py

    r37392 r63939  
    55
    66
     7from __future__ import print_function
    78import sys
    89
     
    1213
    1314
    14 print """#include <stdio.h>
     15print("""#include <stdio.h>
    1516#include "cr_error.h"
    1617#include "cr_spu.h"
     
    2324#endif
    2425
    25 #define ERROR_UNUSED(x) ((void)x)"""
     26#define ERROR_UNUSED(x) ((void)x)""")
    2627
    2728
     
    3132        return_type = apiutil.ReturnType(func_name)
    3233        params = apiutil.Parameters(func_name)
    33         print '\nstatic %s ERROR_APIENTRY error%s( %s )' % (return_type, func_name, apiutil.MakeDeclarationString(params ))
    34         print '{'
     34        print('\nstatic %s ERROR_APIENTRY error%s( %s )' % (return_type, func_name, apiutil.MakeDeclarationString(params )))
     35        print('{')
    3536        # Handle the void parameter list
    3637        for (name, type, vecSize) in params:
    37                 print '\tERROR_UNUSED(%s);' % name
    38         print '\tcrError( "ERROR SPU: Unsupported function gl%s called!" );' % func_name
     38                print('\tERROR_UNUSED(%s);' % name)
     39        print('\tcrError( "ERROR SPU: Unsupported function gl%s called!" );' % func_name)
    3940        if return_type != "void":
    40                 print '\treturn (%s)0;' % return_type
    41         print '}'
     41                print('\treturn (%s)0;' % return_type)
     42        print('}')
    4243
    43 print 'SPUNamedFunctionTable _cr_error_table[] = {'
     44print('SPUNamedFunctionTable _cr_error_table[] = {')
    4445for index in range(len(keys)):
    4546        func_name = keys[index]
    46         print '\t{ "%s", (SPUGenericFunction) error%s },' % (func_name, func_name )
    47 print '\t{ NULL, NULL }'
    48 print '};'
     47        print('\t{ "%s", (SPUGenericFunction) error%s },' % (func_name, func_name ))
     48print('\t{ NULL, NULL }')
     49print('};')
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette