Commit Graph

16493 Commits

Author SHA1 Message Date
Emmanuele Bassi
41df41550f utils: Compile g_abort() only on Windows
Otherwise it will break the build on non-Windows because of the macro in
the header, and the unconditional use of Windows-only API.

https://bugzilla.gnome.org/show_bug.cgi?id=665446
2016-04-27 14:55:45 +01:00
Emmanuele Bassi
2f05d1454e Bump master to 2.49 2016-04-27 14:35:09 +01:00
Руслан Ижбулатов
e47904a26f Use g_abort() instead of abort() where possible
https://bugzilla.gnome.org/show_bug.cgi?id=665446
2016-04-27 13:17:28 +00:00
Руслан Ижбулатов
5974428d25 Add g_abort()
The new g_abort() macro just expands to abort() on systems where abort()
behaves in a sane way. On other systems (read: Windows) it does its best
to emulate a sane abort() behaviour.

https://bugzilla.gnome.org/show_bug.cgi?id=665446
2016-04-27 13:17:27 +00:00
Руслан Ижбулатов
e4aaae4ed6 glib: Add 2.50 availibity macros
https://bugzilla.gnome.org/show_bug.cgi?id=665446
2016-04-27 13:17:27 +00:00
Sebastian Dröge
4e3cd88c2b gparamspecs: GTypes are stored in v_pointer, not v_long
v_long is 32 bits on Win64, v_pointer is 64 bits. On most other platforms the
size of long and pointer is the same, so it's usually not a problem.

https://bugzilla.gnome.org/show_bug.cgi?id=758738
2016-04-27 10:28:09 +03:00
Philip Chimento
f8f344923e tests: Fix appmonitor test
Commit f45ec47 fixed a race condition in this test, but one change was
omitted; maybe lost in a rebase.

https://bugzilla.gnome.org/show_bug.cgi?id=749606
2016-04-27 12:12:31 +08:00
Руслан Ижбулатов
999711abc8 gthread: Better fallback for W32 g_get_num_processors()
https://bugzilla.gnome.org/show_bug.cgi?id=748530
2016-04-26 13:52:45 +00:00
Allison Ryan Lortie
75589956a4 GContextSpecificGroup: add testcase
Add a test case for unreffing an object from a GContextSpecificGroup
immediately after firing a signal, before allowing the mainloop to run.

https://bugzilla.gnome.org/show_bug.cgi?id=762994
2016-04-26 15:20:16 +02:00
Allison Ryan Lortie
62f320e6bb GContextSpecificGroup: detach sources
GContextSpecificGroup has been somewhat broken for a rather long time:
when we remove the last reference on an object held in the group, we try
to clean up the source, but fail to actually remove it from the
mainloop.

We will soon stop emitting signals on the source (due to it having been
removed from the hash table) but any "in flight" signals will still be
delivered on the source, which continues to exist.  This is a problem if
the event is being delivered just as the object is being destroyed.

This also means that we leave the source attached to the mainloop
forever (and next time will create a new one)...

This is demonstrated with the GtkAppChooser dialog which writes an
update to the mimeapps.list file just as it is closing, triggering the
app info monitor to fire just as it is being destroyed.

Karl Tomlinson correctly analysed the problem and proposed this fix.

https://bugzilla.gnome.org/show_bug.cgi?id=762994
2016-04-26 15:20:16 +02:00
Руслан Ижбулатов
e118856430 Add g_system_thread_set_name() implementation for W32 threads
This works by using semi-documented[1] exception to tell the debugger
that a thread needs to have its name changed.

If this exception is not caught and handled by something, it will crash
the process, so we need to set up our own handler in case there's no
debugger attached or the debugger can't handle this type of exception.

Since SEH is not supported by gcc on i686 (at the moment), we need to use VEH
instead. For completeness the MSVC-oriented code still uses SEH, although
there is no reason why it shouldn't work with the VEH variant used by MinGW.

VEH handler has to be set up somewhere (g_thread_win32_init () works nicely)
and removed once it's not needed (g_thread_win32_process_detach () is added
expressly for that purpose). Note that g_thread_win32_process_detach() is
only called when glib is unloaded by FreeLibrary(), not when glib-using
process is terminating.

