Commit Graph

5716 Commits

Author SHA1 Message Date
Sébastien Wilmet
3ee859d5fc docs: GSequence: better document how to sort large amount of data
It was documented at strange places: in g_sequence_search*() and
g_sequence_lookup*(), but how to insert and sort data is not done by
those functions.

So instead, add the information to the class description (since it
involves several functions), and add also the information in
g_sequence_insert_sorted() and g_sequence_insert_sorted_iter() as a kind
of warning when using those functions.

Note that before this commit, it was not explained *why* it is better to
call g_sequence_sort() after doing a lot of unsorted insertions. Now it
is documented as "more efficient" (I think it's the only reason that
makes sense, otherwise why was it documented?).

https://bugzilla.gnome.org/show_bug.cgi?id=792455
2018-01-16 20:11:31 +01:00
Benjamin Berg
5fba62adec gmessages: Flush output stream after logging messages
When debug output is enabled then certain messages will be logged to
stdout. stdout however is block buffered by default when it isn't going
to a TTY meaning that debug logging will not be flushed out properly
when it is being redirected. One example of this happening may be tests
that rely on parsing g_debug messages.

Adding an explicit fflush ensures all log messages will reach the output.

https://bugzilla.gnome.org/show_bug.cgi?id=792432
2018-01-15 19:46:22 +01:00
Philip Withnall
051d69bbc8 gdataset: Fix a typo in a documentation comment
Signed-off-by: Philip Withnall <withnall@endlessm.com>
Reviewed-by: nobody
2018-01-15 18:26:56 +00:00
Iain Lane
e2054240c2 gdatetime: Mark the usecs as volatile
On i386, we were seeing that this calculation was producing an incorrect
result, probably because usec was being stored in an 80-bit register
before being written back into a 64-bit float in memory. If we mark the
variables as volatile, they are not stored in registers and we avoid
this bug.
2018-01-15 11:54:47 +00:00
Robert Ancell
d870628782 gdatetime: Avoid repeated floating point multiplies with ISO 8601 parsing
This avoids any potential rounding errors.

https://bugzilla.gnome.org/show_bug.cgi?id=792410
2018-01-15 11:54:47 +00:00
Philip Withnall
e430541378 docs: Remove XML-style comments from documentation strings
gtk-doc doesn’t support them any more since it was ported to Markdown,
so they end up appearing in the generated documentation, which isn’t
great.

Mostly, they were used to split up things invisibly, which we can do in
other ways.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
Reviewed-by: nobody
2018-01-12 15:29:29 +00:00
Garrett Regier
6aa19a26cf gsequence: Add seq_is_end()
This avoids calling is_end() when the
GSequence is already determined, thus
avoids having to walk the tree.

https://bugzilla.gnome.org/show_bug.cgi?id=749583
2018-01-11 12:47:18 +00:00
Garrett Regier
ee8f7be3df gsequence: Kill check_iter_access()
Generally the GSequence has already been
determined by the caller. This saves quite
a few calls to get_sequence().

https://bugzilla.gnome.org/show_bug.cgi?id=749583
2018-01-11 12:46:57 +00:00
Philip Withnall
d020766325 docs: Fix typos in GConvert documentation
Signed-off-by: Philip Withnall <withnall@endlessm.com>
Reviewed-by: nobody
2018-01-11 11:54:14 +00:00
Tim-Philipp Müller
59c5b939e2 glib: fix compiler warning for g_unsetenv_utf8() on windows
"warning: 'void' function returning a value". Neither
g_unsetenv_utf8() nor g_unsetenv() return anything.
2018-01-10 17:24:36 +00:00
Christian Hergert
17e03effda gbookmarkfile: check length before dereferencing groups
There is no requirement that groups is NULL terminated, so we should check
that the bounds are within the specified length before checking for a
NULL terminating value.

https://bugzilla.gnome.org/show_bug.cgi?id=792351
2018-01-09 15:29:36 -08:00
Mikhail Zabaluev
6dafc1ce13 Move G_DIR_SEPARATOR* and G_SEARCHPATH_SEPARATOR* into glibconfig.h
As platform-dependent macros, they belong in glibconfig.h.
This also makes it one less place where g-ir-scanner picks definitions
from the wrong ifdef branch; see
https://bugzilla.gnome.org/show_bug.cgi?id=696935

Meson configuration support is also added in this commit.

https://bugzilla.gnome.org/show_bug.cgi?id=757284
2018-01-09 12:08:40 +00:00
Mikhail Zabaluev
ef65c160dc gbookmarkfile: fix up annotations
https://bugzilla.gnome.org/show_bug.cgi?id=756011
2018-01-08 18:26:25 +00:00
Philip Withnall
97d24b93ab glib: Fix strict-aliasing warnings with g_clear_pointer()
gpointer* cannot be aliased with arbitrary types. In order to fix
-Wstrict-aliasing=2 warnings with the g_clear_pointer() macro, we need
to cast through char*, which is allowed to alias with anything.

Even if we don’t make GLib strict-aliasing safe, it’s important to
ensure this macro is safe, since it could be used from projects which do
compile with -fstrict-aliasing.

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

https://bugzilla.gnome.org/show_bug.cgi?id=791622
2018-01-08 11:50:31 +00:00
Philip Withnall
d8fe926ba4 Fix various strict aliasing problems with sockaddr
Fix various strict aliasing problems caused by casting between (struct
sockaddr *) and (struct sockaddr_storage *): the correct code here is to
keep the two in a union.

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

https://bugzilla.gnome.org/show_bug.cgi?id=791622
2018-01-08 11:50:26 +00:00
Philip Withnall
8f7cc8cb75 gkeyfile: Document need for KEEP_TRANSLATIONS with get_locale_string()
When using g_key_file_get_locale_string() or get_locale_string_list(),
the GKeyFile must have been loaded with G_KEY_FILE_KEEP_TRANSLATIONS if
the lookup locale differs from the one which was current when the key
file was loaded.

Document that.

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

https://bugzilla.gnome.org/show_bug.cgi?id=792324
2018-01-08 10:55:42 +00:00
Simon McVittie
7f3bfcb891 cancellable: Don't assert if finalization races with cancellation
Commit 281e3010 narrowed the race between GCancellable::cancelled and
GCancellableSource's finalize(), but did not prevent it: there was
nothing to stop cancellation from occurring after the refcount drops
to 0, but before g_source_unref_internal() bumps it back up to 1 to
run finalize().

GCancellable cannot be expected to detect that situation, because the
only way it has to detect last-unref is finalize(), but in that
situation finalize() hasn't happened yet.

Instead of detecting last-unref, relax the precondition a little
to make it detect finalization: priv is only poisoned (set to NULL)
after the finalize() function has been called, so we can assume that
GCancellable has already seen finalize() by then.

Signed-off-by: Simon McVittie <smcv@collabora.com>
Bug: https://bugzilla.gnome.org/show_bug.cgi?id=791754
Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=884654
2018-01-05 20:42:06 +00:00
Simon McVittie
a4686b8ea1 g_source_set_ready_time: Move no-op fast-path under the lock
If we don't take the lock, then we don't have the necessary
"happens before" relationships to avoid this situation:

* source->priv->ready_time was equal to ready_time until recently
* another thread has set source->priv->ready_time to a different value
* that write hasn't become visible to this thread yet
* result: we should reset the ready_time, but we don't

Signed-off-by: Simon McVittie <smcv@collabora.com>
Bug: https://bugzilla.gnome.org/show_bug.cgi?id=791754
Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=884654
2018-01-05 20:42:06 +00:00
Philip Withnall
ca1aaccbff docs: Remove redundant sentence from g_prefix_error() documentation
Signed-off-by: Philip Withnall <withnall@endlessm.com>
Reviewed-by: nobody
2018-01-05 19:36:07 +00:00
Christoph Reiter
2939585bd6 meson: work around meson not passing on the threads dependency when link_with is used
When using link_with with declare_dependency() or executable() the threads
dependency is not passed on. To work around the issue add the threads dependency
manually. See https://github.com/mesonbuild/meson/issues/1426

This makes the static build on Linux work.

https://bugzilla.gnome.org/show_bug.cgi?id=788806
2018-01-05 15:29:00 +01:00
Christoph Reiter
cf93b27ceb meson: fix static build under Windows
Properly define GLIB/GOBJECT_STATIC_COMPILATION when static build is enabled.
Use library() instead of shared_library() to allow selecting static builds.

https://bugzilla.gnome.org/show_bug.cgi?id=784995
2018-01-04 22:21:40 +01:00
Christoph Reiter
aa7c5cbdcb meson: build Windows resource files
configure_file() forces utf-8 atm but .rc files are not utf-8.
To work around the issue just remove the only non-ASCII char.

https://bugzilla.gnome.org/show_bug.cgi?id=784995
2018-01-04 22:19:30 +01:00
Philip Withnall
e91c118418 Revert "gmain: only signal GWakeup right before or during a blocking poll"
This reverts commit 9ba95e25b7.

It is causing undiagnosed problems with WebKit and other users of GLib.
See https://bugzilla.gnome.org/show_bug.cgi?id=761102#c44 and
https://bugzilla.gnome.org/show_bug.cgi?id=761102#c46.

Reverting it until someone works out what the problem is.

