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.

Location:
trunk/src/VBox/Additions/common/crOpenGL/feedback
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/common/crOpenGL/feedback/feedback.py

    r17269 r63939  
    44# See the file LICENSE.txt for information on redistributing this software.
    55
     6from __future__ import print_function
    67import sys
    78
     
    1112apiutil.CopyrightC()
    1213
    13 print """
     14print("""
    1415/* DO NOT EDIT - generated by feedback.py */
    1516#include <stdio.h>
     
    2021#include "cr_glstate.h"
    2122
    22 """
     23""")
    2324
    2425keys = apiutil.GetDispatchedFunctions(sys.argv[1]+"/APIspec.txt")
     
    2829        params = apiutil.Parameters(func_name)
    2930        if apiutil.FindSpecial( "feedback", func_name ):
    30                 print 'static %s FEEDBACKSPU_APIENTRY feedbackspu_%s( %s )' % ( return_type, func_name, apiutil.MakeDeclarationString(params) )
    31                 print '{'
    32                 print '\tfeedback_spu.super.%s( %s );' % ( func_name, apiutil.MakeCallString(params) )
    33                 print '}'
    34 
    35 
    36 
    37 print """
     31                print('static %s FEEDBACKSPU_APIENTRY feedbackspu_%s( %s )' % ( return_type, func_name, apiutil.MakeDeclarationString(params) ))
     32                print('{')
     33                print('\tfeedback_spu.super.%s( %s );' % ( func_name, apiutil.MakeCallString(params) ))
     34                print('}')
     35
     36
     37
     38print("""
    3839#define CHANGE( name, func ) crSPUChangeInterface( (void *)&(feedback_spu.self), (void *)feedback_spu.self.name, (void *)((SPUGenericFunction) func) )
    3940#define CHANGESWAP( name, swapfunc, regfunc ) crSPUChangeInterface( (void *)&(feedback_spu.self), (void *)feedback_spu.self.name, (void *)((SPUGenericFunction) (feedback_spu.swap ? swapfunc: regfunc )) )
     
    4142static void __loadFeedbackAPI( void )
    4243{
    43 """
     44""")
    4445for func_name in keys:
    4546        return_type = apiutil.ReturnType(func_name)
    4647        params = apiutil.Parameters(func_name)
    4748        if apiutil.FindSpecial( "feedback", func_name ):
    48                 print '\tCHANGE( %s, crStateFeedback%s );' % (func_name, func_name )
    49 print """
     49                print('\tCHANGE( %s, crStateFeedback%s );' % (func_name, func_name ))
     50print("""
    5051}
    5152
    5253static void __loadSelectAPI( void )
    5354{
    54 """
     55""")
    5556for func_name in keys:
    5657        if apiutil.FindSpecial( "select", func_name ):
    57                 print '\tCHANGE( %s, crStateSelect%s );' % (func_name, func_name )
     58                print('\tCHANGE( %s, crStateSelect%s );' % (func_name, func_name ))
    5859        elif apiutil.FindSpecial( "feedback", func_name ):
    59                 print '\tCHANGE( %s, feedbackspu_%s );' % (func_name, func_name )
    60 print """
     60                print('\tCHANGE( %s, feedbackspu_%s );' % (func_name, func_name ))
     61print("""
    6162}
    6263
    6364static void __loadRenderAPI( void )
    6465{
    65 """
     66""")
    6667
    6768for func_name in keys:
    6869        return_type = apiutil.ReturnType(func_name)
    6970        if apiutil.FindSpecial( "feedback", func_name ) or apiutil.FindSpecial( "select", func_name ):
    70                 print '\tCHANGE( %s, feedbackspu_%s );' % (func_name, func_name )
    71 print """
    72 }
    73 """
    74 
    75 print """
     71                print('\tCHANGE( %s, feedbackspu_%s );' % (func_name, func_name ))
     72print("""
     73}
     74""")
     75
     76print("""
    7677static GLint FEEDBACKSPU_APIENTRY feedbackspu_RenderMode ( GLenum mode )
    7778{
     
    211212
    212213SPUNamedFunctionTable _cr_feedback_table[] = {
    213 """
     214""")
    214215
    215216for func_name in keys:
    216217        if apiutil.FindSpecial( "feedback_state", func_name ):
    217                 print '\t{ "%s", (SPUGenericFunction) feedbackspu_%s }, ' % ( func_name, func_name )
    218 print """
     218                print('\t{ "%s", (SPUGenericFunction) feedbackspu_%s }, ' % ( func_name, func_name ))
     219print("""
    219220        { "GetBooleanv", (SPUGenericFunction) feedbackspu_GetBooleanv },
    220221        { "GetDoublev", (SPUGenericFunction) feedbackspu_GetDoublev },
     
    267268        { NULL, NULL }
    268269};
    269 """
     270""")
  • trunk/src/VBox/Additions/common/crOpenGL/feedback/feedback_funcs.py

    r17269 r63939  
    44# See the file LICENSE.txt for information on redistributing this software.
    55
     6from __future__ import print_function
    67import sys
    78
     
    1112apiutil.CopyrightC()
    1213
    13 print """
     14print("""
    1415/* DO NOT EDIT - THIS FILE AUTOMATICALLY GENERATED BY feedback_funcs.py SCRIPT */
    1516#ifndef CR_STATE_FEEDBACK_FUNCS_H
     
    2425#endif
    2526
    26 #define STATE_UNUSED(x) ((void)x)"""
     27#define STATE_UNUSED(x) ((void)x)""")
    2728
    2829keys = apiutil.GetDispatchedFunctions(sys.argv[1]+"/APIspec.txt")
     
    3132        return_type = apiutil.ReturnType(func_name)
    3233        params = apiutil.Parameters(func_name)
    33         print '%s STATE_APIENTRY crStateFeedback%s( %s );' % (return_type, func_name, apiutil.MakeDeclarationString(params))
     34        print('%s STATE_APIENTRY crStateFeedback%s( %s );' % (return_type, func_name, apiutil.MakeDeclarationString(params)))
    3435
    3536for func_name in apiutil.AllSpecials( "select" ):
    3637        return_type = apiutil.ReturnType(func_name)
    3738        params = apiutil.Parameters(func_name)
    38         print '%s STATE_APIENTRY crStateSelect%s( %s );' % (return_type, func_name, apiutil.MakeDeclarationString(params))
    39 print '\n#endif /* CR_STATE_FEEDBACK_FUNCS_H */'
     39        print('%s STATE_APIENTRY crStateSelect%s( %s );' % (return_type, func_name, apiutil.MakeDeclarationString(params)))
     40print('\n#endif /* CR_STATE_FEEDBACK_FUNCS_H */')
  • trunk/src/VBox/Additions/common/crOpenGL/feedback/feedback_state.py

    r42499 r63939  
    44# See the file LICENSE.txt for information on redistributing this software.
    55
     6from __future__ import print_function
    67import sys
    78
     
    1112apiutil.CopyrightC()
    1213
    13 print """
     14print("""
    1415#include "cr_server.h"
    1516#include "feedbackspu.h"
    1617#include "feedbackspu_proto.h"
    17 """
     18""")
    1819custom = ["CreateContext", "VBoxCreateContext", "MakeCurrent", "DestroyContext"]
    1920
     
    2627        return_type = apiutil.ReturnType(func_name)
    2728        params = apiutil.Parameters(func_name)
    28         print '%s FEEDBACKSPU_APIENTRY feedbackspu_%s( %s )' % (return_type, func_name, apiutil.MakeDeclarationString(params))
    29         print '{'
    30         print '\tcrState%s( %s );' % (func_name, apiutil.MakeCallString(params))
    31         print ''
    32         print '\tfeedback_spu.super.%s( %s );' % (func_name, apiutil.MakeCallString(params))
    33         print '}'
     29        print('%s FEEDBACKSPU_APIENTRY feedbackspu_%s( %s )' % (return_type, func_name, apiutil.MakeDeclarationString(params)))
     30        print('{')
     31        print('\tcrState%s( %s );' % (func_name, apiutil.MakeCallString(params)))
     32        print('')
     33        print('\tfeedback_spu.super.%s( %s );' % (func_name, apiutil.MakeCallString(params)))
     34        print('}')
  • trunk/src/VBox/Additions/common/crOpenGL/feedback/feedbackspu_proto.py

    r17269 r63939  
    44# See the file LICENSE.txt for information on redistributing this software.
    55
     6from __future__ import print_function
    67import sys
    78
     
    1112apiutil.CopyrightC()
    1213
    13 print """
     14print("""
    1415/* DO NOT EDIT - generated by feedback.py */
    1516
     
    1920#include "feedbackspu.h"
    2021
    21 """
     22""")
    2223
    2324keys = apiutil.GetDispatchedFunctions(sys.argv[1]+"/APIspec.txt")
     
    2728                return_type = apiutil.ReturnType(func_name)
    2829                params = apiutil.Parameters(func_name)
    29                 print 'extern %s FEEDBACKSPU_APIENTRY feedbackspu_%s( %s );' % (return_type, func_name, apiutil.MakeDeclarationString(params))
     30                print('extern %s FEEDBACKSPU_APIENTRY feedbackspu_%s( %s );' % (return_type, func_name, apiutil.MakeDeclarationString(params)))
    3031
    3132
    32 print """
     33print("""
    3334#endif
    34 """
     35""")
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