Commit Graph

23538 Commits

Author SHA1 Message Date
Philip Withnall
0ac0e49058 Merge branch 'exfat' into 'master'
glocalfile: Add native exfat magic number to filesystem list

Closes #2369

See merge request GNOME/glib!2019
2021-03-31 12:07:49 +00:00
Philip Withnall
16c4a9a57e Merge branch 'clang-cl-improvements' into 'master'
Some improvements to clang-cl builds

Closes #2338 and #2357

See merge request GNOME/glib!2004
2021-03-31 11:25:56 +00:00
Chun-wei Fan
35154a3519 glib-sections.txt: Add g_macro__has_extension in private section
This should satisfy the documentation build check.
2021-03-31 10:50:27 +08:00
Chun-wei Fan
f801c84c52 gmacros.h: Improve check for C _Static_assert
Use the GCC/Clang macros __has_extension() and __has_feature() on
c_static_assert, which is the documented way for GCC/CLang to check for
_Static_assert if C11 mode is not enabled, as suggested by Aleksandr Mezin.

As a result, add a private macro that is defined to be __has_extension if it
exists, otherwise it is considered to be always false.
2021-03-30 16:45:07 +08:00
Chun-wei Fan
7b76995298 gmacros.h: Use _Static_assert for clang
It appears that CLang supports _Static_assert() even when not in C11
mode, since at least CLang 3.1, so let's just use that for CLang builds.

Fixes issue #2338.
2021-03-30 16:45:07 +08:00
Chun-wei Fan
97959cd7eb msvc_recommended_pragmas.h: Refine for clang-cl
Make msvc_recommended_pragmas.h work better with clang-cl so that we can
use that to eliminate some warnings that are emitted as it also consumes
Microsoft compiler and SDK headers.

Also, for GLib builds, force-include msvc_recommended_pragmas.h for
clang-cl builds as well, as it becomes usable and useful there.

Fixes issue #2357.
2021-03-30 16:45:07 +08:00
Leigh Scott
762b284ecc glocalfile: Add native exfat magic number to filesystem list 2021-03-29 18:33:31 +01:00
Philip Withnall
622b31f69e Merge branch 'fixing_2281' into 'master'
Update GFileInfo to use GDateTime as timestamps

Closes #2281

See merge request GNOME/glib!2017
2021-03-29 16:47:58 +00:00
Philip Withnall
e42aff2592 Merge branch 'gio-appinfo-thread-crash' into 'master'
GIO W32: Pin gio DLL

Closes #2300 and #2359

See merge request GNOME/glib!2016
2021-03-29 16:34:04 +00:00
Abanoub Ghadban
1bdfc1a36b gfileinfo: Add tests for get and set {access,creation}_date_time APIs 2021-03-28 23:07:39 +02:00
Abanoub Ghadban
240cc7da97 gfileinfo: Add APIs to get and set {access,creation}_date_time 2021-03-28 23:07:39 +02:00
Dz Chen
7629fdaaeb Update Chinese (China) translation 2021-03-27 23:39:12 +00:00
Frederic Martinsons
782eb1f7af Add private functions to correctly convert datetime when LC_TIME is not UTF8
Functions (_g_get_time_charset and _g_get_ctype_charset) to get LC_TIME and LC_CTYPE charset
by using nl_langinfo with _NL_TIME_CODESET and CODESET).
Another functions (_g_locale_time_to_utf8 and _g_locale_ctype_to_utf8) which uses thel and format
the input string accordingly.
Add new test cases with mixing UTF8 and non UTF8 LC_TIME along with UTF8
and non UTF8 LC_MESSAGES.

Closed #2055

Signed-off-by: Frederic Martinsons <frederic.martinsons@sigfox.com>
2021-03-27 09:28:10 +01:00
Frederic Martinsons
c4df3b23c4 Reorganize headers inclusion alphabetically
Signed-off-by: Frederic Martinsons <frederic.martinsons@sigfox.com>
2021-03-27 08:29:08 +01:00
Frederic Martinsons
b4f2002919 Correct FIXME by implementing a function for converting two digits year
Signed-off-by: Frederic Martinsons <frederic.martinsons@sigfox.com>
2021-03-27 08:29:08 +01:00
Simon McVittie
6d50032167 Merge branch 'fuzz-path-fix' into 'master'
fuzzing: Fix assertion failure in fuzz_paths.c

