The generated data for libunicodedata.so is quite large, and loading it
is a price paid by nearly every application by way of depending on
LibRegex. In order to defer this cost until an application actually uses
one of the surrounding APIs, dynamically load the generated symbols.
To be able to load the symbols dynamically, the generated methods must
have demangled names. Typically, this is accomplished with `extern "C"`
blocks. The clang toolchain complains about this here because the types
returned from the generators are strictly C++ types. So to demangle the
names, we use the asm() compiler directive to manually define a symbol
name; the caveat is that we *must* be sure the symbols are unique. As an
extra precaution, we prefix each symbol name with "unicode_". For more
details, see: https://gcc.gnu.org/onlinedocs/gcc/Asm-Labels.html
This symbol loader used in this implementation provides the additional
benefit of removing many [[maybe_unused]] attributes from the LibUnicode
methods. Internally, if ENABLE_UNICODE_DATABASE_DOWNLOAD is OFF, the
loader is able to stub out the function pointers it returns.
Note that as of this commit, LibUnicode is still directly linked against
LibUnicodeData. This commit is just a first step towards removing that.
Loading libunicodedata.so will require dlopen(), which in turn requires
mmap(). The 'prot_exec' pledge is needed for this.
Further, the .so itself must be unveiled for reading. The "real" path is
unveiled (libunicodedata.so.serenity) as the symlink (libunicodedata.so)
itself cannot be unveiled.
Remove note about CMake Tools as version 1.9.0 has shipped and no longer
needed. Update details for files to latest versions and allow easier
copy and paste into an empty file.
This is a deprecated feature that is still in use in some older games,
most notably Grim Fandango in ScummVM makes heavy use of it.
Luckily, since you can only draw convex polygons, the end result is
exactly the same as when you would have used `glBegin(GL_TRIANGLE_FAN)`
- so we just reuse that code as-is.
Implement support for the `GL_TEXTURE` matrix mode, the texture matrix
stack and texture coordinate matrix transformation.
Also, an unused `m_current_matrix` was removed to make room for
`m_texture_matrix`.
In OpenGL, texture coordinates can have up to 4 values. This change
will help with easy application of texture coordinate matrix
transformations in the future.
Additionally, correct the initial value for texture coordinates to
`{ 0.f, 0.f, 0.f, 1.f}`.
Not much to say here, this is an implementation of this call that
accesses the actual limit constant that's used by the VirtualFileSystem
class.
As a side note, this is required for my eventual Qt port.
As pointed out by BertalanD on Discord, POSIX specifies that
_SC_SYMLOOP_MAX (implemented in the following commit) always needs to be
equal or more than _POSIX_SYMLOOP_MAX (8, defined in
LibC/bits/posix1_lim.h), hence I've increased it to that value to
comply with the standard.
The move to header is required for the following commit - to make this
constant accessible outside of the VFS class, namely in sysconf.
The actual value is unchanged, but the previous `0xffffffff` was an
unsigned value, which lead to clang getting mad at `foowc() == WEOF`.
This commit makes it a signed int on clang, which *should* serve
the same purpose and not lead to clang getting mad at us.
What the component which did the actual decoding is called is not
relevant for the error, and would be rather distracting once we show
decoding error messages e.g. in ImageViewer (instead of just silently
failing).
Also makes them more consistent as many already don't include it - a
mistake which is now turned into a feature :^)
This also replaces an instance of TRY with MUST as the spec indicates
that step 35b of RegExpBuiltinExec cannot throw. Further, this moves
some lines of code around to align with the spec as best as we can,
though the end effect is the same.
In doing so, this caught an erroneous ToObject invocation. In the one
spot that requires the value to be an object (the invocation to
LengthOfArrayLike), we know by then the value is an object because all
other possibilities have been handled.
In doing so, this fixes a few minor issues:
1. We were accessing the "unicode" and "lastIndex" properties out of
order. This is somewhat frequently tested by test262, but not in
this case.
2. We were doing a Value::to_object() followed by Object::get(), rather
than just Value::get() as the spec dictates.
3. We were TRYing a step (CreateDataPropertyOrThrow) that should never
fail, and should have been a MUST.
RegExpExec already returns a ThrowCompletionOr so this potentional error
should be a completion. RegExp.prototype [ @@replace ] is tripped up by
this mistake when implemented closer to the spec.