platform/upstream/glib.git
11 years agoUpdate Visual C++ 2010 property sheet
Chun-wei Fan [Sat, 19 Jan 2013 04:05:12 +0000 (12:05 +0800)]
Update Visual C++ 2010 property sheet

Left out some items to purge in the last commit.  Sorry :|

11 years agoClean up Visual C++ property sheets
Chun-wei Fan [Sat, 19 Jan 2013 04:02:45 +0000 (12:02 +0800)]
Clean up Visual C++ property sheets

We no longer need entries to generate the .def files in the property sheets
as we are now doing __declspec (dllexport) to export all the needed
symbols.  So, purge these items from the property sheets since they are no
longer used.

11 years agoBug 688681: Stop using the .def file for GThread Visual C++ builds
Chun-wei Fan [Sat, 19 Jan 2013 03:58:47 +0000 (11:58 +0800)]
Bug 688681: Stop using the .def file for GThread Visual C++ builds

We should also stop using gthread/gthread.def file as well, since we
also use __declspec (dllexport) for the two (deprecated) functions there
since commit f8756694.

This should also silence some linker warnings in x64 builds.

Also get rid of the references to the .symbols files in the
.vcxproj.filters(in) in the various Visual C++ 2010 projects

11 years agotimezone: plug a memleak
Cosimo Cecchi [Fri, 18 Jan 2013 22:22:52 +0000 (17:22 -0500)]
timezone: plug a memleak

11 years agotimezone: avoid a double GBytes unref
Cosimo Cecchi [Fri, 18 Jan 2013 22:02:35 +0000 (17:02 -0500)]
timezone: avoid a double GBytes unref

This will cause random memory corruption; functions should not unref
passed-in parameters.

11 years agoUpdated Serbian translation
Мирослав Николић [Fri, 18 Jan 2013 22:01:19 +0000 (23:01 +0100)]
Updated Serbian translation

11 years agoGVariant: fix normal-form checking for tuples
Ryan Lortie [Fri, 18 Jan 2013 21:11:20 +0000 (16:11 -0500)]
GVariant: fix normal-form checking for tuples

GVariant has the concept of fixed-sized types (ie: types for which all
values of the type will have the same size).  Examples are booleans,
integers, doubles, etc.  Tuples containing only these types are also
fixed size.

When GVariant is trying to deal with a fixed-sized value for which it
doesn't have a sufficient backing store (eg: the case where a
fixed-sized value was created with g_variant_new_data() with an
incorrect number of bytes) it denotes this by setting the size of the
value to the correct fixed size but using a NULL data pointer.

This is well-documented in several code comments and also in the public
API documentation for g_variant_get_data() which describes the situation
number which NULL could be returned.

The decision to deal with this case in this way was changed at the last
minute around the time that GVariant was merged -- originally we had an
elaborate setup involving allocating an internal buffer of sufficient
size to be shared between all invalid values.

Unfortunately, when making this change a small detail was missed.
gvs_tuple_get_child() (the function responsible for deserialising
tuples) was updated to properly check for this case (and it contains a
comment about why it must).  gvs_tuple_is_normal() (the function
responsible for verifying if a tuple is in normal form) was not.

We add the check now.

Note that this problem does not exist with any other container type
because tuples are the only container capable of being fixed-sized.  All
other container types (arrays, maybes, variants) can contain a variable
number of items or items of variable types (note: we consider dictionary
entries to be two-tuples).  The code for validating non-container values
also contains a check for the case of NULL data.

The problem also does not occur in the only other function dealing with
serialised tuples: gvs_tuple_n_children().  Whereas other container
types would have to inspect the serialised data to determine the number
of children, for tuples it can be determined directly from the type.

11 years agogobject/: Remove abicheck.sh from DIST_EXTRA
Ryan Lortie [Fri, 18 Jan 2013 19:33:16 +0000 (14:33 -0500)]
gobject/: Remove abicheck.sh from DIST_EXTRA

11 years agoAdd new API checking utility
Ryan Lortie [Fri, 18 Jan 2013 18:56:10 +0000 (13:56 -0500)]
Add new API checking utility

Add a test script to make sure that (with a few exceptions) only symbols
that start with 'g_' are being exported from our public libraries.

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

11 years agoRemove a few more G_GNUC_INTERNAL users
Ryan Lortie [Fri, 18 Jan 2013 18:27:16 +0000 (13:27 -0500)]
Remove a few more G_GNUC_INTERNAL users

11 years agoFix visibility for glib/ and gio/ submodules
Ryan Lortie [Fri, 18 Jan 2013 18:23:40 +0000 (13:23 -0500)]
Fix visibility for glib/ and gio/ submodules

We have various sub directories in glib/ and gio/ (eg: inotify, gnulib,
pcre, xdgmime, etc.) that build convenience libraries that are then
included into libglib and libgio.  The files in these directories need
to be built with the same visibility policy as the files in the first
level directories, so add CFLAGS for them all.

This wasn't a problem when the visibility flags were set directly in
CFLAGS but then we had to deal with some modules that we built that we
explicitly wanted to export symbols from.

