VirtualBox

source: vbox/trunk/src/VBox/GuestHost/OpenGL/error/error.py@ 76541

Last change on this file since 76541 was 69392, checked in by vboxsync, 7 years ago

GuestHost/OpenGL: scm updates

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id Revision
File size: 1.2 KB
Line 
1# Copyright (c) 2001, Stanford University
2# All rights reserved.
3#
4# See the file LICENSE.txt for information on redistributing this software.
5
6
7from __future__ import print_function
8import sys
9
10import apiutil
11
12apiutil.CopyrightC()
13
14
15print("""#include <stdio.h>
16#include "cr_error.h"
17#include "cr_spu.h"
18#include "state/cr_statetypes.h"
19
20#if defined(WINDOWS)
21#define ERROR_APIENTRY __stdcall
22#else
23#define ERROR_APIENTRY
24#endif
25
26#define ERROR_UNUSED(x) ((void)x)""")
27
28
29keys = apiutil.GetDispatchedFunctions(sys.argv[1]+"/APIspec.txt")
30
31for func_name in keys:
32 return_type = apiutil.ReturnType(func_name)
33 params = apiutil.Parameters(func_name)
34 print('\nstatic %s ERROR_APIENTRY error%s(%s)' % (return_type, func_name, apiutil.MakeDeclarationString(params )))
35 print('{')
36 # Handle the void parameter list
37 for (name, type, vecSize) in params:
38 print('\tERROR_UNUSED(%s);' % name)
39 print('\tcrError("ERROR SPU: Unsupported function gl%s called!");' % func_name)
40 if return_type != "void":
41 print('\treturn (%s)0;' % return_type)
42 print('}')
43
44print('SPUNamedFunctionTable _cr_error_table[] = {')
45for index in range(len(keys)):
46 func_name = keys[index]
47 print('\t{ "%s", (SPUGenericFunction) error%s },' % (func_name, func_name ))
48print('\t{ NULL, NULL }')
49print('};')
Note: See TracBrowser for help on using the repository browser.

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