summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Deprecate g_type_class_add_private()issue-699Emmanuele Bassi2018-05-253-2/+8
| | | | | | | | It's been 4 years and 8 development cycles since we introduced G_ADD_PRIVATE and offset-based private data access. It is now time to finally deprecate the old mechanism. Closes: #699
* Merge branch 'macosx-objc' into 'master'Xavier Claessens2018-05-257-39/+66
|\ | | | | | | | | | | | | Macosx fixes Closes #528 and #1381 See merge request GNOME/glib!3
| * Fix missing osx files when running "make dist"Xavier Claessens2018-05-251-1/+3
| | | | | | | | Fixes #528, #1381.
| * Revert "Revert "Meson: Fix cocoa and carbon support""Xavier Claessens2018-05-252-27/+41
| | | | | | | | This reverts commit e25a2f95b3d1f39c5abc208d797f6c065d67713e.
| * Revert "Revert "Rename objective-c files from .c to .m""Xavier Claessens2018-05-256-12/+23
|/ | | | This reverts commit 2e9f3a9afe4c5cb1ebdda5e33e6fd3552bf56d38.
* Merge branch 'coverage-regex' into 'master'Emmanuele Bassi2018-05-251-0/+1
|\ | | | | | | | | ci: Add a regex to parse line coverage statistics from genhtml output See merge request GNOME/glib!5
| * ci: Add a regex to parse line coverage statistics from genhtml outputPhilip Withnall2018-05-241-0/+1
|/ | | | | | | | | | | | | | | | GitLab can then use this to annotate each pipeline with its code coverage statistics. It can only use one figure, so we choose lines (rather than function or branch coverage) since it’s the most intuitive figure. This parses the ‘lines’ line from output like: Overall coverage rate: lines......: 76.7% (108959 of 142122 lines) functions..: 80.7% (10294 of 12763 functions) branches...: 51.3% (50226 of 97953 branches) Signed-off-by: Philip Withnall <withnall@endlessm.com>
* tests/strfuncs: drop some redundant test codeChristoph Reiter2018-05-241-5/+0
| | | | | | | The loop was testing that all strings in the hash table are valid utf-8, but the loop filling the hash table is already doing that. https://bugzilla.gnome.org/show_bug.cgi?id=795569
* tests/strfuncs: mingw-w64 prints 3 digits for the %e exponentChristoph Reiter2018-05-241-1/+5
| | | | | | | | | Filed and fixed upstream: https://sourceforge.net/p/mingw-w64/bugs/732/ Once we get a new release in MSYS2 or when we get better gnulib integration this special case needs to be removed again, but for now this will do. https://bugzilla.gnome.org/show_bug.cgi?id=795569
* tests/strfuncs: handle unknown error codes when testing g_strerrorChristoph Reiter2018-05-241-2/+8
| | | | | | | | | | | The tests checks that g_strerror returns unique error messages for all error codes between 1-200, but under Windows only a small range of them is actually used: https://msdn.microsoft.com/en-us/library/t3ayayh1.aspx Change the test to check that the returned message is either unique or matches the error message for unknown codes instead. https://bugzilla.gnome.org/show_bug.cgi?id=795569
* tests/logging: Don't hardcode the result of logging a pointerChristoph Reiter2018-05-241-2/+9
| | | | | | | | The output of the %p type is implementation defined and on Windows we get leading zeros depending on the pointer type size. Instead of adding ifdeffery use g_snprintf() to generate the expected message. https://bugzilla.gnome.org/show_bug.cgi?id=795569
* gmem.h: Use typeof() in g_steal_pointer() macroPeter Bloomfield2018-05-231-0/+6
| | | | | | | | | | | | | | | | g_steal_pointer is both an inline function, returning gpointer, and a macro that casts the return value to the type of its argument. The first version of the macro uses '0 ? (*(pp)) : (g_steal_pointer) (pp)' to cast the return value to the type of *pp, but this fails to yield warnings about incompatible pointer types with current gcc. Apparently the ternary operator is optimized away before the type of the expression is determined. The typeof() (or __typeof__()) operator allows an explicit cast. https://bugzilla.gnome.org/show_bug.cgi?id=742456 https://bugzilla.gnome.org/show_bug.cgi?id=796341
* 2.57.12.57.1Matthias Clasen2018-05-223-2/+47
|
* Revert "Rename objective-c files from .c to .m"Matthias Clasen2018-05-226-23/+12
| | | | This reverts commit e400af99d436b003b93479e4892623f336f58a6b.
* Revert "Meson: Fix cocoa and carbon support"Matthias Clasen2018-05-222-41/+27
| | | | This reverts commit 2e3769a4f79e563a4a0630587a7c486919cf3d88.
* W32: check filename for being NULL in g_stat()Руслан Ижбулатов2018-05-221-0/+6
| | | | | | | | | | Previous version of this function started with a call to g_utf8_to_utf16(), which also served as a NULL check, since g_utf8_to_utf16() just returns NULL on NULL strings. Current version of this function does some filename string checks first and converts it to utf16 only after these checks are done, and these checks do not take into account the possibility of filename being NULL. Fix this by explicitly checking for NULL.
* Meson: Fix cocoa and carbon supportXavier Claessens2018-05-222-27/+41
| | | | | | | | | | | | | | | - Compiler checks were failing because it were using C compiler to build objc code. - xdgmime is needed on osx too. - -DGIO_COMPILATION must be passed to objc compiler too. - gapplication doesn't build on osx, it is excluded in autotools too. We have to be careful when we use add_project_link_arguments(): All targets are built using link arguments for the C language, except for libgio on osx which use the objc language, because it contains some ".m" source files. See https://github.com/mesonbuild/meson/issues/3585. https://bugzilla.gnome.org/show_bug.cgi?id=796214
* Rename objective-c files from .c to .mXavier Claessens2018-05-226-12/+23
| | | | | | | | Those files got renamed to .c to work around an automake issue, but Meson needs them to have .m extension. Better rename them at build time in Makefile.am since that's where the workaround is needed. https://bugzilla.gnome.org/show_bug.cgi?id=672777
* gengiotypefuncs.py: Read and parse files in binary modeNirbheek Chauhan2018-05-221-3/+3
| | | | | | | | | | | | | Fixes this build error on macOS when inside an ssh terminal: Traceback (most recent call last): File "[...]/gio/tests/gengiotypefuncs.py", line 23, in <module> for line in f: File "[...]/lib/python3.6/encodings/ascii.py", line 26, in decode return codecs.ascii_decode(input, self.errors)[0] UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 2625: ordinal not in range(128) https://bugzilla.gnome.org/show_bug.cgi?id=796328
* meson: Add exception for atomic ops test for AndroidNirbheek Chauhan2018-05-221-2/+15
| | | | | | | | | | | | Some compilers, particularly Android on armv5 and old versions of Clang provide atomic ops, but don't define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4 so we need to define it ourselves. This matches what configure does, with the exception that now it's only done for Android since clang defines __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4 now. https://bugzilla.gnome.org/show_bug.cgi?id=796325
* build: Remove an unnecessary ‘dnl’ from meson.buildPhilip Withnall2018-05-221-1/+1
| | | | | Signed-off-by: Philip Withnall <withnall@endlessm.com> Reviewed-by: nobody
* build: Migrate G_ATOMIC_LOCK_FREE docs from configure.ac to meson.buildPhilip Withnall2018-05-221-0/+13
| | | | | | | The explanation of how G_ATOMIC_LOCK_FREE is meant to be used is useful. Signed-off-by: Philip Withnall <withnall@endlessm.com> Reviewed-by: nobody
* meson: do not run atomic test with msvcMathieu Duponchelle2018-05-221-1/+3
| | | | | | | | | | | | | | | The latest patches have fixed the atomic check, which uses __sync_bool_compare_and_swap , and thus fails on MSVC. As a result, in gatomic.c, we ended up trying to include pthread.h, which failed. This mimics the old behaviour a bit more closely, where G_ATOMIC_LOCK_FREE was always defined in the win32 glibconfig.h https://bugzilla.gnome.org/show_bug.cgi?id=796220
* meson: Fix checks for posix_memalign and stpcpyNirbheek Chauhan2018-05-211-24/+4
| | | | | | | | | | | | | | | The 'no-builtin' checks were just plain wrong. For accurate detection of functions, use has_function with a header in the prefix. This fixes posix_memalign detection on Android and on MinGW32, MSYS-MinGW-w64, and old versions of MSYS2-MinGW-w64. Using the header in the `prefix:` is generally a good idea because of how macOS does targetting of specific macOS releases at compile time. This also allows cross-files to override the result by setting `has_function_stpcpy = false`, etc in [extra properties] https://bugzilla.gnome.org/show_bug.cgi?id=795876
* Meson: Remove legacy code used to write pc filesXavier Claessens2018-05-201-18/+1
| | | | | | | We are using meson's generator now so those variables are not used anymore. https://bugzilla.gnome.org/show_bug.cgi?id=796264
* meson: Don't skip snprintf/vsnprintf checks under MinGWChristoph Reiter2018-05-181-4/+4
| | | | | | | | | | The comment stated that the test isn't good enough, but it correctly detects a C99 printf when I build with -D__USE_MINGW_ANSI_STDIO=1 and an incompatible printf without it. Using mingw-w64 from current MSYS2. https://bugzilla.gnome.org/show_bug.cgi?id=795569
* docs: Add a note that the printf format macros might not be compatible with ↵Christoph Reiter2018-05-181-0/+6
| | | | | | | | | | | | | system printf() The current docs implied, by using the printf name, that the macros would be compatible with printf(), but that's not always the case. On Windows we use gnulib if the system printf isn't good enough. This can happen on MinGW without __USE_MINGW_ANSI_STDIO set or with MSVC with a varrying degree of incompatibility. https://bugzilla.gnome.org/show_bug.cgi?id=795569
* kqueue: Fix typo that breaks the build in previous commitXavier Claessens2018-05-181-1/+1
|
* kqueue: Fix -Wdeclaration-after-statement errorsXavier Claessens2018-05-181-19/+35
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=796213
* Meson: Add export-dynamic flagXavier Claessens2018-05-172-3/+17
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=788773
* build: Add missing return statements from compiled testsPhilip Withnall2018-05-171-0/+3
| | | | | | | | This could have caused spurious test failures when running with -Werror, due to the missing return statement in int main(). Signed-off-by: Philip Withnall <withnall@endlessm.com> Reviewed-by: nobody
* build: Fix test for G_ATOMIC_LOCK_FREE in meson.buildPhilip Withnall2018-05-171-1/+2
| | | | | | | | | | | | | | | | | | | Commit 3e96523e6b did not entirely fix the test, as the compiled test code did not have a main() function, so failed to link with: /usr/lib/gcc/x86_64-redhat-linux/7/../../../../lib64/crt1.o: In function `_start': (.text+0x20): undefined reference to `main' collect2: error: ld returned 1 exit status This caused an invalid mixtures of builtin and non-builtin atomics/locks to be used, which caused deadlocks in a number of tests. Fix the atomic ops test in meson.build, and the unit tests all start working again. Signed-off-by: Philip Withnall <withnall@endlessm.com> https://bugzilla.gnome.org/show_bug.cgi?id=796164
* docs: Fix typo in gsignal.c documentation commentPhilip Withnall2018-05-171-1/+1
| | | | | | | | Spotted by Morten Welinder <mortenw@gnome.org>. Signed-off-by: Philip Withnall <withnall@endlessm.com> https://bugzilla.gnome.org/show_bug.cgi?id=796186
* Meson: add 'force_posix_threads' optionXavier Claessens2018-05-163-7/+13
| | | | | | | | | This allows building with posix threads on Windows. It is generally better to use win32 threads implementation on Windows, but this option can be used in case it causes issues, or for performance comparison for example. https://bugzilla.gnome.org/show_bug.cgi?id=784995
* Meson: Add missing flags on WindowsXavier Claessens2018-05-162-4/+19
| | | | | | | | | | win32_cflags gets used globally as cflags and exposed in the .pc file. win32_ldflags gets passed to glib-2.0 and exposed in the .pc file. This should match what the autotools build is currently doing with GLIB_EXTRA_CFLAGS and G_LIBS_EXTRA. https://bugzilla.gnome.org/show_bug.cgi?id=784995
* Meson: Remove FIXME about COCOA_LIBS and CARBON_LIBSXavier Claessens2018-05-161-4/+2
| | | | | | | They are already handled properly by osx_ldflags. As far as I can tell it does the same as with autotools. https://bugzilla.gnome.org/show_bug.cgi?id=784995
* gio: Add g_unix_mount_get_optionsOndrej Holy2018-05-163-0/+40
| | | | | | | | | | | | | | | GVfsUDisks2VolumeMonitor handles x-gvfs-hide/x-gvfs-show mount options used to overwrite our heuristics whether the mount should be shown, or hidden. Unfortunately, it works currently only for mounts with corresponding fstab entries, because the options are read over g_unix_mount_point_get_options. Let's introduce g_unix_mount_get_options to allow reading of the options for all sort of mounts (e.g. created over pam_mount, or manually mounted). (Minor fixes to the documentation by Philip Withnall <withnall@endlessm.com>.) https://bugzilla.gnome.org/show_bug.cgi?id=668132
* gtimezone: Fix two minor leaks in zone_info_unix()Philip Withnall2018-05-161-4/+7
| | | | | | | | | | | | | • A leak of filename on an error path • A leak of resolved_identifier if no out_identifier return location was provided The latter was spotted by Peter Bloomfield (https://gitlab.gnome.org/GNOME/glib/commit/8945227743a26a4fe6966baaf082dd6516e8a03c#note_111254). Thanks! Signed-off-by: Philip Withnall <withnall@endlessm.com> Reviewed-by: nobody
* gwin32: Fix detection of MinGW32 vs MinGW-w64Nirbheek Chauhan2018-05-161-2/+2
| | | | | | | | | | | | __MINGW32__ is defined on all MinGW variants including MinGW-w64. __MINGW64_VERSION_MAJOR is only defined on MinGW-w64. This difference is important because on MinGW-w64 we must #include winternl.h because including ntdef.h results in compiler errors about symbol redefinition, and the header warns that it is deprecated and may be removed in the future. https://bugzilla.gnome.org/show_bug.cgi?id=795849
* meson: Fix error message for iconv detectionNirbheek Chauhan2018-05-161-1/+1
|
* Meson: libintl is a public dependency of glib-2.0Xavier Claessens2018-05-154-16/+15
| | | | | | | | | | On non-glibc platforms gettext is provided by extra libintl dependency. We wrongly thought libintl is an internal dependency and applications needs to explicitly link on it, but turns out that breaks many applications and with autotools the .pc generated actually has -lintl in public "Libs:". https://bugzilla.gnome.org/show_bug.cgi?id=796085
* gobject: Add g_autoptr() support for GTypeClass, GEnumClass, GFlagsClassPhilip Withnall2018-05-151-0/+3
| | | | | | Signed-off-by: Philip Withnall <withnall@endlessm.com> https://bugzilla.gnome.org/show_bug.cgi?id=789968
* gobject: Add g_autoptr() support for GParamSpecPhilip Withnall2018-05-151-0/+1
| | | | | | | | | | | | Do not add support for its subtypes, since all their constructors return GParamSpec*, and g_param_spec_unref() takes a GParamSpec* rather than a gpointer — adding G_DEFINE_AUTOPTR_CLEANUP_FUNC() for subtypes of GParamSpec results in compiler warnings about mismatched parameter types (GParamSpecBoolean* vs GParamSpec*, for example). Signed-off-by: Philip Withnall <withnall@endlessm.com> https://bugzilla.gnome.org/show_bug.cgi?id=796139
* gio: Fix typo in g_file_info_set_attribute docsOndrej Holy2018-05-151-1/+1
| | | | | | | g_file_info_set_attribute mentions %G_ATTRIBUTE_TYPE_INVALID, but no such value exists. It should be %G_FILE_ATTRIBUTE_TYPE_INVALID. https://bugzilla.gnome.org/show_bug.cgi?id=796138
* gqueue: Document to use GAsyncQueue for thread-safe queuingPhilip Withnall2018-05-151-0/+3
| | | | | Signed-off-by: Philip Withnall <withnall@endlessm.com> Reviewed-by: nobody
* Update Indonesian translationKukuh Syafaat2018-05-121-183/+190
|
* xdgmime: Add better detection for text vs. binary and zero-sized filesDavid Faure2018-05-105-7/+42
| | | | | | | | | | | | | This detects zero-sized files to return the special-case "application/x-zerosize" mime-type, as well as trying to differentiate unknown file types based on their first 128 bytes of data, so that text editors can automatically handle unknown text files. Based on: https://cgit.freedesktop.org/xdg/xdgmime/commit/?id=5181175d5fdaa3832b0fd094cda0120b1fe92af6 https://cgit.freedesktop.org/xdg/xdgmime/commit/?id=9c5802b8da56187c5c6abaf70042d14b12d832a9 https://bugzilla.gnome.org/show_bug.cgi?id=795544
* garray: Add g_ptr_array_steal_index*() functionsPhilip Withnall2018-05-093-4/+107
| | | | | | | | | | These make it easy to steal elements from pointer arrays without having the array’s GDestroyNotify called on them, similarly to what’s possible with g_hash_table_steal(). Signed-off-by: Philip Withnall <withnall@endlessm.com> https://bugzilla.gnome.org/show_bug.cgi?id=795376
* garray: Document that return value of g_ptr_array_remove() may be junkPhilip Withnall2018-05-091-4/+7
| | | | | | | | | | | | | | | | If using g_ptr_array_remove*() with a non-NULL GDestroyNotify function, the value returned will probably be freed memory (depending on what the GDestroyNotify) function actually does. Warn about that in the documentation. We can’t just unconditionally return NULL in these cases, though, since the user might have set the GDestroyNotify to a nifty function which doesn’t actually free the element; so returning it might still be valid and useful. Also add missing (nullable) annotations to that documentation. Signed-off-by: Philip Withnall <withnall@endlessm.com> https://bugzilla.gnome.org/show_bug.cgi?id=795376
* garray: Factor out implementation of g_ptr_array_remove_index*()Philip Withnall2018-05-091-41/+30
| | | | | | | | | They were almost identically the same. This introduces no functional changes, but will help with upcoming additions to GPtrArray. Signed-off-by: Philip Withnall <withnall@endlessm.com> https://bugzilla.gnome.org/show_bug.cgi?id=795376