Commit Graph

26136 Commits

Author SHA1 Message Date
Philip Withnall
292c117b98 Merge branch 'w32-tests' into 'main'
Various win32 test fixes

See merge request GNOME/glib!2952
2022-10-17 09:53:44 +00:00
Marc-André Lureau
8c0fa77a71 tests/gobject-query.py: make it work on msys2/win32
For unclear reasons, universal_newlines=True doesn't seem to set the
text encoding correctly. Even if I set only encoding='utf-8', the test
fails. The combination here works for me, \o/.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2022-10-17 11:01:53 +04:00
Marc-André Lureau
fdfe94fb16 tests/gobject-query: it is not a script (anymore?)
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2022-10-17 11:01:51 +04:00
Marc-André Lureau
30e7a00017 tests/contenttype: icon name text/plain doesn't have text-x-generic on win32
The g_content_type_get_icon() function for win32 can lookup the
DefaultIcon associated with .txt and return a different result.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2022-10-17 11:01:00 +04:00
Marc-André Lureau
99847d36ed tests/thread-pool-slow: do not pass confusing value to sort function
That value isn't used by the callback.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2022-10-17 10:56:24 +04:00
Marc-André Lureau
2df5acf60a tests/thread-pool-slow: change num-threads limit check
There is no guarantee that the thread pool will reach its limit afaict,
it depends how the system schedule the various threads. This fixes
random test failure on win32.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2022-10-17 10:55:05 +04:00
Marc-André Lureau
f23d8a9087 gio/locafileinfo: fix set_mtime_atime on win32
Use a similar behaviour as the utime()/posix implementation and query
the current times to allow modifying only usec/nsecs parts.

Fixes tests/g-file-info on win32.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2022-10-17 10:52:11 +04:00
Marc-André Lureau
52a49eb9c2 tests/assert-msg-test: fix opening temporary file in GDB
On Win32, the file cannot be opened a second time, it must be closed
first.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2022-10-17 10:49:19 +04:00
Marc-André Lureau
6dcd7fe5e8 tests/assert-msg-test: abort() exit code is 3 on win32
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2022-10-17 10:45:06 +04:00
Marc-André Lureau
0a4dc17f28 tests/assert-msg-test: it is not a script (anymore?)
Fixes running the program on win32.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2022-10-17 10:45:01 +04:00
Marc-André Lureau
789fd5dfc0 tests/assert-msg-test: add exe extension on win32
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2022-10-17 10:45:00 +04:00
Marc-André Lureau
c3494ce5dc tests/file-thumbnail: make it work with win32 paths
On Win32, we get paths with mixed \\ and /, use GFile to resolve and
normalize the paths before comparing.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2022-10-17 10:43:59 +04:00
Philip Withnall
5215463a03 Merge branch 'wip/chergert/g_set_str' into 'main'
strfuncs: add g_set_str()

Closes #2747

See merge request GNOME/glib!2927
2022-10-15 22:30:18 +00:00
Philip Withnall
4bc284fca6 Merge branch 'wip/smcv/deprecated-prop-followup' into 'main'
Run tests with G_ENABLE_DIAGNOSTIC=1

See merge request GNOME/glib!2889
2022-10-15 21:31:29 +00:00
Philip Withnall
9daa0b60c0 Merge branch 'ebassi/object-allocator' into 'main'
Use the system allocator on UNIX when creating GTypeInstances

See merge request GNOME/glib!2799
2022-10-15 20:20:26 +00:00
Emmanuele Bassi
2bf3b7c314 Merge branch 'fix-style-check' into 'main'
tools: Fix code style warnings in gen-visibility-macros.py

See merge request GNOME/glib!2954
2022-10-14 17:55:42 +00:00
Philip Withnall
f8981e9b49 tools: Reformat gen-visibility-macros.py with black
This satisfies the style-check CI job.
2022-10-14 18:15:25 +01:00
Philip Withnall
24aaff658b tools: Disable line length flake8 warnings in gen-visibility-macros.py
It contains a lot of C templates, and line wrapping them to satisfy
`flake8` would make them unreadable.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2022-10-14 18:15:12 +01:00
Philip Withnall
552e01e177 Merge branch 'bookmarkfile-copy' into 'main'
gbookmarkfile: Add copy function and define it as boxed type for introspection

