|
43 | 43 | function. This may happen for example when functions
|
44 | 44 | are added to a new version of an extension, but the
|
45 | 45 | extension string is not modified.
|
| 46 | + check_for_nullptr: Workaround for QTBUG-124370. Adds a check that ensures |
| 47 | + the function has been bound already. |
46 | 48 | By default, the function gets its name from the first name in its names or
|
47 | 49 | versions array. This can be overridden by supplying a 'known_as' key.
|
48 | 50 |
|
|
2980 | 2982 | 'arguments': 'HDC hdc', },
|
2981 | 2983 | { 'return_type': 'HGLRC',
|
2982 | 2984 | 'names': ['wglCreateContextAttribsARB'],
|
2983 |
| - 'arguments': 'HDC hDC, HGLRC hShareContext, const int* attribList', }, |
| 2985 | + 'arguments': 'HDC hDC, HGLRC hShareContext, const int* attribList', |
| 2986 | + 'check_for_nullptr': True, }, |
2984 | 2987 | { 'return_type': 'HGLRC',
|
2985 | 2988 | 'names': ['wglCreateLayerContext'],
|
2986 | 2989 | 'arguments': 'HDC hdc, int iLayerPlane', },
|
@@ -3727,8 +3730,12 @@ def MakeArgNames(arguments):
|
3727 | 3730 | file.write(' driver_->fn.%sFn(%s);\n' %
|
3728 | 3731 | (function_name, argument_names))
|
3729 | 3732 | else:
|
3730 |
| - file.write(' return driver_->fn.%sFn(%s);\n' % |
3731 |
| - (function_name, argument_names)) |
| 3733 | + if ('check_for_nullptr' in func): |
| 3734 | + file.write(' return driver_->fn.%sFn ?\n driver_->fn.%sFn(%s)\n : nullptr;\n' % |
| 3735 | + (function_name, function_name, argument_names)) |
| 3736 | + else: |
| 3737 | + file.write(' return driver_->fn.%sFn(%s);\n' % |
| 3738 | + (function_name, argument_names)) |
3732 | 3739 | file.write('}\n')
|
3733 | 3740 |
|
3734 | 3741 | # Write TraceGLApi functions
|
|
0 commit comments