18956 Commits

Author SHA1 Message Date
Руслан Ижбулатов
a2375b8929 W32: new GFileInfo attributes
G_FILE_ATTRIBUTE_DOS_IS_MOUNTPOINT allows mountpoints
(NTFS reparse points with IO_REPARSE_TAG_MOUNT_POINT tag) to
be told apart from symlinks (NTFS reparse points with
IO_REPARSE_TAG_SYMLINK tag), even though both are reported
by glib as "symlinks".

G_FILE_ATTRIBUTE_DOS_REPARSE_POINT_TAG allows the exact
reparse tag value to be obtained by the user. This way
even more exotic reparse points can be identified and
handled by the user (glib itself currently has no code
to work with any reparse points that are not symlinks
or mountpoints).
2018-10-10 13:51:06 -04:00
Руслан Ижбулатов
01855d2991 W32: tighten access rights requested to read symlink
According to
http://blog.kalmbach-software.de/2008/02/28/howto-correctly-read-reparse-data-in-vista/
we only need FILE_READ_EA, and should also use wider share flags.
2018-10-10 13:51:06 -04:00
Руслан Ижбулатов
cb1a4e0e6c W32: test the private path-stripping function 2018-10-10 13:51:06 -04:00
Руслан Ижбулатов
2a80628fce W32: Don't always strip path prefixes
Extended path prefix looks like "\\?\",
and NT object path prefix looks like "\??\".
Strip them only if they are followed by a character
(any character) and a colon (:), indicating that
it's a DOS path with a drive.
Otherwise stripping such prefix might result in a patch
that looks like a relative path.

For example, "\\?\Volume{GUID}\" becomes "Volume{GUID}\",
which is a valid directory name.

Currently it's up to the user to make sense of such paths.
2018-10-10 13:51:06 -04:00
Руслан Ижбулатов
d72d141c1e Enable GIO tests on Windows
1) Remove the non-Windows-only condition for subdir('tests').
2) Add libiphlpapi, libws2_32 and libsecur32 deps, needed for W32 tests.
3) Remove the -no-undefined argument (gcc doesn't understand it,
   it *does* understand -Wl,-no-undefined; either way, the test
   compiles without this argument just fine; maybe meson adds it
   by itself - you can hardly build shared modules without it).
4) Add or fix a number of includes
5) Disable gdbus-objectmanager tests when building with MSVC
   (right now these tests don't work on Windows anyway, so the fact
    that MSVC can't even build them properly is irrelevant;
    most likely gdbus-codegen needs changes to put _GLIB_EXTERN
    before each function)
2018-10-10 13:51:06 -04:00
Emmanuele Bassi
400cec2796 Install m4 macros unconditionally
Partial revert of commit a7a6449f4d63357bf3a66140e9fb3ccb18611c0b.

Checking for the availability of m4 for installing m4 macro files
creates an implicit dependency on m4 even if GLib does not need it; this
prevents building GLib and then installing Autotools in order to build a
project that depends on GLib.

Closes #1520
2018-10-10 13:51:06 -04:00
Philip Withnall
c1f78a5997 build: Drop pointless -Wformat-security warning flag
We already set -Wformat=2, which implies -Wformat-security, so there’s
no need to test for and set -Wformat-security separately.

The test for -Wformat-security never worked anyway, since gcc complains
if it’s specified without also setting -Wformat to some value. The
complaint causes configure.ac/meson.build to assume the option doesn’t
work.

Signed-off-by: Philip Withnall <withnall@endlessm.com>

https://gitlab.gnome.org/GNOME/glib/issues/656
2018-10-10 13:51:06 -04:00
Philip Withnall
60adc1efbb build: Drop AC_C_CONST from configure.ac
Any compiler we care about now supports the `const` keyword, so we no
longer need to check for it. autoconf has recommended this macro is
obsolete:

https://www.gnu.org/software/autoconf/manual/autoconf-2.60/html_node/C-Compiler.html#index-AC_005fC_005fCONST-755

Signed-off-by: Philip Withnall <withnall@endlessm.com>

https://gitlab.gnome.org/GNOME/glib/issues/1313
2018-10-10 13:51:06 -04:00
Philip Withnall
540fd15e4c glib: Remove remaining references to __int64
This is a follow-up to 7e821441c482917e54435a07893272d87d3ad9e5 and
e154e3325eb7274b8164f8d7a5e0f335646c2bb7 removing some remaining
references to __int64 which are no longer necessary.