See merge request GNOME/glib!2942
2022-10-14 16:54:38 +00:00
Marco Trevisan (Treviño)
60c935a9c4 gboxed: Add GBookmarkFile as Boxed types
Now that we've a copy function we can define it as a boxed type, making
it fully introspectable.
2022-10-14 16:40:56 +01:00
Marco Trevisan (Treviño)
2e8375daa0 gbookmarkfile: Add copy function
GBookmarkFile has everything for being introspectable, but it lacks a
GType, because it can't be copied. So provide a copy function that
deeply copies all the bookmark structures.

Add tests for this.
2022-10-14 16:39:20 +01:00
Marco Trevisan (Treviño)
5f604460ef gbookmarkfile: Do not try to write invalid modified stamp
In some bookmarks that we load the modified value may be not set, while
this may lead to a load error, we still can dump such file and this
would fail as we try to get a string from an invalid time.

Avoid this, because it would also lead to not writing a valid count
value, given that we'd pass NULL to g_strconcat too early.
2022-10-14 16:39:20 +01:00
Philip Withnall
870fc6763e Merge branch 'mcatanzaro/plain-build-cast-checks' into 'main'
Disable cast checks in plain builds

See merge request GNOME/glib!2894
2022-10-14 15:34:22 +00:00
Michael Catanzaro
631e99667e Disable cast checks in plain builds 2022-10-14 15:34:22 +00:00
Philip Withnall
1e9cf21b30 Merge branch 'desktop-app-info-terminal-tests' into 'main'
tests/desktop-app-info: Add tests to verify if launching with terminal works

See merge request GNOME/glib!2884
2022-10-14 15:30:04 +00:00
Philip Withnall
6fab8a8cd9 Merge branch 'macos-gio-modules' into 'main'
giomodule: Automatically detect modules on macOS

See merge request GNOME/glib!2848
2022-10-14 15:29:04 +00:00
Philip Withnall
f946e45a0c Merge branch 'mcatanzaro/cast-checks' into 'main'
Automatically disable cast checks when building with optimization

See merge request GNOME/glib!2850
2022-10-14 15:26:35 +00:00
Christian Hergert
49ae9b490d strfuncs: add g_set_str()
This is like our other suite of g_set_*() based APIs to simplify and
improve correctness of setters for fields, properties, and more.

This implementation specifically handles setting string values that may
point to an offset within the current string by copying before free.