For now, we can keep things the way they are because it's less hacky and
although it's a theoretical hazard to forget these CFLAGS, we rarely add
new subdirectories to the build.

11 years agoRemove most use of G_GNUC_INTERNAL
Colin Walters [Wed, 28 Nov 2012 17:00:40 +0000 (12:00 -0500)]
Remove most use of G_GNUC_INTERNAL

Now that we use an explicit list of symbols to export, the
G_GNUC_INTERNAL is redundant.

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

11 years agoRemove ABI checking scripts
Ryan Lortie [Mon, 14 Jan 2013 04:31:45 +0000 (23:31 -0500)]
Remove ABI checking scripts

Before this commit, the only difference between the expected and actual
ABI were the addition of _init and _fini symbols in each module (now
that regexp-based export control is not catching those).

11 years agoRemove regexp-based export control
Ryan Lortie [Mon, 14 Jan 2013 04:12:23 +0000 (23:12 -0500)]
Remove regexp-based export control

11 years agogsignal: fix closure invalidation code
Ryan Lortie [Thu, 17 Jan 2013 03:55:27 +0000 (22:55 -0500)]
gsignal: fix closure invalidation code

This is the bug that has been causing segfaults and criticals when accel
keys are used to close windows via GtkUIManager.

The main cause of this problem was a mistake made in the original patch
when modifying the handler_lookup() to take the extra 'closure'
parameter.  The original check used was:

    if (handler->sequential_number == handler_id ||
       (closure && handler->closure == closure))

It was called to find a particular closure like so:

    handler_lookup (instance, 0, closure, &signal_id);

The problem is that the check will return if either the signal ID or
closure matches (if a closure was given).  The calling code assumes 0 to
be an invalid signal ID which will match no handlers, but unfortunately
the rest of gsignal code uses this to denote a signal that has already
been disconnected.  The result is that this function was searching for a
matching closure _or_ the first already-disconnected handler.  When it
found the already-disconnected handler, we'd get criticals and crashes.

The condition has been corrected; it now ignores the handler_id
parameter if the closure parameter is non-NULL.

While we're in here, change the lifecycle of the invalidation notify to
be easier to understand.

Before, the notify was removed when the last reference on the handler
dropped.  This could happen in very many situations; often at the end of
an emission.  Instead, we now tie the registration of the notifier to
the lifecycle of the signal connection.  When the signal is disconnected
we remove the notification, even if other references are held (eg:
because it is currently being dispatched).

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

11 years agogio/tests: add some more async stream tests
Dan Winship [Wed, 16 Jan 2013 15:09:10 +0000 (10:09 -0500)]
gio/tests: add some more async stream tests

Add read_async() and skip_async() tests to buffered-input-stream.

Fix and re-enable filter-streams's existing close_async() tests, and
add read_async(), skip_async(), and write_async() tests as well. Also,
redo the tests to use dummy GFilterInputStream and GFilterOutputStream
subclasses rather than GBufferedInput/OutputStream, so that we're
testing the base filter stream implementations of everything (since
the buffered stream overrides are already getting tested in the
buffered-input-stream and buffered-output-stream tests anyway).

Add a skip_async() test to unix-streams. (This one would crash without
the bugfix in the previous commit.)

11 years agogio: callback_data is the task not the task data.
Alban Browaeys [Tue, 15 Jan 2013 23:04:58 +0000 (00:04 +0100)]
gio: callback_data is the task not the task data.

skip_callback_wrapper expect the user_data (callback_data)
to be the task holding the task_data, not the task_data
itself.
Otherwise the task_data is cast as GTask and then task_data
is extracted from this bogus task.

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

11 years agomainloop test: fix a silly memory error
Ryan Lortie [Tue, 15 Jan 2013 20:40:14 +0000 (15:40 -0500)]
mainloop test: fix a silly memory error

11 years agomainloop test: use atomic for cross-thread access
Ryan Lortie [Tue, 15 Jan 2013 20:40:09 +0000 (15:40 -0500)]
mainloop test: use atomic for cross-thread access

11 years agomainloop test: fix a small typo
Ryan Lortie [Tue, 15 Jan 2013 20:22:35 +0000 (15:22 -0500)]
mainloop test: fix a small typo

This g_assert() could never possibly fail, as it was.

11 years agotests for the new MainContext/GSource API
Ryan Lortie [Tue, 15 Jan 2013 04:05:31 +0000 (23:05 -0500)]
tests for the new MainContext/GSource API

11 years agoAdd a UNIX fd source
Ryan Lortie [Mon, 14 Jan 2013 19:47:16 +0000 (14:47 -0500)]
Add a UNIX fd source

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

11 years agogsource: Add support for file descriptors on UNIX
Ryan Lortie [Mon, 14 Jan 2013 21:53:06 +0000 (16:53 -0500)]
gsource: Add support for file descriptors on UNIX

Adding file descriptors to a GSource provides similar functionality to
the old g_source_add_poll() API with two main differences.

First: the list of handles is managed internally and therefore users are
prevented from randomly modifying the ->events field.  This prepares us
for an epoll future where changing the event mask is a syscall.