See merge request GNOME/glib!2013
2021-03-25 17:28:20 +00:00
Simon McVittie
760ba5c4f1 Merge branch '2363-alloca-docs' into 'master'
galloca: Clarify alloca() sizes must always be controlled by the program

Closes #2363

See merge request GNOME/glib!2014
2021-03-25 17:27:23 +00:00
Руслан Ижбулатов
03b574ae66 Don't leak a handle from _g_io_win32_get_module()
This call increments the DLL refcount by default and
needs a flag to avoid that.
2021-03-25 15:20:49 +00:00
Руслан Ижбулатов
f701d6c497 GIO W32: Pin gio DLL
On Windows gio runs a thread to update appinfo at startup.
If someone unloads gio (this happens when a dynamic gio module gets
unloaded by a program that doesn't use gio itself), there doesn't seem
to be a way to detect that until gio is already gone, and as soon as
gio is gone, the thread crashes, since it tries to execute instructions
that are no longer there.

Holding an extra reference to gio DLL fixes this, but it also prevents
gio from being unloaded, and there's no "weak references" for DLLs.
So we just pin gio and acknowledge that it will never be unloaded.

Fixes #2300
Fixes #2359
2021-03-25 15:16:08 +00:00
Philip Withnall
b657e78add galloca: Clarify alloca() sizes must always be controlled by the program
To avoid security vulnerabilities.

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

Fixes: #2363
2021-03-25 12:55:21 +00:00
Philip Withnall
c3eb4a939b fuzzing: Fix assertion failure in fuzz_paths.c
If operating on a zero-length input, the return values of
`g_path_get_basename()` and `g_path_get_dirname()` are correctly `.`.
The assertions in the test didn’t account for this.

oss-fuzz#32454

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2021-03-25 11:23:55 +00:00
Philip Withnall
55cbc31517 Merge branch 'master' into 'master'
make g_tree_remove_all public

See merge request GNOME/glib!1986
2021-03-24 12:13:18 +00:00
Philip Withnall
eaaa41f98f Merge branch 'fuzz-path-functions' into 'master'
fuzzing: Add fuzz tests for functions which parse paths

See merge request GNOME/glib!2006
2021-03-24 11:16:49 +00:00
Philip Withnall
1140c228ab fuzzing: Add fuzz tests for functions which parse paths
Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2021-03-24 11:16:49 +00:00
Philip Withnall
f078ba1fff Merge branch 'git-to-gitlab' into 'master'
docs: Replace git.gnome.org with gitlab.gnome.org urls

See merge request GNOME/glib!2012
2021-03-24 11:10:28 +00:00
Avinash Sonawane
5ce6ba287f docs: Replace git.gnome.org with gitlab.gnome.org urls 2021-03-24 16:18:53 +05:30
Philip Withnall
083e450d5f Merge branch 'docs' into 'master'
docs: Fix example program link

See merge request GNOME/glib!2011
2021-03-24 10:21:39 +00:00
Avinash Sonawane
d6a9b954fa docs: Fix example program link 2021-03-24 10:21:38 +00:00
Sebastian Dröge
8406a2b742 Merge branch '2361-key-file-locale-caching' into 'master'
gkeyfile: Fix crash when parsing translations on a second load

Closes #2361

See merge request GNOME/glib!2009
2021-03-23 16:52:15 +00:00
Philip Withnall
34e4841854 gkeyfile: Fix crash when parsing translations on a second load
If the same `GKeyFile` is reused to load multiple different key files,
any loads after the first which encounter translated keys will crash,
because clearing the data from the first load cleared the cached
language names, but didn’t clear `checked_locales`, so they were never
reloaded.

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

Fixes: #2361
2021-03-23 16:33:33 +00:00
Philip Withnall
164da19983 gkeyfile: Drop a redundant check
It should not be possible for `->locales` to be set without
`->checked_locales` being set, so drop the redundant check. This helps
with branch code coverage.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2021-03-23 16:27:49 +00:00
liuyangming
8fb3101715 gtree: Make g_tree_remove_all() public
g_tree_remove_all is useful and the corresponding function in GHashTable
is exposed, so make this function public is meaningful.
2021-03-23 11:36:57 +00:00
Philip Withnall
9bad38887d Merge branch 'security-policy' into 'master'
docs: Add a policy for handling security issues

See merge request GNOME/glib!1985
2021-03-23 11:35:22 +00:00
Philip Withnall
0d8799b44b Merge branch 'tls-bindings-ci-failure' into 'master'
tests: Deactivate tls-bindings test suite for windows

See merge request GNOME/glib!2008
2021-03-23 11:30:16 +00:00
Frederic Martinsons
7f2fef5c26 tests: Deactivate tls-bindings test suite for windows
Signed-off-by: Frederic Martinsons <frederic.martinsons@sigfox.com>

Helps: #2297
2021-03-23 11:11:45 +00:00
Philip Withnall
01d1aaeb27 Merge branch 'wip/steal-fd' into 'master'
Add g_steal_fd() to API

See merge request GNOME/glib!1966
2021-03-22 11:48:10 +00:00
Simon McVittie
6c5a227bcc gmain: Add g_steal_fd() to API
This is basically glnx_steal_fd() from libglnx. We already had two
private implementations of it in GLib.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2021-03-22 11:48:10 +00:00
Sebastian Dröge
46c34ea20f Merge branch 'remove-out-caller-allocates-from-pod-types' into 'master'
introspection: Remove 'caller-allocates' from POD types

See merge request GNOME/glib!2005
2021-03-20 19:15:14 +00:00
Philip Chimento
748103d75a introspection: Remove 'caller-allocates' from POD types
The (out caller-allocates) and (out callee-allocates) annotations are
meant for structured or pointer types. Plain old data types are just
regular out parameters and don't need the annotation about who
allocates them.

See: https://gitlab.gnome.org/GNOME/gjs/-/issues/386
2021-03-20 11:14:15 -07:00
Philip Withnall
33734480d3 Merge branch 'parsing' into 'master'
goption.c: Simplfy parse_short_option()

See merge request GNOME/glib!1999
2021-03-19 11:07:16 +00:00
Avinash Sonawane
b21766ec3c goption.c: Simplfy parse_short_option() 2021-03-19 14:08:27 +05:30
Sebastian Dröge
2bf649320f Merge branch 'gpollableinputstream-read-nonblocking-caller-allocates' into 'master'
gpollableinputstream: Add missing annotation

See merge request GNOME/glib!1998
2021-03-19 07:39:38 +00:00
Марко Костић
32ed18237d Update Serbian translation 2021-03-19 07:30:25 +00:00
Philip Chimento
27b9d2cb27 gpollableinputstream: Add missing annotation
The buffer for g_pollable_input_stream_read_nonblocking() is an out
parameter which the caller must allocate.

See https://gitlab.gnome.org/GNOME/gjs/-/issues/389
2021-03-18 20:42:05 -07:00
Boyuan Yang
3653260ec2 Update Chinese (China) translation 2021-03-19 02:02:27 +00:00
Philip Withnall
2fd21175e7 Merge branch '2011-add-dbus-watch-name-tests' into 'master'
Resolve "Add additional unit tests for D-Bus name watching"

Closes #2011

See merge request GNOME/glib!1904
2021-03-18 21:10:19 +00:00
Philip Withnall
e45a92ece2 Merge branch 'citrus-it-master-patch-49452' into 'master'
Include glibconfig.h to get the G_OS_UNIX token

See merge request GNOME/glib!1996
2021-03-18 19:36:34 +00:00
Andy Fiddaman
1fafbb82b0 Include glibconfig.h to get the G_OS_UNIX token 2021-03-18 16:21:42 +00:00
Philip Withnall
9106fd4e81 Merge branch 'wip/start-2-70' into 'master'
gversionmacros: Add version macros for GLib 2.70

See merge request GNOME/glib!1965
2021-03-18 14:47:00 +00:00
Philip Withnall
bdea78295c Merge branch 'fix-data-to-c-line-endings' into 'master'
data-to-c.py: autodetect line endings

Closes #2340

See merge request GNOME/glib!1974
2021-03-18 14:00:05 +00:00