strcmp() is used directly (as opposed to g_strcmp0() due to it being in
gtestutils.h as well as to increase the chance that the compiler will
hoist the implementation.

Fixes #2747
2022-10-14 16:24:41 +01:00
Philip Withnall
96d623843f Merge branch 'version-bump' into 'main'
build: Post-release version bump to 2.75.0

See merge request GNOME/glib!2953
2022-10-14 15:16:18 +00:00
Philip Withnall
05714bf635 docs: Add 2.76 release series documentation pages to the build
Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2022-10-14 16:03:29 +01:00
Philip Withnall
192794c6a8 build: Post-release version bump to 2.75.0
Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2022-10-14 15:20:45 +01:00
Xavier Claessens
a5eeb465ed Merge branch 'visibility' into 'main'
Fix symbol visibility macros on Windows

See merge request GNOME/glib!2936
2022-10-14 11:47:41 +00:00
Philip Withnall
21e89b9bfd Merge branch 'th/ghash-steal-extended-doc' into 'main'
ghash: document g_hash_table_steal_extended() behavior for sets

See merge request GNOME/glib!2948
2022-10-14 08:03:44 +00:00
Thomas Haller
99bedd110c ghash: document g_hash_table_steal_extended() behavior for sets 2022-10-14 08:03:43 +00:00
Sebastian Dröge
fdf503a141 Merge branch 'ebassi/for-main' into 'main'
doc: Correctly annotate g_async_queue_push()

See merge request GNOME/glib!2949
2022-10-14 07:37:31 +00:00
Xavier Claessens
4e44cea486 gdbus example: Every DLL must have its own visibility macro 2022-10-13 20:53:56 -04:00
Xavier Claessens
8733d172a3 Do not define GIO_COMPILATION for executables
It must only be defined when building libgio. This requires some
workaround to allow include of some gio private headers.

When GIO_COMPILATION is not defined we cannot include individual gio
headers. We workaround that by defining __GIO_GIO_H_INSIDE__ in some
places. Also gdbusprivate.h is not an installed header, so it's fine to
include it directly.
2022-10-13 20:53:56 -04:00
Xavier Claessens
90fcbc7dfc giomodules: g_io_module_* must always be exported
Those symbols are not used by GIO itself but by external modules.
2022-10-13 20:53:56 -04:00
Xavier Claessens
e5565f6635 Rename all visibility macros 2022-10-13 20:53:56 -04:00
Xavier Claessens
dcfc9f689e Fix symbol visibility macros on Windows
There is currently no `dllimport` attribute on any of our function,
which prevents MSVC to optimize function calls.

To fix that issue, we need to redeclare all our visibility macros for
each of our libraries, because when compiling e.g. GIO code, we need
dllimport in GLIB headers and dllexport in GIO headers. That means they
cannot use the same GLIB_AVAILABLE_* macro.

Since that's a lot of boilerplate to copy/paste after each version bump,
this MR generate all those macros using a python script.

Also simplify the meson side by using `gnu_symbol_visibility : 'hidden'`
keyword argument instead of passing the cflag manually.

This leaves only API index to add manually into glib-docs.xml when
bumping GLib version. That file cannot be generated because Meson does
not allow passing a buit file to gnome.gtkdoc()'s main_xml kwarg
unfortunately.
2022-10-13 20:53:56 -04:00
Xavier Claessens
d40459c280 Simplify G_HAVE_GNUC_VISIBILITY definition
There is no need of compiler checks, GNUC visibility should be used when
__GNUC__ >= 4 but not on Windows.
2022-10-13 20:52:49 -04:00
Piotr Brzeziński
af83c6571e giomodule: Automatically detect modules on macOS
Makes use of relocatable prefixes, allowing gio to find modules
automatically without needing to set the GIO_EXTRA_MODULES env var.
2022-10-14 05:21:09 +05:30
Nirbheek Chauhan
aa757cd54a meson: Don't explicitly disable mixed declarations and statements
We require C99 now, and this warning was added for strict adherence to
C89 because GCC allowed mixed declarations in gnu89 as a GCC
extension. Let's get rid of this.
2022-10-14 04:56:46 +05:30
Emmanuele Bassi
80f56c9eb4 doc: Correctly annotate GAsyncQueue methods
Generic pointers are assumed to be nullable unless explicitly marked as
not nullable.
2022-10-13 23:56:18 +01:00
Marco Trevisan
9fb7edd845 Merge branch 'fileutils-fwrite-retval' into 'main'
tests: Check the return value of fwrite() in a test

See merge request GNOME/glib!2946
2022-10-13 21:04:39 +00:00
Philip Withnall
d6c29b538a tests: Check the return value of fwrite() in a test
Not that we ever expect it to fail. This is basically just to silence a
compiler warning with `-Werror=unused-result`.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>

Helps: #2758
2022-10-13 15:48:47 +01:00
John Lindgren
d01fb41280 gmessages: Add missing trailing newline in fallback log handler
This makes the fallback log handler match the behaviour of the default
log handlers.

Spotted as part of https://gitlab.gnome.org/GNOME/glib/-/issues/2753
2022-10-13 14:00:12 +01:00
Philip Withnall
b204b46fc0 gprintf: Avoid an infinite loop on ENOMEM in g_vasprintf()
Instead of going through the normal error logging code, which does
further allocations and will potentially call back into `g_vasprintf()`
and create an infinite loop, just `fputs()` an error message and abort.
If we’re getting `ENOMEM` the process is doomed anyway.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>

Fixes: #2753
2022-10-13 13:54:24 +01:00
Philip Withnall
c16f524034 Merge branch 'static' into 'main'
tests: skip shared libs if default_library=static

See merge request GNOME/glib!2867
2022-10-12 16:19:02 +00:00
Alyssa Ross
1dc8d69edb tests: skip shared libs if default_library=static
Otherwise, the build will fail when the toolchain is static-only, even
with -Ddefault_library=static.  I talked to a Meson developer in their
IRC channel, who told me that the correct fix was to ensure that
shared_library is only used if default_library != static.
2022-10-12 16:49:39 +01:00