Second: keeping the list internally allows us to check the ->revents for
events for ourselves, allowing the source to skip implementing
check/prepare.  This also prepares us for the future by allowing an
implementation that doesn't need to iterate over all of the sources
every time.

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

11 years agoGTimeoutSource: simplify
Ryan Lortie [Tue, 30 Aug 2011 23:14:17 +0000 (19:14 -0400)]
GTimeoutSource: simplify

Take advantage of the new default handling of the 'prepare' and 'check'
functions.

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

11 years agoGSource: new API g_source_set_ready_time()
Ryan Lortie [Mon, 14 Jan 2013 21:51:51 +0000 (16:51 -0500)]
GSource: new API g_source_set_ready_time()

Add an API to mark a GSource to automatically become ready at the
specified monotonic time.

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

11 years agogsource: allow NULL check and prepare functions
Ryan Lortie [Mon, 29 Oct 2012 17:26:05 +0000 (18:26 +0100)]
gsource: allow NULL check and prepare functions

Allow for NULL GSourceFuncs.check() and .prepare().

For prepare() the source will be taken not to be ready and having an
infinite timeout.  For check() the source will be taken not to be ready.

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

11 years agomove GIOCondition to gmain.h from giochannel.h
Ryan Lortie [Mon, 29 Oct 2012 15:33:18 +0000 (16:33 +0100)]
move GIOCondition to gmain.h from giochannel.h

GIOCondition has uses outside of GIOChannel, so move it to gmain.h.

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

11 years agogsource: Make GSource->source_funcs const
Ryan Lortie [Mon, 29 Oct 2012 15:31:46 +0000 (16:31 +0100)]
gsource: Make GSource->source_funcs const

This is the vtable pointer for the source which is usually held in
static storage.  For our internal sources it points at a vtable which
the user should really never be modifying.

Mark it const.

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

11 years agogtester: Add #include config.h
Yuri Sedunov [Tue, 15 Jan 2013 16:05:43 +0000 (11:05 -0500)]
gtester: Add #include config.h

Missed #include "config.h" so, in particular, large file support
(_FILE_OFFSET_BITS) ignored.

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

11 years agoRevert "Improvde #include order consistency"
Chun-wei Fan [Tue, 15 Jan 2013 07:47:17 +0000 (15:47 +0800)]
Revert "Improvde #include order consistency"

This reverts commit f2e00a07f49d6ad0e8d790396bcdea913592ce33.

Moving the block up would prevent G_OS_WIN32 being checked correctly as
it is a macro that is defined by including the GLib header(s), at least for
Visual C++ builds.

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

11 years agoBug 688681: Stop using .def files in Visual Studio builds
Chun-wei Fan [Tue, 15 Jan 2013 07:23:05 +0000 (15:23 +0800)]
Bug 688681: Stop using .def files in Visual Studio builds

Since we are now starting to use __declspec (dllexport) to export the
public functions during the build of the GLib DLLs (i.e. to generate the
.lib files), we don't want to generate the .def files from the .symbols
files as we did before for a long time.

This removes from the projects the custom build steps to generate the
various .def files

This will also update the pre-configured config.h(.win32.in) to define
_GLIB_EXTERN appropriately as __declspec (dllexport), as well as making its
entries reflect config.h.in more closely.

11 years agoBump version
Matthias Clasen [Tue, 15 Jan 2013 05:24:27 +0000 (00:24 -0500)]
Bump version

11 years ago2.35.4 2.35.4 upstream/2.35.4
Matthias Clasen [Tue, 15 Jan 2013 04:52:10 +0000 (23:52 -0500)]
2.35.4

11 years agoDist assert-msg-test.gdb
Matthias Clasen [Tue, 15 Jan 2013 04:25:05 +0000 (23:25 -0500)]
Dist assert-msg-test.gdb

And refer to it in srcdir. Otherwise, the test fails mysteriously
in make distcheck.

11 years agovisibility: Use a separate CFLAGS variable
Ryan Lortie [Tue, 15 Jan 2013 04:24:53 +0000 (23:24 -0500)]
visibility: Use a separate CFLAGS variable

We only want to control the default visibility for our five main
installable libraries: libglib, libgthread, libgmodule, libgobject,
libgio.  We should therefore only set -fvisibility=hidden when building
those.

Use a separate substitution variable for this purpose.

Using CFLAGS directly leads to some modules built in testcases not
exporting their symbols (and then the tests fail).  It also affects the
fam file monitoring module.

Colin had originally done it this way in his visibility patch series but
I failed to understand why so I didn't copy it.  Now I do.

Also: revert changes made to two testcases in an attempt to work around
this issue.

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

11 years agoFix module-test in a better way
Matthias Clasen [Tue, 15 Jan 2013 03:47:02 +0000 (22:47 -0500)]
Fix module-test in a better way

Avoid having visibility attribute directly in the code by
adding a _GLIB_EXTERN-decorated declaration for the exported
variables.

