Commit Graph

7 Commits

Author SHA1 Message Date
Simon McVittie
81c6adb0f7 Declare copyright and licensing using REUSE
To fill in some gaps, I've had to make some assumptions:

* trivial changes (such as checking for an additional function or
  header file in libglnx.m4) are assumed to not be copyrightable
* Will Thompson and Matthew Leeds are assumed to be contributing on
  behalf of Endless Mobile Inc.
* files with no explicit licensing information are assumed to be
  under the license found in COPYING

Reference: https://reuse.software/
Signed-off-by: Simon McVittie <smcv@debian.org>
2022-02-19 22:57:48 +00:00
Simon McVittie
c306703c6f Include libglnx-config.h instead of config.h
This avoids colliding with a config.h generated by a parent Meson
project.

In the Meson build system, we generate libglnx-config.h by doing our
own checks, so we want to avoid it colliding.

In the Autotools build system, we assume that the parent project will
generate its own config.h that contains the results of LIBGLNX_CONFIGURE,
and create a forwarding header libglnx-config.h in the $(top_builddir)
(so that it is next to config.h).

Note that after updating libglnx in an Autotools non-recursive-Make
project (libostree, flatpak, flatpak-builder) it will be necessary to
re-run autogen.sh.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2021-06-28 15:53:32 +01:00
Will Thompson
016ea9168b errors: don't use 'static inline' on varargs functions
This caused GCC 6.3.0 -Winline to complain:

    ../../../ext/libglnx/glnx-errors.h:169:1: warning: function
        ‘glnx_throw_errno_prefix’ can never be inlined because it uses
        variable argument lists [-Winline]
     glnx_throw_errno_prefix (GError **error, const char *fmt, ...)
     ^~~~~~~~~~~~~~~~~~~~~~~
    ../../../ext/libglnx/glnx-errors.h:169:1: warning: inlining failed
        in call to ‘glnx_throw_errno_prefix’: function not inlinable
        [-Winline]
2017-11-02 17:14:06 +00:00
Jonathan Lebon
32231fdb52 glnx-errors.h: add a glnx_throw_prefix() variant
For completeness. It just looks much cleaner than doing the `, FALSE`
trick. It also takes care of appending the ': ' for you like its errno
version.
2017-05-11 12:34:02 -04:00
Colin Walters
074236b88d errors: Add new glnx_throw_errno{,_prefix}() APIs
We have a *lot* of code of the form:

```
if (unlinkat (fd, pathname) < 0)
  {
     glnx_set_error_from_errno (error);
     goto out;
  }
```

After conversion to `return FALSE style` which is in progress, it's way shorter,
and clearer like this:

```
if (unlinkat (fd, pathname) < 0)
  return glnx_throw_errno (error);
```
2017-03-22 11:03:32 -04:00
Matthew Barnes
fa43744c05 Fix includes when relying on backported g_autoptr() 2015-02-18 16:45:45 -05:00
Colin Walters
8e9a171ec4 Import directory iteration, errno handling, and shutil from libgsystem 2015-02-15 11:53:34 -05:00