Signed-off-by: Philip Withnall <withnall@endlessm.com>

https://gitlab.gnome.org/GNOME/glib/issues/1313
2018-10-10 13:51:06 -04:00
Philip Withnall
7df0977de4 build: Remove SIZEOF___INT64 definition from meson.build
This was a leftover from use of the __int64 type, which was removed
recently in commit 7e821441c482917e54435a07893272d87d3ad9e5.

Signed-off-by: Philip Withnall <withnall@endlessm.com>

https://gitlab.gnome.org/GNOME/glib/issues/1313
2018-10-10 13:51:06 -04:00
Philip Withnall
e42d5dafb7 build: Stop defining STDC_HEADERS
This was previously defined by the AC_HEADER_STDC macro in configure.ac,
but we don’t use that any more. Nothing in GLib depends on this macro,
and neither does anything in my /usr/include which we might care about.

The autoconf documentation for AC_HEADER_STDC says it’s deprecated:
https://www.gnu.org/software/autoconf/manual/autoconf-2.67/html_node/Particular-Headers.html#index-AC_005fHEADER_005fSTDC-621

Signed-off-by: Philip Withnall <withnall@endlessm.com>

https://gitlab.gnome.org/GNOME/glib/issues/1313
2018-10-10 13:51:06 -04:00
Philip Withnall
e17be33a0e build: Drop unused HAVE_DLFCN_H definition
I can’t see this being used anywhere in GLib, or in my /usr/include
directory. I’m also not sure how configure.ac ends up defining it — it’s
certainly as a side-effect of something, and not deliberate.

Signed-off-by: Philip Withnall <withnall@endlessm.com>

https://gitlab.gnome.org/GNOME/glib/issues/1313
2018-10-10 13:51:06 -04:00
Philip Withnall
f85c462315 build: Check for bind_textdomain_codeset() properly
Previously we weren’t checking for it in meson.build (but were checking
for it in configure.ac, courtesy of glib-gettext.m4). Roughly emulate
the checks from glib-gettext.m4, checking for bind_textdomain_codeset()
in whichever libintl implementation we found ngettext() in.

meson.build still doesn’t implement the full set and order of checks in
glib-gettext.m4; there’s still a FIXME about that in meson.build.

Signed-off-by: Philip Withnall <withnall@endlessm.com>

https://gitlab.gnome.org/GNOME/glib/issues/1313
2018-10-10 13:51:06 -04:00
Philip Withnall
bdc37e3711 build: Define GLIB_USING_SYSTEM_PRINTF properly
Previously it was hard-coded to true, rather than being based on the
calculations actually made by meson.build.

Signed-off-by: Philip Withnall <withnall@endlessm.com>

https://gitlab.gnome.org/GNOME/glib/issues/1313
2018-10-10 13:51:06 -04:00
Philip Withnall
d0e979b748 build: Check for Unix98 positional parameter support in printf()
This is equivalent to the AC_FUNC_PRINTF_UNIX98 macro which we use in
configure.ac. There may still be some obscure Unix platforms which don’t
natively support positional parameters, 20 years on.

Signed-off-by: Philip Withnall <withnall@endlessm.com>

https://gitlab.gnome.org/GNOME/glib/issues/1313
2018-10-10 13:51:06 -04:00
Christoph Reiter
3f9a922d96 build: simplify alloca checks. See #1313
The goal of this commit is to reduce differences between the autotools and meson build.

With autotools AC_FUNC_ALLOCA was used which defines HAVE_ALLOCA_H, HAVE_ALLOCA,
C_ALLOCA. meson tried to replicate that with has_function() but alloca can be a macro
and and is named _alloca under Windows. Since we require a working alloca anyway
and only need to know if the header exists replace AC_FUNC_ALLOCA with a simple
AC_CHECK_HEADERS.

There is still one user of HAVE_ALLOCA in the embedded gnulib, but since alloca is
always provided through galloca.h just force define HAVE_ALLOCA there and add a comment.

The docs were mentioning alloca as an example for cross compiling. Since that variable no
longer exists now replace it with another one.
2018-10-10 13:51:06 -04:00
Fabio Tomat
fc7b8e84a7 Update Friulian translation 2018-09-29 14:51:23 +00:00
Xavier Claessens
a579ac9c14 Merge branch 'stable-ci' into 'glib-2-58'
ci: Use a docker image for stable branch