https://bugzilla.gnome.org/show_bug.cgi?id=761102
2018-01-03 11:27:25 +00:00
Emmanuele Bassi
a07b57887d Do not expand autoptr macros when running introspection
The introspection scanner chokes fairly badly on the types we create,
and that got even worse when the autolist support landed. Now, every
time we declare a new GObject type we automatically get incomplete
aliases to container types that gobject-introspection and Vala do not
know how to handle.

Since the autoptr machinery is not really introspectable to begin with,
as it's a C utility extension that depends on the C compiler being used
to compile a C project that depends on GLib, we can mark the whole
section as non-introspectable using the __GI_SCANNER__ pre-processor
symbol.

https://bugzilla.gnome.org/show_bug.cgi?id=791342
2017-12-22 15:03:07 +00:00
Alexander Larsson
f49a93b207 Add support for g_auto[s]list(Type)
This lets you do g_autoptr style cleanup of GList that does deep freeing.

https://bugzilla.gnome.org/show_bug.cgi?id=791342
2017-12-21 16:12:55 +01:00
Xavier Claessens
62c4768423 Meson: Add missing options and conform to naming guidelines
https://bugzilla.gnome.org/show_bug.cgi?id=790837
2017-12-19 14:56:11 -05:00
Simon McVittie
95e2800591 testutils: Document what happens by default and how to change it
Signed-off-by: Simon McVittie <smcv@collabora.com>

https://bugzilla.gnome.org/show_bug.cgi?id=791745
2017-12-18 18:55:46 +00:00
Havard Graff
17bfc39ea7 meson: add carbon and cocoa libs when building for OSX
https://bugzilla.gnome.org/show_bug.cgi?id=791460
2017-12-14 16:21:46 +05:30
Simon McVittie
9c8c6094fd GTest: interpret child processes' wait status if we log their stdout/stderr
WCOREDUMP is not a separate "mode" as suggested by the previous
code to interpret wait status: instead, it is an extra bit of
information if the "mode" is WIFSIGNALED.

(Modified by Philip Withnall to fix a nitpick missing space.)

https://bugzilla.gnome.org/show_bug.cgi?id=748534
2017-12-13 17:27:19 +00:00
Simon McVittie
fa8b76ab98 g_test_subprocess: record raw wait status and interpret it later
This avoids losing information that might be useful for later debugging.

(Modified by Philip Withnall to add comments to child_status and
test_trap_last_status.)

https://bugzilla.gnome.org/show_bug.cgi?id=748534
2017-12-13 17:25:26 +00:00
Philip Withnall
6a597f93f6 gtestutils: Add missing include
memcmp() is used, which is declared in string.h. Include that.

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

https://bugzilla.gnome.org/show_bug.cgi?id=791532
2017-12-13 13:15:37 +00:00
Umang Jain
ed3d2d9c67 gbytes: Clarify nullability for g_bytes_unref() in docs
https://bugzilla.gnome.org/show_bug.cgi?id=791318
2017-12-07 10:27:59 +00:00
1a07e35b70 gtester-report: fix range usage when running as python3 app
When using python3 as interpreter, range only takes integer arguments or
it results in errors like:

   File "/usr/bin/gtester-report", line 78, in html_indent_string
     for i in range (0, (n + 1) / 2):
 TypeError: 'float' object cannot be interpreted as an integer

https://bugzilla.gnome.org/show_bug.cgi?id=791296
2017-12-06 10:07:10 +00:00
Nirbheek Chauhan
c9e6270568 libcharset: Don't try to include configmake.h
It's an internal gnulib thing which will never be available while
building glib. Always expect LIBDIR and fallback to using that for
compatibility with the existing MSVC projects:
https://mail.gnome.org/archives/gtk-devel-list/2017-December/msg00000.html

https://bugzilla.gnome.org/show_bug.cgi?id=346816
2017-12-04 18:40:35 +05:30
Philip Withnall
e45f99e3f6 gvariant: Clarify return docs for g_variant_get_normal_form()
Clarify that the return value may be floating, or may not be (depends
on whether the input @value was in normal form).

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

https://bugzilla.gnome.org/show_bug.cgi?id=741167
2017-12-03 20:01:39 +00:00
Руслан Ижбулатов
69ea026fbc Fix a 32-bit time_t cast
Divide first, *then* cast. Otherwise a very long "now", which is
64-bit, gets truncated into a 32-bit time_t, which can't hold the
value, and turns negative more often than not.

https://bugzilla.gnome.org/show_bug.cgi?id=791128
2017-12-02 13:15:30 +00:00
Philip Withnall
532f1edd88 gmain: Clarify documentation of g_source_remove()
To try and prevent a repeat of
https://stackoverflow.com/q/47569812/2931197.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
Reviewed-by: nobody
2017-12-01 10:24:36 +00:00
Michael Catanzaro
7f639fd5a0 gmain: Improve documentation of GSourceFuncs
We should more clearly indicate that a source ready time will result in
a source being dispatched even if prepare and check never return TRUE.

https://bugzilla.gnome.org/show_bug.cgi?id=790948
2017-11-29 13:20:40 -06:00
Philip Withnall
90dd9ff363 gmain: Unref GSourceCallbackFuncs _before_ finalising GSource
Rather than unreffing them _after_ finalising the GSource and freeing
its struct. This fixes the case where the GSourceCallbackFuncs data
contains a pointer to the GSource, and the unref() function operates on
that pointer, e.g. by calling g_source_destroy(). This happens when
using g_source_set_dummy_callback() on a GSource, as the generated
GClosure needs to destroy the GSource when it is invalidated, which
could happen (at latest) when the GSourceCallbackFuncs.unref() function
is called during finalisation of the GSource.

By moving the GSourceCallbackFuncs.unref() invocation higher up in
g_source_unref_internal(), it becomes re-entrancy-safe for GSource
methods.

https://bugzilla.gnome.org/show_bug.cgi?id=692034
2017-11-28 14:49:26 +00:00
Carlos Garcia Campos
ed620183cb gtester: do not consider skipped tests as failures
This is happening since f591366eee, that
changed the way tests were skipped to use g_test_skip() instead of just
ignoring them. They are now reported to the log with G_TEST_RUN_SKIPPED
as result.

https://bugzilla.gnome.org/show_bug.cgi?id=790934
2017-11-28 15:36:06 +01:00
Philip Withnall
643c2d590c gdatetime: Drop a duplicate #define
It’s exactly the same as the one on the next line.

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

https://bugzilla.gnome.org/show_bug.cgi?id=790416
2017-11-28 14:21:06 +00:00
Philip Withnall
bccc1057e3 gdatetime: Fix handling of unsupported nl_langinfo() items
If nl_langinfo() doesn’t support a particular item, it returns the empty
string. We should check for that and return NULL from
g_date_time_format() accordingly, otherwise the user could unwittingly
end up with a formatted date/time which is missing some or all of its
components.

This arose with %r in de_DE, which is unsupported by nl_langinfo()
because Germans almost never write time in 12-hour format.

Add a unit test.

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

https://bugzilla.gnome.org/show_bug.cgi?id=790416
2017-11-28 14:21:06 +00:00
Philip Withnall
ae7895002b gnode: Eliminate implicit signed-to-unsigned integer conversion
When doing a level traverse of a GNode with depth of -1, the depth was
implicitly being converted to an unsigned integer. This worked (making
the depth limit G_MAXUINT), but was a bit mystical.

Change g_node_depth_traverse_level() to explicitly take a signed depth
and handle it appropriately.

Coverity issue: #1159465

https://bugzilla.gnome.org/show_bug.cgi?id=732003
2017-11-28 14:16:25 +00:00
Philip Withnall
2cd26714e5 tests: Add tests to ensure g_[s]list_sort() are stable sorts
Given that we guarantee it in the API…

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

https://bugzilla.gnome.org/show_bug.cgi?id=508976
2017-11-28 14:11:30 +00:00
Philip Withnall
74cbd6c34f gslist: Document that g_slist_sort() is stable
Signed-off-by: Philip Withnall <withnall@endlessm.com>

https://bugzilla.gnome.org/show_bug.cgi?id=508976
2017-11-28 14:11:29 +00:00
Philip Withnall
9297a596d6 gmain: Mark some ref_count variables as volatile
To make it more obvious they should exclusively be accessed with atomic
functions.

https://bugzilla.gnome.org/show_bug.cgi?id=737677
2017-11-28 14:08:59 +00:00
Philip Withnall
d73f8eec48 gmain: Make GSourceCallback thread-safe
Otherwise there is a race in finalising the GSourceCallback if one
thread is finishing off a g_main_dispatch() while another thread is
destroying the GSource which owns the GSourceCallback.

A helgrind log:

==21707== Possible data race during write of size 4 at 0x54EACB0 by
thread #12
==21707== Locks held: none
==21707==    at 0x4ECC174: g_source_callback_unref (gmain.c:1528)
==21707==    by 0x4ECD953: g_main_dispatch (gmain.c:3081)
==21707==    by 0x4ECE667: g_main_context_dispatch (gmain.c:3673)
==21707==    by 0x4ECE859: g_main_context_iterate (gmain.c:3744)
==21707==    by 0x4ECEC7F: g_main_loop_run (gmain.c:3938)
==21707==    by 0x41C197: some_thread (some-code.c:224)
==21707==
==21707== This conflicts with a previous write of size 4 by thread #5
==21707== Locks held: 1, at address 0x54CF320
==21707==    at 0x4ECC174: g_source_callback_unref (gmain.c:1528)
==21707==    by 0x4ECB86F: g_source_destroy_internal (gmain.c:1178)
==21707==    by 0x4ECB9D4: g_source_destroy (gmain.c:1227)
==21707==    by 0x41CF09: some_other_thread (some-other-code.c:410)