11 years agoFix distcheck
Matthias Clasen [Tue, 15 Jan 2013 03:22:41 +0000 (22:22 -0500)]
Fix distcheck

With gdbus-testserver now being a compiled program, it no longer
lives in SRCDIR.

11 years agoFix up visibility fallout in module-test
Matthias Clasen [Tue, 15 Jan 2013 02:31:47 +0000 (21:31 -0500)]
Fix up visibility fallout in module-test

11 years agoFix the assert-msg test
Matthias Clasen [Mon, 14 Jan 2013 22:21:52 +0000 (17:21 -0500)]
Fix the assert-msg test

gdb is playing games with us, by breaking -x /dev/stdin

11 years agoRemove an unused function
Matthias Clasen [Mon, 14 Jan 2013 20:53:37 +0000 (15:53 -0500)]
Remove an unused function

11 years agoMake the build more quiet
Matthias Clasen [Mon, 14 Jan 2013 20:53:13 +0000 (15:53 -0500)]
Make the build more quiet

11 years agowin32: hide g_win32_app_info_get_type()
Ryan Lortie [Mon, 14 Jan 2013 16:17:52 +0000 (11:17 -0500)]
win32: hide g_win32_app_info_get_type()

This was in a private header file and was never part of the public ABI.
Hide it again.

Caught by Dieter Verfaillie.

11 years agoglocal*monitor: export ABI only on UNIX
Ryan Lortie [Mon, 14 Jan 2013 16:14:53 +0000 (11:14 -0500)]
glocal*monitor: export ABI only on UNIX

Add an #ifdef G_OS_UNIX around the GLIB_AVAILABLE_IN_ALL annotation on
the _get_type() functions for GLocal{File,Directory}Monitor.

These symbols are in private header files and are only exported so that
the in-tree file monitoring modules can subclass.  This is only needed
on UNIX and was therefore never part of the public ABI on Windows.

Caught by Dieter Verfaillie.

11 years agowin32: hide _glib_get_dll_directory again
Ryan Lortie [Mon, 14 Jan 2013 16:11:00 +0000 (11:11 -0500)]
win32: hide _glib_get_dll_directory again

This is not part of our public ABI and it's not used from the other
libraries in GLib, so we should not be exporting it.

Caught by Dieter Verfaillie.

11 years agoGParamSpec: Make constructors introspectable
Martin Pitt [Mon, 14 Jan 2013 10:26:30 +0000 (11:26 +0100)]
GParamSpec: Make constructors introspectable

Commit 282366c3262 unnecessarily (skip)ed all the GParamSpec constructors like
g_param_spec_bool(). Make those introspectable by dropping the (skip) and
adding proper transfer annotations.

Keep g_param_spec_value_array() skipped as GValueArray is deprecated.

11 years agotests: introduce a small hack for visibility
Ryan Lortie [Mon, 14 Jan 2013 05:13:00 +0000 (00:13 -0500)]
tests: introduce a small hack for visibility

One of our testcases builds a small giomodule for testing the loading of
modules containing resources.  Unfortunately, this module gets built
using the same CFLAGS as the rest of GLib, including the visibility
flags (defaulting to hidden).

Use "config.h" to get a declaration of _GLIB_EXTERN that will export
symbols properly and use it to annotate the necessary APIs.

11 years agogthread-impl.c: add missing #include "config.h"
Ryan Lortie [Mon, 14 Jan 2013 05:06:26 +0000 (00:06 -0500)]
gthread-impl.c: add missing #include "config.h"

One of the features of our new symbol exporting regime is that it forces
config.h to be included at the top of every .c file.

This was missed in gthread-impl.c.

The only reason this wasn't noticed is because nothing in this file is
being used anymore.  We need those symbols to continue to be exported
for reasons of ABI backwards compatibility, however.

11 years agokqueue: Reduce G_GNUC_INTERNAL + G_LOCK abuse
Ryan Lortie [Mon, 14 Jan 2013 04:43:44 +0000 (23:43 -0500)]
kqueue: Reduce G_GNUC_INTERNAL + G_LOCK abuse

The kqueue file monitoring backend was misusing G_GNUC_INTERNAL for want
of 'static' in a couple of places and also using it to declare a lock
that was never used at all.

Fix those up.

11 years agogio: remove export tags from two private headers
Ryan Lortie [Mon, 14 Jan 2013 04:30:49 +0000 (23:30 -0500)]
gio: remove export tags from two private headers

I got a little bit too excited and added GLIB_AVAILABLE_IN_ALL tags to
some internal API.

11 years agowin32: build: stop using .def files
Ryan Lortie [Sun, 13 Jan 2013 20:41:03 +0000 (15:41 -0500)]
win32: build: stop using .def files

With visibility now under the control of __declspec(dllexport) we no
longer need to build .def files or use them for building our various
.dll files.

.def files used to be installed (even though it is only really useful
when creating the .dll or .lib file).  Don't do that anymore either.