See merge request GNOME/glib!346
2018-09-28 14:30:49 +00:00
Xavier Claessens
21da53a7f6 ci: Use a docker image for stable branch
The master docker image will eventually use a new meson version, but we
want to ensure stable branch still works on old version.
2018-09-24 10:05:15 -04:00
Philip Withnall
a9f5a6fa2f 2.58.1
Signed-off-by: Philip Withnall <withnall@endlessm.com>
2.58.1
2018-09-21 15:21:06 +01:00
Emmanuele Bassi
2a7d4d2dcb Merge branch 'glib-2-58-309-codegen-punning' into 'glib-2-58'
codegen: Change pointer casting to remove type-punning warnings

See merge request GNOME/glib!318
2018-09-17 13:12:47 +00:00
Emmanuele Bassi
ae9bb1ea3e Merge branch 'glib-2-58-1513-icon-docs' into 'glib-2-58'
Backport to glib-2-58: Fix g_icon_to_string() regression (doc inconsistency)

See merge request GNOME/glib!330
2018-09-17 13:11:31 +00:00
Emmanuele Bassi
ac1b680ec4 Merge branch 'glib-2-58-315-pc-paths' into 'glib-2-58'
Use absolute paths in pkg-config files

See merge request GNOME/glib!329
2018-09-17 10:35:09 +00:00
Jehan
ad26f4c75d Fix g_icon_to_string() regression (doc inconsistency).
g_icon_new_for_string() docs states that it should return a single name
when created with a single name. I add a second condition to this case:
the themed icon must not include default fallbacks (i.e. it must not
have been created with `g_themed_icon_new_with_default_fallbacks()`).
Otherwise the return value of `g_icon_new_for_string()` would not
recreate the same icon list when passed to `g_icon_new_for_string()`
(which would be another documentation inconsistency).

g_icon_new_for_string() is now back to old behavior for this specific
case.

I also revert the unit test for this case, and add a new unit test when
using g_themed_icon_new_with_default_fallbacks() with a single name as
well.

Closes #1513.
2018-09-17 11:33:55 +01:00
Jonas Witschel
e7a7c9b977 Use absolute paths in pkg-config files
According to https://www.bassi.io/articles/2018/03/15/pkg-config-and-paths/,
pkg-config files should use absolute paths in variables. This fixes
commit 47692845c0a062a76f99b5de125c5eafa4556847.

Closes #1521
2018-09-17 10:56:10 +01:00
Iain Lane
d89e862f3c Merge branch 'glib-2-58-317-xdg-desktop-portal-autostart' into 'glib-2-58'
Backport “Autostart xdg-desktop-portal if needed” to glib-2-58

See merge request GNOME/glib!321
2018-09-13 14:19:24 +00:00
Iain Lane
d0660ff494 Merge branch 'glib-2-58-313-network-monitor-netlink-fixes' into 'glib-2-58'
Backport GNetworkMonitorNetlink fixes from !313 to glib-2-58

See merge request GNOME/glib!324
2018-09-13 14:14:02 +00:00
Iain Lane
7e413f810c gnetworkmonitornetlink: Close the socket after disconnecting its GSources
`read_netlink_messages()` is the callback attached to the netlink socket
(G_IO_IN). It calls `g_socket_receive_message()`. There is a race
condition that if the socket is closed while there is a pending call, we
will try to receive on a closed socket, which fails.

To avoid this, we switch the order of the operations around: first
destroy the source and then close the socket.
2018-09-13 14:10:39 +01:00
Iain Lane
8b26ad22d4 gnetworkmonitornetlink: Don't check if a passed-in GError ** is NULL
This is not a correct way to check if `g_socket_new_from_fd()` failed.
Instead just see if it returned `NULL` itself.

This was preventing the netlink monitor from being initialised.

Closes #1518
2018-09-13 14:10:39 +01:00
Marek Cernocky
d8d3c81026 Updated Czech translation 2018-09-13 14:00:30 +02:00
Michael Catanzaro
ce2e543c09 Autostart xdg-desktop-portal if needed
This is a speculative fix for epiphany#533, which we think might be
caused by xdg-desktop-portal not ever being started. This service is
started on-demand, not automatically.
2018-09-13 10:07:11 +01:00
Robert Ancell
b3bad4a179 codegen: Change pointer casting to remove type-punning warnings
The existing code was generating code with undefined results that modern compilers warn about:

accounts-generated.c:204:23: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
     (GDBusArgInfo **) &_accounts_accounts_method_info_list_cached_users_OUT_ARG_pointers,