This exception is known to work with WinDbg, and adding support for it into
GDB proved to be feasible (GDB patch will be sent upstream, eventually).

[1] https://msdn.microsoft.com/en-us/library/xcb2z8hs%28v=vs.71%29.aspx

https://bugzilla.gnome.org/show_bug.cgi?id=747478
2016-04-26 10:40:07 +00:00
Matthias Clasen
99bdfd1bcb Stop using ptrctl for thread names
We now prefer pthread_setname_np when available, and don't
need the linux specific API anymore. Also change the test
for this functionality to use pthread_getname_np.
2016-04-26 06:35:06 -04:00
Alan Coopersmith
28f0160031 gthread: add thread name support on Solaris
https://bugzilla.gnome.org/show_bug.cgi?id=747478
2016-04-26 06:18:34 -04:00
Allison Ryan Lortie
3301b852a2 GDesktopAppInfo: support bus activation with '-'
GApplication has accepted any valid bus name as an application ID since
before the time of D-Bus activation.  This includes bus names with '-'.
Several applications have even attempted support bus activation with
these names, going as far as installing D-Bus service files, without
realising that they are silently falling back to fork()/exec() on
account of the name containing a dash.

The reason for the problem is that D-Bus object paths cannot contain
dashes.  We solved this problem privately in an unspecified way inside
of GApplication but substituting '_' in this case, but never made this
part of the Desktop Entry Specification.

The fact that these apps with '-' in the desktop file names aren't
actually using D-Bus activation is beside the point: their intent here
was clear.  Let's avoid forcing them to rename their desktop files again
by simply accepting '-' in desktop file names and munging the path in
the way that GApplication did so historically.

The new path escaping code here has been copied more or less verbatim
from GApplication's own code for the same purpose, with only the removal
of one irrelevant part.

An update to the desktop entry specification will follow.

https://bugzilla.gnome.org/show_bug.cgi?id=764754
2016-04-25 09:19:23 +02:00
Chun-wei Fan
bd0911afda build/win32/pc_base.py: Allow custom options
Some packages might have some parts that are built for certain build
configs, meaning that they could have .pc files of their own, such as
Pango, where PangoFT2 is optionally built.  Allow such an option if
needed.

Also remove some trailing whitespaces.
2016-04-21 19:12:25 +08:00
Antoine Jacoutot
52f116e874 gioenums.h: Remove trailing comma.
This is helpful to people using the g++ --pedantic option.
2016-04-17 10:04:13 +02:00
Matthias Clasen
24b0781264 Improve GApplication docs
D-Bus activation is a thing now; bring the local_command_line
docs in sync with reality.
2016-04-13 12:01:49 -04:00
Emmanuele Bassi
a772c28c95 docs: Clean up the GVariant introduction
Fix the example, as well as the consistency in the terms.

https://bugzilla.gnome.org/show_bug.cgi?id=748806
2016-04-13 09:53:00 +01:00
Phillip Wood
38c4e31c8a Fix documentation typos
Character entities are not supposed to be supported by gtk-doc¹ and
fix the spelling of ‘optional’

¹https://bugzilla.gnome.org/show_bug.cgi?id=758137

https://bugzilla.gnome.org/show_bug.cgi?id=758174
2016-04-11 23:31:38 -04:00
Thomas Perl
59ec2912e4 Documentation fix: g_variant_get() returns void
https://bugzilla.gnome.org/show_bug.cgi?id=747107
2016-04-11 23:29:53 -04:00
Bastian Ilsø
985ae37d19 gvariant.c: Elaborate on GVariant concept and its use
Inserts a paragraph in the start of the description
explaining briefly the concept of GVariant as a
variant datatypes using examples and explaining
a few use cases where GVariant can be useful.

https://bugzilla.gnome.org/show_bug.cgi?id=748806
2016-04-11 23:28:46 -04:00
Debarshi Ray
fcaa3fb189 docs: Add Since for handle_local_options
https://bugzilla.gnome.org/show_bug.cgi?id=764685
2016-04-11 22:37:35 -04:00
Sébastien Wilmet
d16abd3df3 docs: fix function name
g_action_parse_detailed_action_name() doesn't exist, it's
g_action_parse_detailed_name() instead.
2016-04-09 13:01:53 +02:00
Michael Catanzaro
026368add7 Fix a typo 2016-04-07 08:43:24 -05:00
Bastien Nocera
35bd69202d tests: Fix compilation errors due to Y2K format problems
Newer versions of GCC are particularly verbose in relation to
formatting errors, use GCC pragmas to disable warnings for this
section.