https://bugzilla.gnome.org/show_bug.cgi?id=737677
2017-11-28 14:08:58 +00:00
Christian Hergert
d44afbadda macros: make G_GNUC_CHECK_VERSION() portable
This removes the use of defined() in a macro expansion, which may not be
portable to some pre-processors. Instead, we hoist the defined check
outside the macro expansion.

https://bugzilla.gnome.org/show_bug.cgi?id=790877
2017-11-27 02:07:27 -08:00
Nirbheek Chauhan
87122cae38 meson: Fix gnulib compilation on MSVC
glibinc is needed for including glibconfig.h, this was not noticed
during testing probably because a system-installed header got picked
up instead.
2017-11-24 12:41:53 +05:30
Nirbheek Chauhan
2e5bb92de6 meson: Use files() for headers and sources
This allows them to be fetched via subproject().get_variable(). Needed
for the gobject-introspection meson port.
2017-11-22 14:11:11 +05:30
Nirbheek Chauhan
c603ba301d meson: Add 'charsetalias-dir' option mirroring the autotools one
This fixes the build again.
2017-11-22 04:43:05 +05:30
Philip Withnall
4e5c6616f0 tests: Add tests for GArray constructors
Noticed these were missing when handling bug #733648. Add a few missing
tests to improve coverage.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2017-11-21 12:43:17 +00:00
Philip Withnall
0dc68e5d46 tests: Use g_test_skip() instead of a message in GDateTime tests
There are some GDateTime tests which need to be skipped if changing the
locale fails. Use g_test_skip() to do that, rather than just a
human-readable message.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2017-11-21 12:42:42 +00:00
Daniel Macks
6bcc8b4034 Add configuration option for charset.alias directory
Specifically controlling the location of this file, rather than simply
using $libdir, allows one to avoid conflicting with the same default
location as the gnulib localcharset module uses.

https://bugzilla.gnome.org/show_bug.cgi?id=346816
2017-11-20 11:27:21 +00:00
Luca Bruno
3b89702bcf glib/tests/mappedfile.c: Use temp dir instead of user runtime dir
Bug: https://bugzilla.gnome.org/show_bug.cgi?id=724412
2017-11-16 11:17:19 +00:00
Dan Winship
42d3ed0013 glib: document restrictions on various foreach() functions
Some foreach() functions allow you to modify the object they are
iterating, and others don't, but the docs were not generally clear
about this.

https://bugzilla.gnome.org/show_bug.cgi?id=724383
2017-11-16 11:12:32 +00:00
David Schleef
3cfac71d09 gdatetime: fix floating-point conversion
Conversion from floating point to integer requires special care.

https://bugzilla.gnome.org/show_bug.cgi?id=697715
2017-11-16 11:07:20 +00:00
Patrick Welche
b5733ecc76 Solaris build fix
On Solaris sigset_t is only defined in /usr/include/sys/signal.h
(included from /usr/include/signal.h) if _XPG4_2 is defined. If
it's not defined, you need to include /usr/include/sys/select.h.

http://bugzilla.gnome.org/show_bug.cgi?id=562334
2017-11-16 10:36:13 +00:00
Philip Withnall
880f07f94c gstrfuncs: Use curly quotes in a documentation comment
Nobody can argue with this: the documentation comment is about, and
contains, Unicode accents.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2017-11-13 10:37:11 +00:00
Philip Withnall
e61c3c628d gstrfuncs: Fix a typo in a documentation comment
Signed-off-by: Philip Withnall <withnall@endlessm.com>
2017-11-13 10:35:41 +00:00
Stefan Sauer
2812219adb docs: add missing '*' chars at start of doc-comments 2017-11-12 16:36:16 +01:00
Philip Withnall
63e9d109fd gmessages: Give examples of G_DEBUG with gdb in the documentation
Some of the documentation linked to information about G_DEBUG already,
but most of it didn’t, and there were no examples. People need obvious
examples.

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

https://bugzilla.gnome.org/show_bug.cgi?id=790157
2017-11-10 10:27:26 +00:00
Philip Withnall
b778ba3e64 gmessages: Improve formatting of a #define in the docs
Signed-off-by: Philip Withnall <withnall@endlessm.com>

https://bugzilla.gnome.org/show_bug.cgi?id=790157
2017-11-10 10:27:26 +00:00
Steve Lhomme
74c5e785d3 gmessages: Mark non-varargs log functions as static inline
Certain compilers warn about unused functions if they are declared in
the header but are not inline. We require `static inline` support from
all compilers now.

Typically, this code will not be used, as the compilers we care about
implement vararg macro support; but this code path can still be hit on
some compilers (probably; unverified).

(Commit message by Philip Withnall.)

https://bugzilla.gnome.org/show_bug.cgi?id=483341
2017-11-08 13:07:56 +00:00
Sanjeev
cd0bbbf1ef gvariant: Fix minor memory leak on error handling path
(Commit message by Philip Withnall.)

https://bugzilla.gnome.org/show_bug.cgi?id=760022
2017-11-08 12:36:26 +00:00
Cosimo Cecchi
5ebd8f6e88 gmain: add g_clear_handle_id API
It's a very common pattern to see code that looks like this in
dispose() or finalize() implementations:

if (priv->source_id > 0)
  {
    g_source_remove (priv->source_id);
    priv->source_id = 0;
  }

This API allows to accomplish the same goal with a single line:

g_clear_handle_id (&priv->source_id, (GClearHandleFunc) g_source_remove);

Thanks to Emmanuele Bassi <ebassi@gnome.org> for making the patch
generic.

https://bugzilla.gnome.org/show_bug.cgi?id=788489
2017-11-07 08:28:45 -08:00
Cosimo Cecchi
374ade1b68 glib: add g_build_filename_valist()
A new public API convenience to build a filename from a va_list.

https://bugzilla.gnome.org/show_bug.cgi?id=788488
2017-11-07 08:25:28 -08:00
Cosimo Cecchi
68d62c33fd gfileutils: factor out g_build_filename_va()
This will be used in a later commit.

https://bugzilla.gnome.org/show_bug.cgi?id=788488
2017-11-07 08:25:28 -08:00
Philip Withnall
8e8f4e6486 docs: Fix various minor syntax errors in gtk-doc comments
This will fix a few broken links in the documentation, and shut up a
load of gtk-doc warnings (but certainly not all of them).

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

https://bugzilla.gnome.org/show_bug.cgi?id=790015
2017-11-07 14:51:12 +00:00
Philip Withnall
fac219adf8 tests: Fix a couple of bug base URIs
bugs.gnome.org doesn’t redirect properly any more (and isn’t HTTPS).

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2017-11-07 11:45:53 +00:00
Philip Withnall
0d49cd1b11 gutils: Fix minor memory leak on error path
Introduced in commit d011223085.

Coverity CID: 1382472

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2017-11-06 10:31:52 +00:00
Daniel Macks
0091f7f212 Use __APPLE__ token to control OSX-specific tests
The carbon framework is deprecated and not really related to OSX's
printf features. Directly test compiler-defined token for the platform
itself rather than that autodetected framework as a proxy.

https://bugzilla.gnome.org/show_bug.cgi?id=731625
2017-11-03 20:19:58 +00:00
Martin
029cfa9109 build: Ensure .py files are generated at build time not install time
Otherwise installing with `sudo make install` fails.

https://bugzilla.gnome.org/show_bug.cgi?id=706667
2017-11-03 20:11:56 +00:00
Philip Withnall
fc817eb38a gthread: Emit a critical if g_rw_lock_reader_lock() fails
It can only fail if there’s been a leak or programmer error, so this is
really unlikely to happen. At least make it obvious something has gone
wrong, though, rather than silently carrying on and returning as if the
reader lock has been acquired.

Do the same for g_rw_lock_writer_lock().

It should be safe to use g_critical() for reporting the problems, since
GRWLock is not used in gmessages.c, and printing a critical seems better
than aborting, just in case we do hit the ‘maximum number of reader
locks’ error code.

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

https://bugzilla.gnome.org/show_bug.cgi?id=756430
2017-11-03 18:17:14 +00:00
Krzesimir Nowak
f5e229c76d convert: Fix tautological comparisons in tests
https://bugzilla.gnome.org/show_bug.cgi?id=767239
2017-11-03 16:43:23 +00:00
Philip Withnall
a6fc4daeb9 gmessages: Add timestamp to g_log_writer_format_fields()
Since journald adds a timestamp, it would be useful to add one to the
stdout/stderr output too — we do not want it to miss out on the
timestamping fun.

Make it blue, because we can.

https://bugzilla.gnome.org/show_bug.cgi?id=769846
2017-11-03 13:01:19 +00:00
Benoît Dejean
54f6c56235 utils: Add new G_FORMAT_SIZE_BITS flag for g_format_size_full()
It will return sizes in bits, rather than bytes.