The Makefiles still contain rules to create a .lib file for use with
Visual Studio and these rules require .def files.  There are special
requirements to using these rules (like having installed and setup
Microsoft tools for use during the build) and therefore the problem of
creating a .def file for use with them is left open to anyone willing to
make the effort.  Many options are available depending on which
toolchain is in use (dlltool, pexport, gendef, dumpbin.exe, just to name
a few).

If we can find a free tool for creating .lib files in the future, we
should probably revisit this issue and add proper support back to our
build system.

11 years agoconfigure.ac: change our visibility policy
Ryan Lortie [Thu, 6 Dec 2012 18:42:06 +0000 (13:42 -0500)]
configure.ac: change our visibility policy

Check for -fvisibility=hidden as a supported CFLAG.

If it is supported, use it and emit an AC_DEFINE to change the meaning
of _GLIB_EXTERN to include the GNU attribute for marking symbols as
public: __attribute((visibility("default"))).

This will override the public definition of _GLIB_EXTERN for any file
which does #include "config.h" (forcing all our .c files to do so, as a
side effect).

If we're on mingw, assume that -fvisibility will work and also throw in
a __declspec(dllexport) for good measure.  This will allow us to move
away from using a .def file to create the the various DLLs.

It's possible that there may be compilers that accept
-fvisibility=hidden but don't accept the GNU attribute for making
symbols public again -- we will hopefully receive bugs if any of those
exist.

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

11 years agowin32: visibility fixups
Ryan Lortie [Sun, 13 Jan 2013 20:34:27 +0000 (15:34 -0500)]
win32: visibility fixups

Add/remove visibility macros according to if symbols were previously
part of our public win32 API.

11 years agogio: hide another leaked symbol
Ryan Lortie [Mon, 14 Jan 2013 03:57:27 +0000 (22:57 -0500)]
gio: hide another leaked symbol

guint g_menu_model_items_changed_signal leaked out.  Tuck it back in.

11 years agogio: add some missing array annotations with their element-type
Rico Tzschichholz [Sun, 13 Jan 2013 19:49:15 +0000 (20:49 +0100)]
gio: add some missing array annotations with their element-type

11 years agogio: add missing element-type annotation
Rico Tzschichholz [Sun, 13 Jan 2013 19:05:17 +0000 (20:05 +0100)]
gio: add missing element-type annotation

11 years agogmarshal.h: replace "extern" with GLIB_AVAILABLE_IN_ALL
Ryan Lortie [Thu, 6 Dec 2012 19:01:46 +0000 (14:01 -0500)]
gmarshal.h: replace "extern" with GLIB_AVAILABLE_IN_ALL

This was one of the few public header files that was properly declaring
functions as "extern".  Switch it to use GLIB_AVAILABLE_IN_ALL instead.

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

11 years agogbacktrace.c: special treatment for a weird symbol
Ryan Lortie [Thu, 6 Dec 2012 19:03:22 +0000 (14:03 -0500)]
gbacktrace.c: special treatment for a weird symbol

We have a public symbol 'glib_on_error_halt' that is exported from
gbacktrace.c without appearing in a header, presumably with the
intention that people will be able to hit it from their debugger.

Mark it as GLIB_AVAILABLE_IN_ALL from inside the .c file...

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

11 years agoAdd a new _GLIB_EXTERN macro for "extern"
Ryan Lortie [Thu, 6 Dec 2012 18:37:45 +0000 (13:37 -0500)]
Add a new _GLIB_EXTERN macro for "extern"

This macro simply evaluates the "extern" unless it has been explicitly
defined to something else.

All of the version macros (including the unversioned deprecation markers
and GLIB_AVAILABLE_IN_ALL) now include _GLIB_EXTERN as part of their
definition.

G_INLINE has also been modified to use _GLIB_EXTERN where appropriate.

This macro should never be used outside of the gmacros.h/gversonmacros.h
headers.

The effect of this patch is that "extern" has now been added to all
functions declared in installed headers.  Strictly speaking, this is
something we should have had all along...

GLIB_VAR and GOBJECT_VAR have also been modified to use _GLIB_EXTERN on
non-Windows, instead of "extern" which they were using before.  The
eventual goal is to use the normal version/deprecation macros on
exported variables and drop GLIB_VAR but we need to see how this will
work on Windows before we go ahead with that.

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

11 years agoadd a missing AVAILABLE_IN_2_36 annotation
Ryan Lortie [Sun, 13 Jan 2013 18:13:03 +0000 (13:13 -0500)]
add a missing AVAILABLE_IN_2_36 annotation

11 years agovarious: add GLIB_AVAILABLE_IN_ALL everywhere else
Ryan Lortie [Thu, 6 Dec 2012 19:04:59 +0000 (14:04 -0500)]
various: add GLIB_AVAILABLE_IN_ALL everywhere else

Add the GLIB_AVAILABLE_IN_ALL annotation to all old functions (that
haven't already been annotated with the GLIB_AVAILABLE_IN_* macros or a
deprecation macro).

If we discover in the future that we cannot use only one macro on
Windows, it will be an easy sed patch to fix that.

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