gdatetime.c: In function ‘test_strftime’:
gdatetime.c:1334:3: error: ‘%c’ yields only last 2 digits of year in some locales [-Werror=format-y2k]
   "a%a A%A b%b B%B c%c C%C d%d e%e F%F g%g G%G h%h H%H I%I j%j m%m M%M " \
   ^
gdatetime.c:1334:3: note: in definition of macro ‘TEST_FORMAT’
   "a%a A%A b%b B%B c%c C%C d%d e%e F%F g%g G%G h%h H%H I%I j%j m%m M%M " \
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
gdatetime.c:1334:3: error: ‘%g’ yields only last 2 digits of year [-Werror=format-y2k]
   "a%a A%A b%b B%B c%c C%C d%d e%e F%F g%g G%G h%h H%H I%I j%j m%m M%M " \
   ^
gdatetime.c:1334:3: note: in definition of macro ‘TEST_FORMAT’
   "a%a A%A b%b B%B c%c C%C d%d e%e F%F g%g G%G h%h H%H I%I j%j m%m M%M " \
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
gdatetime.c:1334:3: error: ‘%x’ yields only last 2 digits of year in some locales [-Werror=format-y2k]
   "a%a A%A b%b B%B c%c C%C d%d e%e F%F g%g G%G h%h H%H I%I j%j m%m M%M " \
   ^
gdatetime.c:1334:3: note: in definition of macro ‘TEST_FORMAT’
   "a%a A%A b%b B%B c%c C%C d%d e%e F%F g%g G%G h%h H%H I%I j%j m%m M%M " \
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
gdatetime.c:1334:3: error: ‘%y’ yields only last 2 digits of year [-Werror=format-y2k]
   "a%a A%A b%b B%B c%c C%C d%d e%e F%F g%g G%G h%h H%H I%I j%j m%m M%M " \
   ^
gdatetime.c:1334:3: note: in definition of macro ‘TEST_FORMAT’
   "a%a A%A b%b B%B c%c C%C d%d e%e F%F g%g G%G h%h H%H I%I j%j m%m M%M " \
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Note that the pragma is outside the function as older versions of GCC
don't support pragma inside functions.

https://bugzilla.gnome.org/show_bug.cgi?id=764575
2016-04-04 15:08:31 +02:00
Bastien Nocera
e9cf9f2c59 build: Fix all statfs() tests failing
The current statfs() compilation tests all fail because statfs() expects
the first argument to be non-null. Pass a dummy path instead of NULL to
satisfy the compiler.

https://bugzilla.gnome.org/show_bug.cgi?id=764574
2016-04-04 15:07:17 +02:00
Bastien Nocera
21ad4c800c gstrfuncs: Add test for g_strjoinv() behaviour
https://bugzilla.gnome.org/show_bug.cgi?id=764092
2016-04-04 15:06:57 +02:00
Bastien Nocera
283c565af6 gstrfuncs: Document the behaviour of g_strjoinv()
The behaviour of g_strjoinv() isn't explicitely explained when the array
contains less than 2 items. This removes the guesswork.

https://bugzilla.gnome.org/show_bug.cgi?id=764092
2016-04-04 15:06:57 +02:00
Cosimo Cecchi
f45ec47be1 tests: always remove app.desktop
https://bugzilla.gnome.org/show_bug.cgi?id=749606
2016-04-03 12:23:21 -07:00
Philip Withnall
d09c219696 glocalfile: Assert against a potential NULL pointer dereference
This was confusing some static analysis. Through canonicalize_filename()
at construction time, we guaranteed that ->filename is canonical and
absolute, so g_path_skip_root() should never fail.