2018-09-12 23:34:43 +01:00
Efstathios Iosifidis
c3c059e6d7 Update Greek translation 2018-09-05 22:10:06 +00:00
Iain Lane
9d414918bc Merge branch 'cherry-pick-68a4e273' into 'glib-2-58'
Document that GTimeVal is subject to the year 2038 problem on 32-bit systems

See merge request GNOME/glib!306
2018-09-05 13:27:22 +00:00
Iain Lane
37af51e644 Document that GTimeVal is subject to the year 2038 problem on 32-bit systems
It might not be immediately obvious that this is the case. Let's record
it in the description of `GTimeVal` itself and also in
`g_time_val_from_iso8601`.

We also drop an incorrect statement in the documentation for
`g_time_val_from_iso8601` stating that years up to 3000 were supported;
this is also not true for the same reason.

Related: #1509


(cherry picked from commit 68a4e273b443ad79a3cd392d464390ab6a3fed2e)
2018-09-05 13:15:00 +00:00
Emmanuele Bassi
f1e272e14d Merge branch '277-command-v-not-which-glib-2-58' into 'glib-2-58'
Backport `command -v` vs `which` changes to glib-2-58

See merge request GNOME/glib!288
2018-09-05 10:12:41 +00:00
Emmanuele Bassi
5e9c2a58b9 Merge branch 'glib-2-58-backports' into 'glib-2-58'
GLib 2.58 backports of various small patches

See merge request GNOME/glib!298
2018-09-05 10:10:55 +00:00
Iain Lane
7086baebe0 Merge branch 'cherry-pick-f697f6aa' into 'glib-2-58'
tests/timer: Skip test_timeval_to_iso8601_overflow if we can't overflow a GTimeVal

See merge request GNOME/glib!301
2018-09-04 09:58:38 +00:00
Iain Lane
51e7219c54 tests/timer: Skip test_timeval_to_iso8601_overflow if we can't overflow a GTimeVal
On 32 bit systems, the size of a long might be the same as the size of
an int. In that case, we won't be able to get an overflow when
converting from a GTimeVal to a time_t. Skip the test for this in that
case.

Closes #1509


(cherry picked from commit f697f6aa08dc5499ae1c5c9177976cc62d19a998)
2018-09-04 09:49:34 +00:00
Jan Tojnar
d62f7cb67c meson: fix typo 2018-09-03 13:19:51 +01:00
Florian Müllner
a8babc792f portal network monitor: Always emit changed signal on changed
The ::network-changed signal is documented to indicate any change in
network configuration, which doesn't necessarily imply a property
change - additional services becoming available after connecting to
a VPN comes to mind for instance.

In order to match the "native" network monitor's behavior, always
emit the signal when it's in response to the 'changed' D-Bus signal.

Also emit the signal unconditionally when loading the initial property
values, to allow clients to differentiate between "offline" meaning
"offline" and "offline" meaning "uninitialized".
2018-09-03 13:14:47 +01:00
Rasmus Thomsen
f042610c02 build: fix installation dir of glib-gettextize 2018-09-03 13:10:58 +01:00
Ryan Schmidt
b8a4754d59 gspawn: Fix build on systems without O_CLOEXEC
Fixes typo introduced in 4afe429d7ce4d813e0b263fd3eab9e543f11d2a6.

See https://gitlab.gnome.org/GNOME/glib/issues/1488
2018-09-03 12:54:02 +01:00
Ryan Schmidt
afbda14f2c gio: Don't redefine GKqueueFileMonitor
Fixes build on old compilers that don't allow type redefinitions.

Closes: https://gitlab.gnome.org/GNOME/glib/issues/1506
2018-09-03 12:49:16 +01:00
Efstathios Iosifidis
6a3fb3438d Update Greek translation 2018-09-03 09:05:04 +00:00
Ask Hjorth Larsen
3aefb47aff Updated Danish translation 2018-09-02 23:21:43 +02:00
Anders Jonsson
5afb4ceb4f Update Swedish translation 2018-09-02 20:07:32 +00:00
Rūdolfs Mazurs
3392d7cc10 Update Latvian translation 2018-09-02 16:57:52 +00:00
Balázs Meskó
1d6909c234 Update Hungarian translation 2018-09-01 22:19:28 +00:00
Rafael Fontenelle
2a64690cd9 Update Brazilian Portuguese translation 2018-09-01 15:22:22 +00:00