11 years agogioenumtypes.h.template: use GLIB_AVAILABLE_IN_ALL
Ryan Lortie [Thu, 6 Dec 2012 18:59:35 +0000 (13:59 -0500)]
gioenumtypes.h.template: use GLIB_AVAILABLE_IN_ALL

glib-mkenums is not currently clever enough to know which version an
enum type was added in, so just mark all the _get_type() functions as
available in all versions.

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

11 years agogversionmacros.h: add GLIB_AVAILABLE_IN_ALL
Ryan Lortie [Thu, 6 Dec 2012 18:34:55 +0000 (13:34 -0500)]
gversionmacros.h: add GLIB_AVAILABLE_IN_ALL

Add a macro to declare that a particular symbol is available in all
versions of GLib.

All newly-added symbols should have proper version macros (like
GLIB_AVAILABLE_IN_2_36) and this macro is less likely to get used 'by
accident' for those than one with a name like GLIB_EXTERN or
GLIB_PUBLIC.

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

11 years agoAdd G_GNUC_PRINTF on all functions with format strings
Henrique Dante de Almeida [Sun, 13 Jan 2013 16:05:14 +0000 (14:05 -0200)]
Add G_GNUC_PRINTF on all functions with format strings

This allows compilation with clang without errors, even when
-Wformat-nonliteral is active (as long as there are no real cases of
non literal formatting).

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

11 years agoAPI: Constify g_get_prgname()
Benjamin Otte [Sun, 13 Jan 2013 17:14:11 +0000 (18:14 +0100)]
API: Constify g_get_prgname()

Found by Mike Gorse while via pygobject freeing the value.

Should have been const according to original commit message.

11 years agoUpdated Galician translations
Fran Diéguez [Sun, 13 Jan 2013 16:39:08 +0000 (17:39 +0100)]
Updated Galician translations

11 years agobuild: Ensure user-set CFLAGS override defaults
Henrique Dante de Almeida [Sun, 13 Jan 2013 14:58:12 +0000 (12:58 -0200)]
build: Ensure user-set CFLAGS override defaults

For example, the user should be able disable our default -Werror
settings.

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

11 years agoGInputStream: fix default g_input_stream_skip_async() logic
Dan Winship [Sat, 12 Jan 2013 22:39:37 +0000 (17:39 -0500)]
GInputStream: fix default g_input_stream_skip_async() logic

g_input_stream_real_skip_async() wants to use read_async() normally,
but will use skip() in a thread instead if it sees that read_async()
will end up using threads. Except that the test for "will read_async()
use threads" never got updated to know about the GPollableInputStream
support in read_async(), so it was doing the wrong thing in that case.
Fix.

Also remove a small bit of pre-GTask cruft noticed nearby.

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

11 years agoUpdated Slovenian translation
Matej Urbančič [Sun, 13 Jan 2013 11:02:42 +0000 (12:02 +0100)]
Updated Slovenian translation

11 years agoUpdated Bulgarian translation
Alexander Shopov [Sat, 12 Jan 2013 18:18:05 +0000 (20:18 +0200)]
Updated Bulgarian translation

11 years agoExpand g_type_init release notes
Matthias Clasen [Sat, 12 Jan 2013 18:02:31 +0000 (13:02 -0500)]
Expand g_type_init release notes

This is in the light of
https://bugzilla.gnome.org/show_bug.cgi?id=691077

11 years agoglocalfile: Only check for .hidden files if standard::is-hidden is requested
Colin Walters [Fri, 11 Jan 2013 16:10:15 +0000 (11:10 -0500)]
glocalfile: Only check for .hidden files if standard::is-hidden is requested

For OSTree, I use Gio and also really care about performance.  It's
disturbing to see open('.hidden') all over my straces and such.  At
the moment I have an explicit set of things to query, as opposed to
"standard::*", since even before this that also implies an lstat() of
the parent directory.

This matches up with what we do for all the other attributes.

See https://bugzilla.gnome.org/show_bug.cgi?id=587806
https://bugzilla.gnome.org/show_bug.cgi?id=691558

11 years agogio-querymodules: Ensure we're linked to GObject
Colin Walters [Thu, 10 Jan 2013 21:25:15 +0000 (16:25 -0500)]
gio-querymodules: Ensure we're linked to GObject

Since we're dynamically loading objects, after the g_type_init()
change, we now need to ensure people building with --as-needed don't
lose the DT_NEEDED on libgobject.

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

11 years agoG_IO_ERROR_INVALID_DATA: fix docstring typo
Will Thompson [Thu, 10 Jan 2013 11:16:47 +0000 (11:16 +0000)]
G_IO_ERROR_INVALID_DATA: fix docstring typo

11 years agoipv6_v4mapped: force pass even if we don't speak IPv4
Antoine Jacoutot [Wed, 9 Jan 2013 15:29:29 +0000 (16:29 +0100)]
ipv6_v4mapped: force pass even if we don't speak IPv4

Some OS (e.g. OpenBSD) do not implement IP v4-mapped addresses. When
this is the case, then we get a "Connection refused", so force the test
to pass to that further tests can run.

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

