VirtualBox

Ignore:
Timestamp:
Sep 22, 2016 7:58:05 AM (8 years ago)
Author:
vboxsync
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/Additions/common/crOpenGL/NULLfuncs.py

    r16381 r63939  
    55
    66
     7from __future__ import print_function
    78import sys
    89
     
    1314apiutil.CopyrightC()
    1415
    15 print """
     16print("""
    1617/* DO NOT EDIT - THIS FILE GENERATED BY THE NULLfuncs.py SCRIPT */
    1718
    1819#include "cr_error.h"
    1920#include "stub.h"
    20 """
     21""")
    2122
    2223for func_name in keys:
     
    2425        params = apiutil.Parameters(func_name)
    2526
    26         print "static %s SPULOAD_APIENTRY NULL_%s( %s )" % (return_type, func_name, apiutil.MakeDeclarationString(params))
    27         print "{"
    28         print "\t/* do nothing */"
    29         print "\tcrWarning(\"YOU ARE CALLING A NULLED FUNCTION (%s)\");" % func_name
     27        print("static %s SPULOAD_APIENTRY NULL_%s( %s )" % (return_type, func_name, apiutil.MakeDeclarationString(params)))
     28        print("{")
     29        print("\t/* do nothing */")
     30        print("\tcrWarning(\"YOU ARE CALLING A NULLED FUNCTION (%s)\");" % func_name)
    3031        for (name, type, vecSize) in params:
    31                 print "\t(void) %s;" % name
     32                print("\t(void) %s;" % name)
    3233        if return_type != "void":
    33                 print "\treturn 0;"
    34         print "}"
    35         print ""
     34                print("\treturn 0;")
     35        print("}")
     36        print("")
    3637
    3738
    38 print "DECLEXPORT(SPUDispatchTable) stubNULLDispatch = {"
     39print("DECLEXPORT(SPUDispatchTable) stubNULLDispatch = {")
    3940for func_name in keys:
    40         print "\tNULL_%s," % (func_name)
    41 print "\tNULL,  /* copyList */"
    42 print "\tNULL,  /* copy_of */"
    43 print "\t0,     /* mark */"
    44 print "\tNULL   /* server */"
    45 print "};"
     41        print("\tNULL_%s," % (func_name))
     42print("\tNULL,  /* copyList */")
     43print("\tNULL,  /* copy_of */")
     44print("\t0,     /* mark */")
     45print("\tNULL   /* server */")
     46print("};")
    4647
    47 print ""
    48 print "/* Declare and initialize the glim dispatch table here so that we */"
    49 print "/* can initialize all entries to no-op routines. */"
    50 print "SPUDispatchTable glim = {"
     48print("")
     49print("/* Declare and initialize the glim dispatch table here so that we */")
     50print("/* can initialize all entries to no-op routines. */")
     51print("SPUDispatchTable glim = {")
    5152for func_name in keys:
    52         print "\tNULL_%s," % (func_name)
    53 print "\tNULL,  /* copyList */"
    54 print "\tNULL,  /* copy_of */"
    55 print "\t0,     /* mark */"
    56 print "\tNULL   /* server */"
    57 print "};"
     53        print("\tNULL_%s," % (func_name))
     54print("\tNULL,  /* copyList */")
     55print("\tNULL,  /* copy_of */")
     56print("\t0,     /* mark */")
     57print("\tNULL   /* server */")
     58print("};")
Note: See TracChangeset for help on using the changeset viewer.

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