https://bugzilla.gnome.org/show_bug.cgi?id=789170
2017-11-02 13:39:19 +00:00
Nirbheek Chauhan
953a51d97b meson: Fix installation of gdb autoload scripts v2
`install:` is not a valid keyword argument for configure_file()
2017-11-02 10:22:39 +05:30
Nirbheek Chauhan
625bfa0b36 meson: Fix comment explaining gdb hacks
https://bugzilla.gnome.org/show_bug.cgi?id=788772
2017-11-02 10:03:22 +05:30
Jan Alexander Steffens (heftig)
430e2dd3f5 meson: Fix GDB scripts install_dir for *nix
Disable installation on Windows for now as this would use a colon in the
directory name.

https://bugzilla.gnome.org/show_bug.cgi?id=788772
2017-11-02 09:58:17 +05:30
Tom Schoonjans
d011223085 g_get_host_name: ensure hostname has UTF8 encoding on Windows
Ensures that the hostname returned by g_get_host_name is always UTF8 encoded.
Previously, on Windows, the returned string would be encoded in the
current codepage, if it contained non-ASCII characters.

The unit test for g_get_host_name was updated with a check to ensure
that the hostname is indeed at UTF-8 string.

https://bugzilla.gnome.org/show_bug.cgi?id=789755
2017-11-01 15:46:07 +00:00
Руслан Ижбулатов
53bd6a359f W32: Add a stat() implementation for private use
This commit adds new W32-only functions to gstdio.c,
and a new header file, gstdioprivate.h.
These functions are:
g_win32_stat_utf8()
g_win32_lstat_utf8()
g_win32_fstat()
and they fill a private structure, GWin32PrivateStat,
which has all the fields that normal stat has, as well as some
extras.