11 years agoglib-compile-resources: avoid warnings with -Wmissing-field-initializers
Dan Winship [Wed, 9 Jan 2013 15:06:53 +0000 (10:06 -0500)]
glib-compile-resources: avoid warnings with -Wmissing-field-initializers

Initialize all the fields of the generated GStaticResource, to avoid
warnings in packages that build with -Wmissing-field-initializers.

11 years agoUpdated Spanish translation
Daniel Mustieles [Tue, 8 Jan 2013 13:43:21 +0000 (14:43 +0100)]
Updated Spanish translation

11 years agoconfigure.ac: replace obsolete AC_CONFIG_HEADER with with AC_CONFIG_HEADERS
Javier Jardón [Mon, 7 Jan 2013 15:41:19 +0000 (15:41 +0000)]
configure.ac: replace obsolete AC_CONFIG_HEADER with with AC_CONFIG_HEADERS

The former is an obsolete alias to the latter.
It may get removed in the future.

11 years agoAssamese translation updated
Nilamdyuti Goswami [Mon, 7 Jan 2013 12:14:23 +0000 (17:44 +0530)]
Assamese translation updated

11 years agotests/gdatetime: add a missing ; on windows
Dan Winship [Sun, 6 Jan 2013 23:56:39 +0000 (18:56 -0500)]
tests/gdatetime: add a missing ; on windows

11 years agogio/tests: fix a few more gdbus-testserver.py references
Dan Winship [Sun, 6 Jan 2013 22:12:15 +0000 (17:12 -0500)]
gio/tests: fix a few more gdbus-testserver.py references

that got missed in Matthias's earlier patch

11 years agoGFile: Add Btrfs clone ioctl support
Nirbheek Chauhan [Sat, 5 Jan 2013 07:22:31 +0000 (12:52 +0530)]
GFile: Add Btrfs clone ioctl support

The attached patch adds support for the btrfs "clone" ioctl which
makes Copy-on-Write reflinks, resulting in cheap O(1) copies when
source/destination are on the same filesystem. The ioctl itself is
quite straightforward, and GNU coreutils has had support since 7.5
(--reflink=auto --sparse=auto).

The ioctl only operates on regular files and symlinks, and always
follows symlinks; checks have been added accordingly.

This patch would be very useful for everyone who uses btrfs
filesystems (Meego folks for instance). On systems that don't have
btrfs, or if the the source is not on a btrfs filesystem, the ioctl
returns EINVAL, and the fallback code is triggered. Hence this will
cause no problems for non-btrfs users.

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

11 years agoGMemoryInputStream: fix skip_async()
Dan Winship [Sat, 5 Jan 2013 18:26:23 +0000 (13:26 -0500)]
GMemoryInputStream: fix skip_async()

a5876e5f made GMemoryInputStream subclassable, but accidentally broke
read_async() and skip_async() in the process. The immediately
following e7983495 fixed read_async() (and added a test for it), but
skip_async() accidentally got... skipped.

Fix it now and add a test for it.

Also, GMemoryInputStream's skip_async() was assuming that skip() could
never fail, which is true of its own implementation, but might not be
true of a subclass's, so do proper GError handling too.

11 years agogio/tests: Drop superfluous dbus-1 dependencies of gdbus-auth
Rico Tzschichholz [Fri, 4 Jan 2013 20:36:37 +0000 (21:36 +0100)]
gio/tests: Drop superfluous dbus-1 dependencies of gdbus-auth

11 years agogtype: disallow adding interfaces after the fact
Ryan Lortie [Mon, 5 Nov 2012 16:07:16 +0000 (11:07 -0500)]
gtype: disallow adding interfaces after the fact

Add a check to prevent adding an interface to a class that has already
had its class_init done.

This is an incompatible change but it is suspected that there are not
many users of this functionality.  Two known exceptions are pygobject
(fixed in bug 686149) and our own testsuite (affected tests have been
temporarily disabled by this patch).

Once we confirm that nobody else is using this functionality we can
remove a rather large amount of code for dealing with this case.

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

11 years agogio/tests: Fix make dist
Rico Tzschichholz [Fri, 4 Jan 2013 19:37:27 +0000 (20:37 +0100)]
gio/tests: Fix make dist

Missing bit of 32c925427785895ce156f4bb428082e1952d2407

11 years agoRevert "gtype: disallow adding interfaces after the fact"
Rico Tzschichholz [Fri, 4 Jan 2013 19:25:46 +0000 (20:25 +0100)]
Revert "gtype: disallow adding interfaces after the fact"

This reverts commit d6a075b0d8dfe4e4a41f6624ad7032d2163d420c.

11 years agoImprove g_cond_wait docs
Matthias Clasen [Fri, 4 Jan 2013 13:27:00 +0000 (08:27 -0500)]
Improve g_cond_wait docs

Document that the mutex is locked upon return.
https://bugzilla.gnome.org/show_bug.cgi?id=691110

11 years agoRemove deprecated AM_PROG_CC_STDC
Marko Lindqvist [Fri, 4 Jan 2013 00:21:35 +0000 (19:21 -0500)]
Remove deprecated AM_PROG_CC_STDC