https://bugzilla.gnome.org/show_bug.cgi?id=731988
2016-04-02 12:27:05 +01:00
Jordi Mas
28dcafa09b Update Catalan translation 2016-04-02 07:39:43 +02:00
Trần Ngọc Quân
b0de81f494 Updated Vietnamese translation
Signed-off-by: Trần Ngọc Quân <vnwildman@gmail.com>
2016-03-27 08:24:33 +07:00
Benjamin Gilbert
41888493f0 Fix thread safety of g_get_language_names()
https://bugzilla.gnome.org/show_bug.cgi?id=748474
2016-03-26 08:52:40 -04:00
YunQiang Su
f55a5b69b7 update zh_CN translation 2016-03-26 15:32:03 +08:00
Inaki Larranaga Murgoitio
b32c0f2f49 Updated Basque language 2016-03-23 17:12:30 +01:00
Colin Walters
14885a5b19 build: Also dist Systemtap files always for gobject/
Mirrors
https://git.gnome.org/browse/glib/commit/?id=ad2092bc680e434c3d17600988ec9b20f52eebef
except I didn't also change gobject/.

https://bugzilla.gnome.org/show_bug.cgi?id=763821
2016-03-23 09:02:35 -04:00
Allison Ryan Lortie
f384d20d80 GLib 2.48.0 2016-03-22 11:18:38 -04:00
Iain Lane
a668ee8fe9 giotypefuncs.c: Sort _get_type functions in the 'C' locale
This ensures that the generated file is always the same (not dependent
on the build machine's environment), making the build reproducible.

Thanks to Jérémy Bobbio <lunar@debian.org> for the Debian bug report and
patch.

https://bugzilla.gnome.org/show_bug.cgi?id=763617
2016-03-21 13:44:38 +00:00
Philip Withnall
c7763d0712 glib-compile-resources: Fix minor memory leak on error path
Spotted by Coverity (CID: #1353385).
2016-03-21 12:44:15 +00:00
Philip Withnall
58f56b2460 gkeyfile: Clear a variable after freeing it
find_file_in_data_dirs() doesn’t actually clear output_path to NULL on
failure, so this prevents a use-after-free on that (fd == -1) error
path.

Spotted by Coverity (CID: #1352981).
2016-03-21 12:35:25 +00:00
Ask Hjorth Larsen
7401dc1b0c Updated Danish translation 2016-03-20 23:41:28 +01:00
Milo Casagrande
b8800ddc37 Updated Italian translation 2016-03-17 20:24:05 +00:00
Allison Ryan Lortie
8c9be18bd3 GLib 2.47.92 2016-03-15 22:26:31 -04:00
Philip Withnall
db972a73ce gio: Fix a GError memory leak in GNetworkService
Spotted by Coverity (CID: #1325405).
2016-03-15 18:08:29 +00:00
Philip Withnall
27660b178e gio: Fix a GError memory leak in GDesktopAppInfo
Spotted by Coverity (CID: #1352961).
2016-03-15 18:03:00 +00:00
Philip Withnall
d8a7d5f168 gmessages: Clarify documentation for G_LOG_LEVEL_CRITICAL
Clarify that it’s a critical //warning//, not a critical something-else.
2016-03-15 12:30:01 +00:00
Marc-André Lureau
37ebc83f7f win32: use wide-char for constants
Use the appropriate type for comparisons and assignment of wide chars.

Signed-off-by: Marc-André Lureau <marcandre.lureau@gmail.com>

https://bugzilla.gnome.org/show_bug.cgi?id=762202
2016-03-15 11:14:57 +01:00
Marc-André Lureau
622748680c win32: fix indentation
Signed-off-by: Marc-André Lureau <marcandre.lureau@gmail.com>

https://bugzilla.gnome.org/show_bug.cgi?id=762202
2016-03-15 11:14:57 +01:00
Marc-André Lureau
5be8cab966 win32: use wcslen() return type
Signed-off-by: Marc-André Lureau <marcandre.lureau@gmail.com>

https://bugzilla.gnome.org/show_bug.cgi?id=762202
2016-03-15 11:14:57 +01:00
Marc-André Lureau
a1bcd1e45a win32: fix off-by-one length check
Laszlo Ersek said: "The length check is off by one (in the safe direction); it
should be (nchars >= 2). The processing should be active for the wide string
L"\r\n" -- resulting in the empty wide string --, I believe."

Reported-by: Laszlo Ersek <lersek@redhat.com>
Signed-off-by: Marc-André Lureau <marcandre.lureau@gmail.com>

https://bugzilla.gnome.org/show_bug.cgi?id=762202
2016-03-15 11:14:57 +01:00