| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
| |
It's the only basic type missing, better to have for consistency.
|
|
|
|
|
| |
We want to be able to test whether it's possible to convert two
different fundamental types through GValue, so add a function for this.
|
|
|
|
|
| |
This can be used to test we don't do unexpected conversions between
invalid types.
|
|
|
|
|
|
|
|
|
|
| |
A fundamental type may or may not provide set and get value functions,
the regress implementations always provide one, so define a new type
with no such functions so that we can test this case in Gjs.
To avoid repeating lots of duplicated code, we re-use the same
functions of RegressTestFundamentalObject when possible, by using the
same structure.
|
| |
|
| |
|
|
|
|
|
| |
Newer versions of the GNU libc have started to warn if the result of the
call is unused.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
The hack that copies the doctemplates directory into the build
directory has stopped working with newer versions of Meson; while it's
possible to copy files, custom_target() cannot depend on a directory.
Additionally, the dependency has always been broken.
Instead, we enumerate the template files—after all, it's not like they
change a lot—and then we list them as dependencies for the test targets.
Fixes: #414
|
|
|
|
|
| |
We are going to use additional API that is only available since 0.57,
but since 0.57 is a very old version, let's skip it.
|
|
|
|
|
|
| |
We can find the templates directory using the module file once
installed, but when running uninstalled we need to have a way to specify
where the templates can be found in the sources directory.
|
|
|
|
|
|
|
|
| |
Some functions are meant to exist for the entire duration of the
process, and thus have no need for a notification function because
one will never be called.
Fixes: #49
|
| |
|
|
|
|
|
|
| |
Don't use a real function to describe optional/nullable differences, to avoid getting into
the weeds when it comes to edge cases.
Fixes: #211
|
|
|
|
|
| |
Remove mentions of Autotools: we only support Meson.
Fixes: #327
|
|
|
|
|
|
|
|
| |
On macOS, @-prefixed shlib paths (@rpath, @executable_path, and
@loader_path) need to be treated as absolute. Trying to combine them
with a configured library path produces a mangled path that is
unresolvable and may cause unintended side effects (such as loading
the library from a fall-back location on macOS 12.0.1).
|
|
|
|
|
|
|
|
|
| |
Libgirepository is not GLib, and it should not use GLIB_DEPRECATED,
GLIB_DEPRECATED_FOR, and GLIB_UNAVAILABLE macros (as the GLib
documentation clearly states).
When using them, we don't get the proper macro expansion, so deprecated
symbols suddenly disappear from our shared library.
|
|
|
|
|
|
| |
Legacy logic, except:
- on linux with recent libffi
- on macOS with AMD64 architectures
|
| |
|
| |
|
| |
|
|
|
|
| |
Deprecate the previous API as per discussion in !283.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Commit 6bab939bf ("girffi.c: fix return value for g_callable_info_prepare_closure()")
effectively changes semantics of return value from code pointer to data pinter (closure).
`gjs` (and probably other software) relies on old (incorrect) semantics of
g_callable_info_prepare_closure(): https://gitlab.gnome.org/GNOME/gjs/-/issues/428
This change exposes the API that allows extracting directly
callacble code pointer. `gjs` will have to adapt to the new API.
Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The initial failure was observed on `meld` against recently released
`libffi-3.4-rc1`. There `meld` crashes as:
```
$ meld
Segmentation fault (core dumped)
$ gdb --args /usr/bin/python3.9 /usr/bin/meld
(gdb) run
...
Thread 1 "python3.9" received signal SIGSEGV, Segmentation fault.
0x00007fffe9ac1ae8 in g_callable_info_free_closure (
callable_info=0x555555d45990, closure=0x7fffe9e70c20)
at ../gobject-introspection-1.68.0/girepository/girffi.c:428
428 g_free (wrapper->ffi_closure.cif->arg_types);
(gdb) bt
callable_info=0x555555d45990, closure=0x7fffe9e70c20)
at ../gobject-introspection-1.68.0/girepository/girffi.c:428
data=0x555555d252d0)
at ../pygobject-3.40.1/gi/pygi-closure.c:635
...
```
The bug here is in type mismatch between expected return value of
`g_callable_info_prepare_closure()` and actual value (executable
code pointer):
```c
ffi_closure * g_callable_info_prepare_closure(...) {
gpointer exec_ptr;
...
status = ffi_prep_closure_loc (&closure->ffi_closure, cif, callback, user_data, exec_ptr);
return exec_ptr;
}
```
Note: `exec_ptr` is a code pointer that could be directly executed by
caller, like `((rt (*)(a1,a2))exec_ptr)(1,2);` It should never be wrapped
into an `ffi_closure*`, which is normally called via `ffi_call(closure, ...)`.
We see the problem when we try to free direct code pointer instead of
`ffi_closure()` as starting from libffi-3.4 executable trampoline and
`ffi_closure()` don't necessarily live in the same block:
https://github.com/libffi/libffi/commit/9ba559217bea0803263a9a9a0bafcf9203606f5b
Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
|
| |
|
|
|
|
|
|
| |
GJS now maps GLib.ByteArray and GLib.Bytes to Uint8Array whenever
possible. Change the string returned by docwriter for devdocs to
reflect that.
|
|
|
|
|
| |
The pcre subproject in GLib was renamed, so we need to fix the
incantation that promotes the subproject in our own CI.
|
|
|
|
| |
Do not use the snapshot of the old developer.gnome.org website.
|
|
|
|
|
| |
Do not use the snapshot of the old developer.gnome.org website; we
generate and publish the API reference ourselves.
|
| |
|
|
|
|
|
|
|
|
|
| |
Those types should map by definition to guintptr and gintptr.
They are fairly common in Rust cbindgen projects, which maps
usize->uintptr_t for ex.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
|
| |
|
| |
|
|
|
|
|
|
|
| |
GLib 2.70 has just been released, so let's sync up the documentation and
annotations.
Fixes: #402
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
For historical reasons, we have boxed types that do not follow the
typical conversion from CamelCase to snake_case when it comes to their
get_type function.
The introspection scanner will correctly detect that a type is matched
to that get_type function, but then it will default to tokenize the
get_type function to set the c_symbol_prefix of the given type.
The method pairing code in the main transformation path takes that
mismatch into consideration, but the constructor pairing code does not.
This leads to interesting cases, like GString.
GString is correctly detected as GLib.String, and correctly matched to
its `g_gstring_get_type()` type function, but its c_symbol_prefix is set
to `gstring` after the tokenization. While methods like
`g_string_append()` are correctly paired to the `GLib.String` node,
constructors like `g_string_new()` do not, and end up being turned into
function nodes, like `GLib.string_new`, even if they are annotated as
constructors.
I'm not entirely confident that changing the c_symbol_prefix
tokenization this late in the game is going to be free of regressions;
instead, we provide a way for pairing constructors if they are annotated
as such.
In other words: non-annotated constructors of types that have a
different symbol prefix than the one of the get_type function will stay
as they are today—a global function. To enforce the matching, we rely on
an explicit `(constructor)` annotation; at least, this should ensure
that we have explicit buy in from the maintainers of the API.
Fixes: #399
|
|
|
|
|
|
| |
The "final" attribute is not namespaced. Like "abstract", the "final"
flag is shared across type systems, it's not strongly related to GObject
types.
|
|
|
|
|
|
|
| |
If a property is not introspectable we need to decouple it from its
accessors; the property data will not be compiled into the typelib,
and when the compiler will try to resolve the offsets into the binary
blob we'll get a fatal exception.
|
|
|
|
|
| |
Use the parent type and the function symbol when erroring out if we
can't find a property accessor.
|
|
|
|
|
|
|
| |
Some readonly boolean properties in the form of 'has-foo' or 'is-bar'
expose a getter function in the form of `get_has_foo()` or
`get_is_bar()`, according to extant coding practices. We should ensure
we still check for those.
|
|
|
|
|
|
| |
If the (set-property) and (get-property) annotations on methods do not
round trip with the (setter) and (getter) annotations on the
corresponding property, we want to emit a warning.
|
|
|
|
|
|
|
|
| |
The `set-property` and `get-property` identifier annotations only apply
to methods.
The `setter` and `getter` identifier annotations only apply to
properties.
|
|
|
|
| |
Easier to read than `0x3ff`.
|
|
|
|
|
|
|
|
| |
If a property is boolean and read-only, the getter method can be the
same as the property name, for instance:
- gtk_widget_has_focus()
- gtk_media_stream_has_audio()
|
|
|
|
|
|
|
| |
The heuristic is pretty trivial: for any given non-construct-only,
writable property, we check if there's a `set_<property>` method; for
any given readable property, we check if there's a `get_<property>`
method.
|
|
|
|
|
| |
Public accessor functions are the functions typically called through
g_object_set_property() and g_object_get_property().
|
| |
|
| |
|