These functions are then used throughout glib and gio to get better
data about the system. Specifically:
* Full, 64-bit size, guaranteed (g_stat() is forced to use 32-bit st_size)
* Full, 64-bit file identifier (st_ino is 0 when normal stat() is used, and still is)
* W32 File attributes (which stat() doesn't report); in particular, this allows
  symlinks to be correctly identified
* Full, 64-bit time, guaranteed (g_stat() uses 32-bit st_*time on 32-bit Windows)
* Allocated file size (as a W32 replacement for the missing st_blocks)

st_mode remains unchanged (thus, no S_ISLNK), so when these are given back to
glib users (via g_stat(), for example, which is now implemented by calling g_win32_stat_utf8),
this field does not contain anything unexpected.

g_lstat() now calls g_win32_lstat_utf8(), which works on symlinks the way it's supposed to.

Also adds the g_win32_readlink_utf8() function, which behaves like readlink()
(including its inability to return 0-terminated strings and inability to say how large
the output buffer should be; these limitations are purely for compatibility with
existing glib code).

Thus, symlink support should now be much better, although far from being complete.

A new W32-only test in gio/tests/file.c highlights the following features:
* allocated size
* 64-bit time
* unique file IDs

https://bugzilla.gnome.org/show_bug.cgi?id=788180
2017-11-01 12:46:38 +00:00
Benoît Dejean
7ccbd86537 utils: refactor g_format_size_full
Refactor g_format_size_full to avoid duplicate code and make it easier to
add more units.

https://bugzilla.gnome.org/show_bug.cgi?id=789170
2017-10-27 12:18:53 +01:00
Christoph Reiter
fed574a0c8 introspection: Add more filename type annotations for strings which can contain filenames
This continues the changes done in https://bugzilla.gnome.org/show_bug.cgi?id=767245

This makes it possible to pass Python path types as process arguments and env vars
in PyGObject and and makes it clear that the values are not strictly utf-8 and need
to be validated/converted first.

https://bugzilla.gnome.org/show_bug.cgi?id=788863
2017-10-26 18:51:51 +02:00
Philip Withnall
3d35379382 docs: Fix typo in documentation for G_PRIVATE_INIT
Signed-off-by: Philip Withnall <withnall@endlessm.com>
2017-10-26 13:55:46 +01:00
Philip Withnall
a71251dc40 gkeyfile: Add some examples to the documentation
Add some examples of loading and saving key files.

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

https://bugzilla.gnome.org/show_bug.cgi?id=330458
2017-10-26 12:58:59 +01:00
Philip Withnall
3eacec1587 Use hash tables as sets in various places
Where we were already treating GHashTables as sets, modify them to use
the set-specific APIs g_hash_table_add() and g_hash_table_contains(), to
make that usage more obvious and less prone to being broken.

Heavily based on patches by Garrett Regier <garrettregier@gmail.com>.

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

https://bugzilla.gnome.org/show_bug.cgi?id=749371
2017-10-26 12:27:17 +01:00
Philip Withnall
f43babfea3 Revert "utils: refactor g_format_size_full"
This reverts commit 51f9c95cf2.

It’s changed the set of translatable strings generated in the POT file.
Reverting until a fix can be found for that.

https://bugzilla.gnome.org/show_bug.cgi?id=789170
2017-10-26 00:01:21 +01:00
Benoît Dejean
51f9c95cf2 utils: refactor g_format_size_full
Refactor g_format_size_full to avoid duplicate code and make it easier to
add more units.

https://bugzilla.gnome.org/show_bug.cgi?id=789170
2017-10-25 16:09:58 +01:00
Ole André Vadla Ravnås
b829b762fd gutf8: Fix length handling in g_utf8_make_valid()
We cannot blindly append the remainder when a length was provided
because the string isn't nul-terminated.

https://bugzilla.gnome.org/show_bug.cgi?id=789444
2017-10-25 10:33:48 +01:00
Simon McVittie
6e480634c6 g_child_watch_source_new: Document restrictions for POSIX platforms
The warnings issued when dealing with waitpid() raising ECHILD are
somewhat misleading: there are lots of reasons why waitpid() might
fail in this way, and we can't tell which one has happened.
In particular, passing a non-child or a non-pid, waiting for the same
pid elsewhere, or creating a duplicate watch for the same pid would
all fail in the same way.

Consolidate the restrictions into one place, and change all the other
places they were (or should have been!) mentioned to point to
that one place.

Signed-off-by: Simon McVittie <smcv@collabora.com>
Reviewed-by: Philip Withnall <withnall@endlessm.com>
Bug: https://bugzilla.gnome.org/show_bug.cgi?id=723743
2017-10-12 12:22:27 +01:00
Руслан Ижбулатов
4a77eb16ce Replace all instances of ssize_t with gssize
ssize_t is supported widely, but not universally, so use gssize instead.
Currently only one piece of code actually *needs* this change to be compilable
with MSVC, the rest are mostly in *nix parts of the code, but these are changed
too, for symmetry.

https://bugzilla.gnome.org/show_bug.cgi?id=788180
2017-10-11 12:56:11 +01:00
Emmanuele Bassi
17e29bebd9 Document how to integrate GTest into your project
We are missing the documentation on how to use GTest inside a project.

While we mention in passing gtester and gtester-report, the reality is
that we don't tell anybody how to use them inside their own build
system. Additionally, gtester and gtester-report are deprecated and kind
of abandoned, in favour of tools native to common build systems, such as
the TAP harness in Autotools, and the test harness in Meson.

See also:

  https://stackoverflow.com/questions/19958861/how-to-properly-set-up-glib-testing-framework-with-autotools

https://bugzilla.gnome.org/show_bug.cgi?id=788561
2017-10-11 12:19:06 +01:00
Andrew Potter
5564ddef12 gdate: add g_date_copy()
This will allow passing invalid GDates through GValues.

https://bugzilla.gnome.org/show_bug.cgi?id=760109
2017-10-11 12:13:20 +01:00
Philip Withnall
652a47d1d1 docs: Fix a typo in the GSlice documentation
And in a few of its variable names. s/adress/address/.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2017-10-11 11:48:08 +01:00
Jason Conti
bf7fcd2559 gtester-report: Ignore package, version and revision info if missing
https://bugzilla.gnome.org/show_bug.cgi?id=668035
2017-10-11 10:42:20 +01:00
Nirbheek Chauhan
62dedcb099 gmacros: Fix deprecations support with ICC
ICC defines __GNUC__ (to emulate GCC), but has its own method of
disabling deprecations.

https://bugzilla.gnome.org/show_bug.cgi?id=776562
2017-10-11 09:47:02 +01:00
Emmanuele Bassi
dc39232ded Do not build journal integration on older Linux platforms
We need to add more checks for journal_sendv(), as we depend on the
presence of mkostemp() and O_CLOEXEC, which may not be available on
older Linux platforms, like RHEL 5.

https://bugzilla.gnome.org/show_bug.cgi?id=788705
2017-10-09 12:45:59 +01:00
Philip Withnall
860dc949ca tests: Add some assertions on some otherwise-unused variables
Signed-off-by: Philip Withnall <withnall@endlessm.com>

https://bugzilla.gnome.org/show_bug.cgi?id=751738
2017-10-06 12:57:06 +01:00
SilentFlame
bd2fa54637 glib: Correct typos of ‘character’
https://bugzilla.gnome.org/show_bug.cgi?id=774083
2017-10-06 12:49:12 +01:00
Christian Persch
2bdec0c2f2 gbytes: Fix check in try_steal_and_unref
Need to check if the user data is equal to the data, before
taking the data out of the GBytes!

Bug #670139.
2017-10-06 12:41:35 +01:00
Andrew Borodin
7895706c82 Type accuracy for result of strlen() in string utilities
https://bugzilla.gnome.org/show_bug.cgi?id=630983
2017-10-06 12:32:10 +01:00
Philip Withnall
5040de9fc7 docs: Mention gsize, goffset, etc. are in C99
Signed-off-by: Philip Withnall <withnall@endlessm.com>

https://bugzilla.gnome.org/show_bug.cgi?id=569375
2017-10-06 12:14:59 +01:00
Philip Withnall
493723b4d9 gmessages: Update advice for G_LOG_DOMAIN
Suggest defining it for all code — for applications as well as for
libraries. This allows G_MESSAGES_DEBUG=my-app to be used to filter out
all messages from libraries which it uses, for example.

https://bugzilla.gnome.org/show_bug.cgi?id=777956
2017-10-06 11:26:47 +01:00
Philip Withnall
8330b09d78 Bug 679467 — Mention translation in g_warning() documentation
Include a line in the documentation for g_warning(), g_error(), g_critical()
and g_debug() mentioning that the messages passed to them typically should not
be translated.

Closes: https://bugzilla.gnome.org/show_bug.cgi?id=679467
2017-10-06 11:23:01 +01:00
Volker Sobek
c7dc81ce78 docs: Escape some backslashes for markdown
These no longer showed up correctly in the documentation.

https://bugzilla.gnome.org/show_bug.cgi?id=727346
2017-10-05 15:07:09 +01:00
Martin Blanchard
d3745d14e1 gprintf: Add a reminder concerning <glib/gprintf.h>
g_printf(), g_fprintf(), g_sprintf(), g_vprintf(), g_vfprintf(),
() and g_vasprintf() require gprintf.h to be explicitly included
in order to be used. This patch adds a reminder in each function's
documentation abstract.

https://bugzilla.gnome.org/show_bug.cgi?id=760716
2017-10-05 15:02:39 +01:00
Martin Blanchard
c443adeffb gprintf: Fix documentation regarding <glib/gprintf.h>
g_snprintf() and g_vsnprintf() declarations were moved and
don't require gprintf.h to be included anymore but g_vasprintf()
is and requires gprintf.h to be explicitly included.

https://bugzilla.gnome.org/show_bug.cgi?id=760716
2017-10-05 15:01:28 +01:00
Philip Withnall
85680f4a06 docs: Rewrap line to avoid it being interpreted as a list
Signed-off-by: Philip Withnall <withnall@endlessm.com>

https://bugzilla.gnome.org/show_bug.cgi?id=767215
2017-10-05 14:49:49 +01:00
Aurélien Zanelli
21d2c64660 gfileutils: add some sanity checks
To avoid handling non-null GError or NULL filename.

https://bugzilla.gnome.org/show_bug.cgi?id=754026
2017-10-05 13:42:19 +01:00
Simon McVittie
733c7bd9c5 g_test_log: Consistently use GLib whitespace style
Bug: https://bugzilla.gnome.org/show_bug.cgi?id=788467
Signed-off-by: Simon McVittie <smcv@collabora.com>
Reviewed-by: Philip Withnall <withnall@endlessm.com>
2017-10-03 17:22:48 +01:00
Simon McVittie
23ba8aec92 testutils: Report fatal errors and warnings as TAP
Lines starting with "Bail out!" are special TAP syntax: they mark
the entire test execution (one binary or script) as failed, and stop
processing. Automake's parallel test harness knows this, and will print
the diagnostic in the test results, leading to clearer output.

Without this change, having changed glib/tests/bytes.c to emit a
spurious g_warning():

ERROR: bytes - too few tests run (expected 15, got 0)
ERROR: bytes - exited with status 133 (terminated by signal 5?)

With this change, it's clearer what has happened:

ERROR: bytes - Bail out! FATAL-WARNING: I broke this as a demonstration

Bug: https://bugzilla.gnome.org/show_bug.cgi?id=788467
Signed-off-by: Simon McVittie <smcv@collabora.com>
Reviewed-by: Philip Withnall <withnall@endlessm.com>
2017-10-03 15:16:15 +01:00
Philip Withnall
81d7af312e gmem: Make it more obvious that g_mem_set_vtable() does nothing
Clarify the big deprecation warning in the documentation.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2017-10-03 09:36:08 +01:00
Philip Withnall
702b6af87c gtestutils: Explicitly cast args to g_assertion_message_cmpnum()
This avoids warnings when compiling with -Wconversion on 32-bit
architectures, as the conversion to (long double) is not necessarily
lossless. We don’t care about that, though, since the actual comparison
was done with the correct types, and g_assertion_message_cmpnum() is
only used to print failure information.

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

https://bugzilla.gnome.org/show_bug.cgi?id=788385
2017-10-02 15:32:46 +01:00
Philip Withnall
0e888bdf52 gtypes: Fix signedness of __builtin_bswap() usage
In GUINT64_TO_BE(), for example, when compiling with -Wsign-conversion,
we get a warning due to an implicit cast from (gint64) to (guint64) when
passing the argument to __builtin_bswap64().

According to the GCC documentation, __builtin_bswap64() takes an
unsigned argument:

https://gcc.gnu.org/onlinedocs/gcc/Other-Builtins.html

Cast the input appropriately.

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

https://bugzilla.gnome.org/show_bug.cgi?id=788384
2017-10-02 15:31:20 +01:00
Philip Withnall
1304197ed0 gmessages: Fix a typo in the documentation for g_log_set_handler_full()
Signed-off-by: Philip Withnall <withnall@endlessm.com>
2017-09-22 13:34:19 +01:00
Chun-wei Fan
4fd056a5f5 glib/glibconfig.h.win32.in: Update and clean up
Make the entries in here more consistent with what Meson produces with
its Visual Studio builds.  Also fix the macros [GSIZE|GSSIZE]_TO_[LE|BE]
for x64 builds.
2017-09-15 12:50:50 +08:00
Robert Ancell
db2ae64636 Fix comment/docs grammar: incase -> in case 2017-09-15 13:50:41 +12:00
Chun-wei Fan
a7a6449f4d meson: Install items according to their relevance
The m4 and bash completion items are usable and relevant
depending on the host system's configuration.  So, we check for the
presence of the programs that these items depend on, and only install
them when those programs are found.

For the Valgrind suppression files, we don't install them on Windows as
Valgrind is currently not supported on Windows.

Als fix the path where the GDB helpers are installed, as the path is
incorrectly constructed.

This will fix the "install" stage when building on Visual Studio at
least as there are some post-install steps that are related to them,
which will make use of these programs.

https://bugzilla.gnome.org/show_bug.cgi?id=783270
2017-09-14 16:02:03 +08:00
Chun-wei Fan
4c417c4965 build: Define G_HAVE_GNUC_[VARARGS|VISIBILITY] conditionally
They are not supported by Visual Studio, so only define them in
glibconfig.h.in when not on Visual Studio.  Fixes builds of GTK+-2.x
against Meson/MSVC builds of GLib.

https://bugzilla.gnome.org/show_bug.cgi?id=783270
2017-09-14 10:23:34 +08:00
Philip Withnall
015ab311f8 gmessages: Add IDs for documentation headers
This fixes some broken cross-references between various places in the
logging documentation.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2017-09-13 17:07:29 +01:00
Philip Withnall
a2cf4806a4 tests: Add tests for g_slist_copy() and g_slist_copy_deep()
This gives us 100% coverage of GSList (when running `make lcov`).

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

https://bugzilla.gnome.org/show_bug.cgi?id=787581
2017-09-13 13:37:13 +01:00
Philip Withnall
1a5cebec39 docs: Discourage use of gstdio.h and clarify its header requirements
Signed-off-by: Philip Withnall <withnall@endlessm.com>

https://bugzilla.gnome.org/show_bug.cgi?id=781598
2017-09-12 12:20:18 +01:00
Philip Withnall
39469aa7bb Revert "gstdio: #include fcntl.h on UNIX in gstdio.h"
This reverts commit 6f8073d44a.

As per further discussion on bug #781598, we can’t do this in GLib,
since fcntl.h is not guaranteed to be present on all Unix systems. Users
of GLib *must* do a header check (for example, using AC_CHECK_HEADERS)
and #include fcntl.h themselves.
2017-09-12 12:12:27 +01:00
Christian Schramm
54e3ed17f0 gslist: Simplified node removal and got rid of some code duplication
Merged two almost identical functions for removing at most one
or all nodes containing some data. Also simplified the code a bit
by using a pointer to a pointer (see
http://wordaligned.org/articles/two-star-programming).

(Modified by Philip Withnall to fix two code formatting nitpicks.)

https://bugzilla.gnome.org/show_bug.cgi?id=722256
2017-09-12 12:11:06 +01:00
Reuben Thomas
6f8073d44a gstdio: #include fcntl.h on UNIX in gstdio.h
https://bugzilla.gnome.org/show_bug.cgi?id=781598
2017-09-12 11:10:54 +01:00
Mikhail Zabaluev
48cf1d32c6 Fix up closure annotations for GSpawnChildSetupFunc
https://bugzilla.gnome.org/show_bug.cgi?id=738176
2017-09-11 21:07:08 +01:00
Mikhail Zabaluev
3ee5bb1120 Annotate g_bookmark_file_new() as a constructor
https://bugzilla.gnome.org/show_bug.cgi?id=756011
2017-09-11 21:01:15 +01:00
Mikhail Zabaluev
7759542ee3 gconvert: Skip the GIConv API from introspection
It's ugly:
- The core method, g_iconv(), can't be annotated with good semantics.
- The error value of g_iconv_open() is not representable in today's
  introspection.

https://bugzilla.gnome.org/show_bug.cgi?id=756128
2017-09-11 20:47:11 +01:00
Mikhail Zabaluev
01544c9269 Skip g_base64_decode_step() in introspection
The length of the caller-allocated (that flag was missing; added as well)
output array is calculated by a formula, so none of the usual array length
annotations apply. The state parameters need to be initialized with zero.

Just let them use the basic API.

https://bugzilla.gnome.org/show_bug.cgi?id=756103
2017-09-11 20:44:39 +01:00
Mikhail Zabaluev
28e8684168 gdataset: Skip problematic functions in the introspection
The functions with a GDestroyNotify to the data, or other ill-fitting
allocation semantics, are not currently introspectable.

The effect for the binding user would be that they're unable to
create or destroy a GData list, but they might still have an API
to poke at some data pointers from it.

In fact, none of the functions dealing with GData** or a dataset
location pointer are likely to get sensible bindings anyway;
the annotations added are mostly to avoid memory unsafety
and leaks.

https://bugzilla.gnome.org/show_bug.cgi?id=756470
2017-09-11 20:26:53 +01:00
Mikhail Zabaluev
a3ba8ea7d3 gdataset: Annotate the closures
Annotate the closure parameters in GDataForeachFunc, GDuplicateFunc,
and the functions using them.

https://bugzilla.gnome.org/show_bug.cgi?id=756470
2017-09-11 20:26:53 +01:00
Mikhail Zabaluev
2a0e1c8422 gdataset: Correct (nullable) and (transfer none) annotations
https://bugzilla.gnome.org/show_bug.cgi?id=756470
2017-09-11 20:26:53 +01:00
Mikhail Zabaluev
595a7e3bb2 g_datalist_id_replace_data: Annotate the out parameter
https://bugzilla.gnome.org/show_bug.cgi?id=756470
2017-09-11 20:26:52 +01:00
Robert Ancell
491f835c17 GDateTime: Support parsing ISO 8601 strings
This supports a subset of ISO 8601 since that is a commonly used standard for
storing date and time information. We support only ISO 8601 strings that contain
full date and time information as this would otherwise not map to GDateTime.
This subset includes all of RFC 3339 which is commonly used on the Internet and
the week and ordinal day formats as these are supported in the GDateTime APIs.

(Minor modification by Philip Withnall to change API versions from 2.54
to 2.56.)

https://bugzilla.gnome.org/show_bug.cgi?id=753459
2017-09-11 19:29:34 +01:00
Philip Withnall
0c15e9cd56 gversionmacros: Add version macros for GLib 2.56
Signed-off-by: Philip Withnall <withnall@endlessm.com>
2017-09-11 19:24:06 +01:00
INSUN PYO
61cb8b232b GMainLoop: match of parameter pair of LOCK_CONTEXT/UNLOCK_CONTEXT
There is no reason to use source->context as as parameter of UNLOCK_CONTEXT.
To avoid confusion, change to the parameter used in LOCK_CONTEXT.

https://bugzilla.gnome.org/show_bug.cgi?id=787146
2017-09-08 15:57:59 +01:00
Bastien Nocera
f813ce6abe glib: Slightly update GIOChannel documentation
Explain the default values of _{get,set}_close_on_unref() in the main
description rather than the argument one, link to the GIOChannel
structure when talking about it, and mention the default value of
"close on unref" in g_io_channel_unix_new().

https://bugzilla.gnome.org/show_bug.cgi?id=787123
2017-09-08 15:40:15 +01:00
Armin K
414225d7b3 meson: Compile guuid.c into libglib-2.0
https://bugzilla.gnome.org/show_bug.cgi?id=786807
2017-08-29 12:54:51 +03:00
Philip Withnall
2586eb9921 docs: Clarify lack of threading guarantees in GArray
Signed-off-by: Philip Withnall <withnall@endlessm.com>

https://bugzilla.gnome.org/show_bug.cgi?id=786555
2017-08-22 15:58:18 +01:00
INSUN PYO
15faf0ef62 glog: fix crash on Linux without stderr stream
0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:58
1  0xb67c43f0 in __GI_abort () at abort.c:89
2  0xb69ee9d8 in _g_log_abort (breakpoint=2, breakpoint@entry=1) at gmessages.c:548
3  0xb69ef692 in g_logv (log_domain=0xb6a1dfc8 "GLib", log_level=-1254563840, log_level@entry=G_LOG_LEVEL_CRITICAL, format=format@entry=0xb6a26a48 "%s: assertion '%s' failed", args=..., args@entry=...) at gmessages.c:1357
4  0xb69ef728 in g_log (log_domain=<optimized out>, log_level=log_level@entry=G_LOG_LEVEL_CRITICAL, format=0xb6a26a48 "%s: assertion '%s' failed") at gmessages.c:1398
5  0xb69efa5a in g_return_if_fail_warning (log_domain=<optimized out>, pretty_function=<optimized out>, expression=<optimized out>) at gmessages.c:2687
6  0xb69efe7c in g_log_writer_is_journald (output_fd=-1) at gmessages.c:2122
7  0xb69f02a2 in g_log_writer_default (log_level=G_LOG_LEVEL_CRITICAL, fields=0xbedc9d00, n_fields=4, user_data=0x0) at gmessages.c:2584
8  0xb69ef21a in g_log_structured_array (log_level=G_LOG_LEVEL_CRITICAL, fields=0xbedc9d00, n_fields=4) at gmessages.c:1933
9  0xb69ef47e in g_log_default_handler (log_domain=0xb6a1dfc8 "GLib", log_level=G_LOG_LEVEL_CRITICAL, message=<optimized out>, unused_data=<optimized out>) at gmessages.c:3036
10 0xb69ef5fc in g_logv (log_domain=0xb6a1dfc8 "GLib", log_level=log_level@entry=G_LOG_LEVEL_CRITICAL, format=format@entry=0xb6a26a48 "%s: assertion '%s' failed", args=..., args@entry=...) at gmessages.c:1336
11 0xb69ef728 in g_log (log_domain=<optimized out>, log_level=log_level@entry=G_LOG_LEVEL_CRITICAL, format=0xb6a26a48 "%s: assertion '%s' failed") at gmessages.c:1398
12 0xb69efa5a in g_return_if_fail_warning (log_domain=<optimized out>, pretty_function=<optimized out>, expression=<optimized out>) at gmessages.c:2687

If stderr is not associated with an output stream, the fileno(stderr) returned is -1.
So, g_return_if_fail_warning is recursively called and the abort occurs on the second call.

Modified by Philip Withnall to include mention this in the
documentation.

https://bugzilla.gnome.org/show_bug.cgi?id=786452
2017-08-18 09:26:12 +01:00
Chun-wei Fan
ea6ac5f71e meson/Windows: Check whether system PCRE is a static build
Instead of hardcoding -DPCRE_STATIC into the CFLAGS of GLib, do the
following on Windows only (since PCRE_STATIC only matters on Windows):

-If there is no installed PCRE, use the included PCRE copy and
 enable -DPCRE_STATIC, as we did before.
-If there is a installed PCRE, check whether the PCRE build is a static
 or DLL build by checking the linkage against pcre_free() with
 PCRE_STATIC defined works.  If it does, enable -DPCRE_STATIC.
-On non-Windows builds, do not enable -DPCRE_STATIC

https://bugzilla.gnome.org/show_bug.cgi?id=783270
2017-08-17 18:26:02 +08:00
Chun-wei Fan
72528938b7 Meson: Check for HAVE_GOOD_PRINTF
The HAVE_GOOD_PRINTF config variable determines whether we are able to
use the CRT-supplied *printf() functions directly, by determining whether
the CRT-supplied vsnprintf() and snprintf() functions support C99 well
enough.

This means, we need to build the gnulib subdir as a static lib in GLib, and use
the gnulib *printf() functions when:

-We are on Windows
-The CRT's vsnprintf() and snprintf() is not sufficiently C99-compliant.

This will fix the problem when the *printf() functions cause a CRT
abort() call on pre-2015 Visual Studio builds at least, and ensures that
the Visual Studio 2015+ builds will pass the printf tests in GLib, since
the *printf() in Visual Studio 2015/2017's CRT does not support the %n
format specifier, nor the positional parameters (which requires
different _*printf_p*() functions), as indicated by
glib/tests/test-printf.c.

https://bugzilla.gnome.org/show_bug.cgi?id=783270
2017-08-17 17:46:37 +08:00
Robert Ancell
947fea1d16 GDateTime: Reject days outside of month limits
The previous code allowed February 30th.
2017-08-16 11:47:32 +12:00
Руслан Ижбулатов
788705633e W32: Support XDG_* environment variables
Try to get XDG_* environment variables and, if they are available, use their
contents to initialize various directories the same way this happens on *nix.
When these variables are not available, fall back to the W32-specific APIs for
getting directories.

https://bugzilla.gnome.org/show_bug.cgi?id=766358
2017-08-14 15:45:01 +01:00
Philip Withnall
fac7f2be2e gsequence: Add introspection annotations to Return values
Signed-off-by: Philip Withnall <withnall@endlessm.com>

https://bugzilla.gnome.org/show_bug.cgi?id=786060
2017-08-10 16:38:41 +01:00
Daniel Boles
f6aa8c3988 GSList: Note that using ->next directly is OK
as for GList
2017-08-07 20:39:06 +01:00
Daniel Boles
a2ec32833e GList: Fix typo of member ->prev in documentation
It said list->previous, which is not a thing that exists.
2017-08-07 20:33:25 +01:00
Tim-Philipp Müller
a1fdae8afc meson: don't error out if xmllint is not found
Only needed for glib/tests and entirely optional.
2017-08-03 19:23:25 +01:00
Daniel Boles
e02e3540ab gspawn: Don’t mention removed gdk_spawn functions
Mention alternatives that actually still exist instead.

https://bugzilla.gnome.org/show_bug.cgi?id=785520
2017-08-03 14:44:40 +01:00
Daniel Macks
f591366eee gtest: Handle -s as explicit SKIP instead of inhibiting altogether
Improves diagnostics and makes test transcripts easier to compare

https://bugzilla.gnome.org/show_bug.cgi?id=769135
2017-08-03 12:43:00 +01:00
Philip Withnall
9652839606 gslice: Fix inline delarations in GSlice
Accidentally introduced in commit
5cddde1fb2.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2017-08-03 11:54:58 +01:00
Philip Withnall
f2b6c11629 gstrfuncs: Expand documentation for errno functions
Mention that it really is a good idea to save errno before doing
literally anything else after calling a function which could set it.

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

https://bugzilla.gnome.org/show_bug.cgi?id=785577
2017-08-03 10:21:13 +01:00
Philip Withnall
5cddde1fb2 Consistently save errno immediately after the operation setting it
Prevent the situation where errno is set by function A, then function B
is called (which is typically _(), but could be anything else) and it
overwrites errno, then errno is checked by the caller.

errno is a horrific API, and we need to be careful to save its value as
soon as a function call (which might set it) returns. i.e. Follow the
pattern:
  int errsv, ret;
  ret = some_call_which_might_set_errno ();
  errsv = errno;

  if (ret < 0)
    puts (strerror (errsv));

This patch implements that pattern throughout GLib. There might be a few
places in the test code which still use errno directly. They should be
ported as necessary. It doesn’t modify all the call sites like this:
  if (some_call_which_might_set_errno () && errno == ESOMETHING)
since the refactoring involved is probably more harmful than beneficial
there. It does, however, refactor other call sites regardless of whether
they were originally buggy.

https://bugzilla.gnome.org/show_bug.cgi?id=785577
2017-08-03 10:21:13 +01:00
Руслан Ижбулатов
b267f648d9 glib/gpoll W32: trust WFMOE() return value
WaitForMultipleObjectsEx() returns the index of the *first* handle that triggered the wakeup, and promises that all handles with lower index are still inactive. Therefore, don't check them, only check the handles with higher index. This removes the need of rearranging the handles (and, now, handle_to_fd) array, it's enough to take a pointer to the next item and use it as a new, shorter array.

https://bugzilla.gnome.org/show_bug.cgi?id=785468
2017-08-01 12:50:13 +00:00
Руслан Ижбулатов
226ea94685 glib/gpoll W32: faster GPollFD lookup
Put all ptrs for GPollFDs that contribute handles into an array, the layout of which mirrors the handles array. This way finding GPollFD for a handle is a simple matter of knowing this handle's index in the handles array (which is something we always know). Removes the need to loop through all fds looking for the right one. And, with the message FD also passed along, it's now completely unnecessary to even pass fds to poll_rest() at all.

https://bugzilla.gnome.org/show_bug.cgi?id=785468
2017-08-01 12:50:12 +00:00
Руслан Ижбулатов
201977983e glib/gpoll W32: pass along GPollFD ptr for msg
Instead of just indicating that messages should be polled for, save the pointer to GPollFD that contains G_WIN32_MSG_HANDLE, and pass it along. This way it won't be necessary to loop through all fds later on, searching for G_WIN32_MSG_HANDLE.

https://bugzilla.gnome.org/show_bug.cgi?id=785468
2017-08-01 12:50:11 +00:00
Руслан Ижбулатов
1f3da929f5 glib/gpoll W32: fold f->revents = 0 into for() loop
GCC most likely optimizes that already, but no harm in trying.

https://bugzilla.gnome.org/show_bug.cgi?id=785468
2017-08-01 12:50:10 +00:00
Руслан Ижбулатов
cb2316aaa1 glib/gpoll W32: use WFSOE() instead of SleepEx()
WaitForSingleObjectEx() is supposed to be a more efficient sleep method.
It waits on the handle of the current process. That handle will be signaled once the process terminates, and since we're *inside* the process, it'll never happen (and if it does, we won't care anymore).
The use of an alertable wait ensures that we wake up when a completion routine wants to run.

https://bugzilla.gnome.org/show_bug.cgi?id=785468
2017-08-01 12:50:10 +00:00
Alistair Francis
d67b58a9a6 glib/gpoll: Remove if conditional
The original ready < nhandles - 1 can be re-written as ready + 1 < nhandles
which is the same confition that we are checking on the first
itteration of the for loop. This means we can remove the if statement
and let the for loop check the code.

This also has the side effect of removing an invalid check as
WAIT_OBJECT_0 was not subtracted from ready in the if statement.

Signed-off-by: Alistair Francis <alistair.francis@xilinx.com>
2017-08-01 12:50:09 +00:00
Руслан Ижбулатов
425a9f5864 gio: add a simple gpoll performance test for W32
It just creates a number of socket pairs, then triggers read-ready status on these pairs in different patterns (none, one, half, all) and checks how much time it takes to g_poll() those. Also sometimes posts a Windows message and polls for its arrival.
The g_main_context_new() is necessary to initialize g_poll() debugging on W32.

Measures minimal and maximal time it takes to g_poll(), as well as the average, over 1000 runs.
Collects the time values into 25 non-linear buckets between 0ns and 1000ns, and displays them at the conclusion of each subtest.

https://bugzilla.gnome.org/show_bug.cgi?id=785468
2017-08-01 12:50:08 +00:00
Debarshi Ray
a7926117dd gdatetime: Silence -Wmaybe-uninitialized
GCC 6.3.1 thinks that tmp is being used uninitialized:
  gdatetime.c: In function ‘format_ampm’:
  gdatetime.c:2248:7: warning: ‘tmp’ may be used uninitialized in this
    function [-Wmaybe-uninitialized]
         g_free (tmp);
         ^~~~~~~~~~~~

It is not an actual problem because the code in question is guarded by
"if (!locale_is_utf8)" and "#if defined (HAVE_LANGINFO_TIME)", and it
does get initialized under those circumstances. Still, it is a small
price to pay for a cleaner build and having actual problems stand out
more prominently.

https://bugzilla.gnome.org/show_bug.cgi?id=785438
2017-07-26 18:14:10 +02:00
Emmanuele Bassi
039c40e6ec Revert "GKeyFile – Add array length annotations to to_data(), get_keys() and get_groups()"
This reverts commit fd329f4853.

The commit changed the Introspection ABI, and it requires a change in
any application using an introspection-based language binding.
2017-07-21 15:33:37 +01:00
Emmanuele Bassi
bfd307855b meson: Allow toggling internal/system PCRE dependency
We don't always want to build GLib with a dependency on the system's
PCRE. The Autotools build allows this, and so should the Meson build.
2017-07-21 14:04:49 +01:00
Debarshi Ray
8962736ba9 docs: Encourage applications to define G_LOG_DOMAIN
https://bugzilla.gnome.org/show_bug.cgi?id=785130
2017-07-20 19:45:53 +02:00
Christoph Reiter
ab6e425574 meson: define G_PID_FORMAT
https://bugzilla.gnome.org/show_bug.cgi?id=784995
2017-07-19 16:38:37 +02:00
Tim-Philipp Müller
9306ada4fd meson: fix 'Unknown variable "gtester"' error on windows
With msys64/mingw.
2017-07-15 11:24:40 +01:00
Emmanuele Bassi
065a8a488a meson: Use the appropriate interface and binary ages
We need to build them out of the project version, and then propagate
them.
2017-07-14 14:21:57 +01:00
Sebastian Dröge
69bfd1a771 meson: Install missing guuid.h header 2017-07-13 19:03:39 -04:00
Nirbheek Chauhan
ee94ad776e meson: Use proxy-libintl if gettext is not found
This is a stub-only library that can be used while building against
MSVC and contains no i18n machinery at all.

The dependencies added indirectly use the libintl.h header, and when
built as a subproject, the header won't be in a path known the
pre-processor.
2017-07-13 19:03:39 -04:00
Tim-Philipp Müller
2f29ee1735 meson: add -fvisibility=hidden explicitly to selected targets
Don't use it project-wide for building everything. Otherwise
symbols for shared modules won't be exposed, e.g. in the
resourceplugin used by the gio resource unit test.
2017-07-13 19:03:39 -04:00
Tim-Philipp Müller
89ee284d2b meson: glib/tests: add missing tests 2017-07-13 19:03:39 -04:00
Tim-Philipp Müller
d29f022b0b meson: add support for dtrace/systemtap
Still at least one FIXME. And untested so far. It builds.
2017-07-13 19:03:39 -04:00
Nirbheek Chauhan
3c62619930 tests: autoptr test can be run on gcc, clang, intel
The only place where it won't work, is MSVC and maybe Sun Studio, but
we'd need someone to test Sun Studio first.
2017-07-13 19:03:39 -04:00
Nirbheek Chauhan
e2da3cb599 meson: Port to latest master (2.51.0)
Also remove headers from some gio sources. Headers do not need to be
added to the list of sources.

+ various smaller self-explanatory fixes.
2017-07-13 19:03:39 -04:00
Patrick Griffis
d10be6102f meson: Minor modernizations 2017-07-13 19:03:39 -04:00
Patrick Griffis
a690e2a375 meson: More build fixes
- Fix installing various data files
- Build translations
2017-07-13 19:03:39 -04:00
Nirbheek Chauhan
fe2a9887a8 meson: Improve MSVC and MinGW support and fix dependencies everywhere
Disable gio tests on Windows, fix .gitignore to not ignore
config.h.meson, and add more things to it.

Rename the library file naming and versioning to match what Autotools
outputs, e.g., libglib-2.0.so.0.5000.2 on Linux, libglib-2.0-0.dll  and
glib-2.0-0.dll on Windows with MSVC.

Several more tiny fixes, more executables built and installed, install
pkg-config and m4 files, fix building of gobject tests.

Changes to gdbus-codegen to support out-of-tree builds without
environment variables set (which you can't in Meson). We now add the
build directory to the Python module search path.
2017-07-13 19:03:39 -04:00
Tim-Philipp Müller
213957970e meson: Fix glib, add gobject, gio, gthread, gmodule, etc
Several small fixes to the build files.

Lots of tests have also been added, and glib tests pass now.
2017-07-13 19:03:39 -04:00
Jussi Pakkanen
98e641424b meson: initial glib build
https://mail.gnome.org/archives/gtk-devel-list/2013-August/msg00001.html
2017-07-13 19:03:39 -04:00
Руслан Ижбулатов
75fa8c2afb W32 - don't use gettext & gcov during gettext init
Non-representable characters during UTF16->locale conversion
will cause gcov code to return an error, for which it will try
to use gettext, so that the error message is localized.

If such call is made while gettext is being initialized
(there's a g_once_init_enter up the stack), the thread will hang forever.

To solve this, use W32 API to do the UTF16->locale conversion
and don't use gettext when it returns an error.

Also optimize g_win32_locale_filename_from_utf8() a bit,
as we need more UTF16 and less UTF8 now.

https://bugzilla.gnome.org/show_bug.cgi?id=784579
2017-07-13 01:49:38 +00:00
Christoph Reiter
b803c0a224 gspawn-win32: Fix multiple definition error with a static build
gspawn-win32.c gets included by gspawn-win32-helper.c and in case
of a static build the definitions there clash with the ones from
libglib. Fixed by not compiling the ABI comapt code in case
GSPAWN_HELPER is defined.

I missed this issue in commit 23dffdd949

https://bugzilla.gnome.org/show_bug.cgi?id=780634
2017-07-12 23:36:18 +02:00
Christoph Reiter
b60e4665ef gwin32: Fix missing prototypes on win64
I missed this in commit 5067d25a74

https://bugzilla.gnome.org/show_bug.cgi?id=780634
2017-07-12 22:36:30 +02:00
Руслан Ижбулатов
c4b5702e08 Use %lu format for DWORD 2017-07-12 19:46:07 +00:00
Aleksandr Slobodeniuk
cf7ee86b97 docs: fixing lost character
https://bugzilla.gnome.org/show_bug.cgi?id=784792
2017-07-11 14:14:37 +01:00
Philip Withnall
a131134918 build: Drop nmake/MSC build system for GLib
It hasn’t been seriously maintained for the best part of 10 years and is
very outdated. The recommended way to build GLib on Windows is now
Visual Studio:

https://wiki.gnome.org/Projects/GTK%2B/Win32/MSVCCompilationOfGTKStack#GLib

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

https://bugzilla.gnome.org/show_bug.cgi?id=722047
2017-07-10 11:22:40 +01:00
Rico Tzschichholz
4e1567a079 unicode: Update to unicode 10.0.0
https://bugzilla.gnome.org/show_bug.cgi?id=784456
2017-07-05 17:53:07 +02:00
Philip Withnall
a74fe20064 tests: Drop local timezone GTimeVal overflow check
We can’t reasonably control the local timezone in the test
environment, so drop some assertions which were assuming the local
timezone offset was not big enough to cause an overflow in the GTimeVal
handling for GDateTime.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2017-07-05 16:37:20 +01:00
Sebastian Dröge
fd329f4853 GKeyFile – Add array length annotations to to_data(), get_keys() and get_groups()
https://bugzilla.gnome.org/show_bug.cgi?id=784020
2017-06-21 13:47:40 +03:00
Philip Withnall
1366ce7ee0 gutf8: Clarify return value docs for g_utf8_find_next_char()
Make it clearer that it will only return NULL if @end is non-NULL. Add a
test for this too.

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

https://bugzilla.gnome.org/show_bug.cgi?id=773842
2017-06-21 11:39:52 +01:00
Philip Withnall
3e89b19c44 gutf8: Fix documentation for g_utf8_get_char_validated() length limits
If g_utf8_get_char_validated() encounters a nul byte in the middle of a
string of given longer length, it returns -2, indicating a partial
gunichar. That is not the obvious behaviour, but since
g_utf8_get_char_validated() has been API for a long time, the behaviour
cannot be changed.

Document it, and add some unit tests (for this behaviour and the other
behaviour of g_utf8_get_char_validated()).

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

https://bugzilla.gnome.org/show_bug.cgi?id=780095
2017-06-21 11:38:46 +01:00
Philip Withnall
428acd9b14 tests: Fix overflows in find_maximum_supported_tv_sec()
The addition (highest_success + lowest_failure) could have overflowed,
and typically would do on 32-bit platforms where the real
highest_success should be G_MAXLONG. Fix that, and introduce special
handling of the corner case of (highest_success = G_MAXLONG).

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

https://bugzilla.gnome.org/show_bug.cgi?id=783841
2017-06-21 11:21:31 +01:00
Philip Withnall
30fed3b906 tests: Fix GDateTime overflow tests on 32-bit architectures
On architectures where sizeof(glong) == 32 bits, there are no problems
with overflow when constructing a GDateTime from a GTimeVal. Adjust the
test for this by basing it on the maximum supported tv_sec value it can
calculate, rather than a fixed ‘known unsupported’ value.

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

https://bugzilla.gnome.org/show_bug.cgi?id=783841
2017-06-21 11:21:31 +01:00
Philip Withnall
2db7aa4799 gdatetime: Fix a potential overflow in overflow calculations
I can’t remember whether glong (tv.tv_sec) needs to be explicitly
promoted to gint64 here, or whether C does it automatically. Safer to
make the cast explicit to avoid overflow issues on 32-bit platforms,
where glong is 32-bit.

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

https://bugzilla.gnome.org/show_bug.cgi?id=783841
2017-06-21 11:21:31 +01:00
Igor Pashev
c8e268bbce Fix detection and usage of strerror_r()
autoconf provides a macro for this situation, which saves us having to
manually work out whether strerror_r() returns a char* or an int.

https://bugzilla.gnome.org/show_bug.cgi?id=784000
2017-06-20 14:59:27 +01:00
Philip Withnall
ac0b0c84f7 gmessages: Expand documentation on GLogWriterFunc chaining
As prompted by Marc-Andre Lureau.

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

https://bugzilla.gnome.org/show_bug.cgi?id=661926
2017-06-14 09:57:01 +01:00
Chun-wei Fan
ad49479265 Visual Studio builds: Visual Studio 2013 and later has va_copy()
Update config.h.win32.in and glib/glibconfig.h.win32.in to indicate so.
2017-06-14 11:48:27 +08:00
Debarshi Ray
debbdb7ce7 docs: The program name is also set by g_application_run
https://bugzilla.gnome.org/show_bug.cgi?id=783524
2017-06-07 20:58:07 +02:00
Sébastien Wilmet
eea0681574 LGPLv2+ -> LGPLv2.1+: update remaining files
For the files in gio/ (but not in gio/ sub-directories), only the *.[ch]
files were handled in commit 3bf4a720c3.

For the modified files in glib/tests/markups/, I've tested that
`make check` still succeeds.

After this commit,
$ git grep -in "GNU Library"
and
$ git grep -in "Library General"
return only results in COPYING files and in glib/libcharset/. The latter
was not updated because it's a copy.

$ git grep -in "version 2" | grep -iv "version 2\.1"
now doesn't return any LGPL license header.
- glib-gettextize.in: GPL
- glib/gen-unicode-tables.pl: GPL
- glib/gnulib/: a copy
- glib/libcharset/: a copy
- m4macros/attributes.m4: GPL
- po/po2tbl.sed.in: GPL
- tap-driver.sh: GPL
- tests/*.pl: GPL

https://bugzilla.gnome.org/show_bug.cgi?id=776504
2017-06-03 10:30:17 +02:00
Ignacio Casal Quinteiro
e4e83bff72 win32: port monotonic times to use QPC
This provides a high precision monotonic time and
the concerns that we had are no longer true
on new versions of Windows (7+).

https://bugzilla.gnome.org/show_bug.cgi?id=783340
2017-06-02 18:11:11 +02:00