Fixes automake 1.13 build.

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

11 years agoIn gdbus-auth test, use g_unsetenv(), not g_setenv() with a NULL value
David Zeuthen [Thu, 3 Jan 2013 18:34:21 +0000 (13:34 -0500)]
In gdbus-auth test, use g_unsetenv(), not g_setenv() with a NULL value

Signed-off-by: David Zeuthen <zeuthen@gmail.com>
11 years agoDrop gdbus-testserver.py
Matthias Clasen [Thu, 3 Jan 2013 18:13:50 +0000 (13:13 -0500)]
Drop gdbus-testserver.py

The tests are using the C version of gdbus-testserver now.
This means we no longer rely on dbus-python for 'make check'.
https://bugzilla.gnome.org/show_bug.cgi?id=675856

11 years agoUse the C gdbus-testserver in tests
Matthias Clasen [Thu, 3 Jan 2013 18:12:58 +0000 (13:12 -0500)]
Use the C gdbus-testserver in tests

11 years agoAdd a C version of gdbus-testserver.py
Matthias Clasen [Thu, 3 Jan 2013 18:11:58 +0000 (13:11 -0500)]
Add a C version of gdbus-testserver.py

This will let us drop the dbus-python dependency.
The C version does not 100% reproduce all the hash table
and array manipulation of the python version, but the tests
do not rely on it anyway.

11 years agoGDBus: Avoid use of libdbus-1 in authentication tests
David Zeuthen [Thu, 3 Jan 2013 16:57:21 +0000 (11:57 -0500)]
GDBus: Avoid use of libdbus-1 in authentication tests

This greatly simplifies the test since everything is now in a single
process and possible bugs / quirks in libdbus-1 will not interfere
with the tests. On the other hand, we no longer test interoperability
with libdbus-1. This is somewhat moot, however, since other tests that
involve a message bus (e.g. GTestDBus users which include most of the
GDBus test suite itself) will test this.

Also ensure that we don't pollute existing D-Bus keyrings for the
DBUS_COOKIE_SHA1 authentication method (e.g. files in the
~/.dbus-keyrings directory) by setting the environment variables
G_DBUS_COOKIE_SHA1_KEYRING_DIR and
G_DBUS_COOKIE_SHA1_KEYRING_DIR_IGNORE_PERMISSION.

All in all, this change avoids some thorny issues where the GDBus and
libdbus-1 implementations disagree on whether an item in the D-Bus
keyring is still valid (items have an age etc.). In reality, since the
DBUS_COOKIE_SHA1 authentication method is never used in production,
this is never hit in production. This bug was, however, frequently hit
if you just ran the test suite repeatedly for 15 minutes or so.

Also add TODO items to mention that we currently don't test corner
cases involving

 - DBUS_COOKIE_SHA1 timeouts
 - libdbus-1 interoperability

Signed-off-by: David Zeuthen <zeuthen@gmail.com>
11 years agoGValueArray: clarify the deprecation warnings
Dan Winship [Wed, 2 Jan 2013 18:00:48 +0000 (13:00 -0500)]
GValueArray: clarify the deprecation warnings

GValueArray as a whole is deprecated in favor of GArray (with GValue
elements); warnings like "'g_value_array_get_nth' is deprecated: Use
'g_array_index' instead" are confusing because they suggest that the
GArray functions can be used with GValueArrays. Make them say "Use
'GArray' instead" instead.

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

11 years agoFix build with --enable-gtk-doc
Dieter Verfaillie [Wed, 2 Jan 2013 12:10:31 +0000 (13:10 +0100)]
Fix build with --enable-gtk-doc

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

11 years agoAdd a --with-python option
Matthias Clasen [Tue, 1 Jan 2013 20:49:06 +0000 (15:49 -0500)]
Add a --with-python option

The effect is the same as specifying PYTHON=python3, but a
configure option works better in jhbuild.
https://bugzilla.gnome.org/show_bug.cgi?id=684103

11 years agoMove testgobject to tests/
Matthias Clasen [Tue, 1 Jan 2013 19:06:20 +0000 (14:06 -0500)]
Move testgobject to tests/

And fix it to actually check the right things.

11 years agoImprovde #include order consistency
Matthias Clasen [Tue, 1 Jan 2013 18:54:54 +0000 (13:54 -0500)]
Improvde #include order consistency

This was mostly fixed already, just re-fix a few details here.
https://bugzilla.gnome.org/show_bug.cgi?id=71704

11 years agoAnnotate GApplication::local_command_line
Paolo Borelli [Thu, 27 Dec 2012 19:55:30 +0000 (20:55 +0100)]
Annotate GApplication::local_command_line

Also add some documentation.
https://bugzilla.gnome.org/show_bug.cgi?id=690670

11 years agogmarkup: Make GMarkupParseContext a boxed type
Jasper St. Pierre [Tue, 3 Jul 2012 19:14:18 +0000 (15:14 -0400)]
gmarkup: Make GMarkupParseContext a boxed type

At the same time, add a refcount and public ref/unref methods.
This makes it usable from introspectable.

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