In its current state, ScummVM seems to invoke these methods just after
destroying the current GL context. According to the OpenGL spec:
"Issuing GL commands when the program does not have a current
context results in undefined behavior, up to and including program
termination."
Our old behavior was to deref a `nullptr`, which isn't that great. For
now, protect these two methods. If other ports seem to misbehave as
well, we can always expand the check to other methods.
The `glGet*` family of functions requires that all parameters of
different types are transparently converted into each other. For
example, you can request a boolean parameter as a float or a list of
double values as an integer. It might be considered bad practice to
request parameters through the wrongly-typed function, but to be spec-
compliant we need to implement this.
Introduce a new `::get_context_parameter()` to obtain a parameter
value, which is then converted to the right type by the respective
`::gl_get_*()` functions.
GLES 2.0 is a subset of OpenGL, so we allow applications to compile
against LibGL as if it fully supports GLES 2.0.
Additionally, we set the definitions to an integer value of `1` so
applications that check for availability like this...
int main() { return GL_ES_VERSION_2_0; }
...can actually compile. At least ScummVM uses this, and Mesa defines
their constants in the same way:
44b9e11ddb/include/GL/gl.h (L105)
Now that the userland has a compatiblity wrapper for select(), the
kernel doesn't need to implement this syscall natively. The poll()
interface been around since 1987, any code still using select()
should be slapped silly.
Note: the SerenityOS source tree mostly uses select() and not poll()
despite SerenityOS having support for poll() since early 2019...
Instead of checking __linux__ macro directly, the code should check if
this macro is defined. This is already done correctly a couple of lines
above.
I ran into this when trying to build libjs-test262 on MacOS where I got
the following error message
error: "__linux__" is not defined, evaluates to 0 [-Werror=undef]
We should use .to_string() and handle the possible exceptions.
This makes the displayed cell contents so much more informative than
'[object Object]' :^)
Now we give each sheet its own interpreter and realm, and only make them
share the VM.
This is to prepare for the next commit, which will be refactoring a
bunch of things to propagate exceptions via ThrowCompletionOr<T>.
The worksheet's realm does not change, and is not shared, so we can
safely leave the global environment be.
This fixes lexical scoping in the spreadsheet's runtime file.