glnx-backports.h (flatpak-1.15.1.tar.xz) | : | glnx-backports.h (flatpak-1.15.2.tar.xz) | ||
---|---|---|---|---|
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- | /* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- | |||
* | * | |||
* Copyright 1998 Manish Singh | ||||
* Copyright 1998 Tim Janik | ||||
* Copyright (C) 2015 Colin Walters <walters@verbum.org> | * Copyright (C) 2015 Colin Walters <walters@verbum.org> | |||
* Copyright 2017 Emmanuele Bassi | * Copyright 2017 Emmanuele Bassi | |||
* SPDX-License-Identifier: LGPL-2.0-or-later | * SPDX-License-Identifier: LGPL-2.1-or-later | |||
* | * | |||
* GLIB - Library of useful routines for C programming | * GLIB - Library of useful routines for C programming | |||
* Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald | * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald | |||
* | * | |||
* This library is free software; you can redistribute it and/or | * This library is free software; you can redistribute it and/or | |||
* modify it under the terms of the GNU Lesser General Public | * modify it under the terms of the GNU Lesser General Public | |||
* License as published by the Free Software Foundation; either | * License as published by the Free Software Foundation; either | |||
* version 2 of the License, or (at your option) any later version. | * version 2.1 of the License, or (at your option) any later version. | |||
* | * | |||
* This library is distributed in the hope that it will be useful, | * This library is distributed in the hope that it will be useful, | |||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |||
* Lesser General Public License for more details. | * Lesser General Public License for more details. | |||
* | * | |||
* You should have received a copy of the GNU Lesser General Public | * You should have received a copy of the GNU Lesser General Public | |||
* License along with this library; if not, write to the | * License along with this library; if not, see <http://www.gnu.org/licenses/>. | |||
* Free Software Foundation, Inc., 59 Temple Place - Suite 330, | ||||
* Boston, MA 02111-1307, USA. | ||||
*/ | */ | |||
#pragma once | #pragma once | |||
#include <string.h> | ||||
#include <gio/gio.h> | #include <gio/gio.h> | |||
G_BEGIN_DECLS | G_BEGIN_DECLS | |||
#if !GLIB_CHECK_VERSION(2, 34, 0) | #if !GLIB_CHECK_VERSION(2, 34, 0) | |||
#define g_clear_pointer(pp, destroy) \ | #define g_clear_pointer(pp, destroy) \ | |||
G_STMT_START { \ | G_STMT_START { \ | |||
G_STATIC_ASSERT (sizeof *(pp) == sizeof (gpointer)); \ | G_STATIC_ASSERT (sizeof *(pp) == sizeof (gpointer)); \ | |||
/* Only one access, please; work around type aliasing */ \ | /* Only one access, please; work around type aliasing */ \ | |||
union { char *in; gpointer *out; } _pp; \ | union { char *in; gpointer *out; } _pp; \ | |||
skipping to change at line 88 | skipping to change at line 90 | |||
#endif | #endif | |||
#ifndef G_DBUS_METHOD_INVOCATION_HANDLED /* added in 2.68 */ | #ifndef G_DBUS_METHOD_INVOCATION_HANDLED /* added in 2.68 */ | |||
#define G_DBUS_METHOD_INVOCATION_HANDLED TRUE | #define G_DBUS_METHOD_INVOCATION_HANDLED TRUE | |||
#endif | #endif | |||
#ifndef G_DBUS_METHOD_INVOCATION_UNHANDLED /* added in 2.68 */ | #ifndef G_DBUS_METHOD_INVOCATION_UNHANDLED /* added in 2.68 */ | |||
#define G_DBUS_METHOD_INVOCATION_UNHANDLED FALSE | #define G_DBUS_METHOD_INVOCATION_UNHANDLED FALSE | |||
#endif | #endif | |||
#if !GLIB_CHECK_VERSION(2, 68, 0) | ||||
static inline gpointer _glnx_memdup2 (gconstpointer mem, | ||||
gsize byte_size) G_GNUC_ALLOC_SIZE | ||||
(2); | ||||
static inline gpointer | ||||
_glnx_memdup2 (gconstpointer mem, | ||||
gsize byte_size) | ||||
{ | ||||
gpointer new_mem; | ||||
if (mem && byte_size != 0) | ||||
{ | ||||
new_mem = g_malloc (byte_size); | ||||
memcpy (new_mem, mem, byte_size); | ||||
} | ||||
else | ||||
new_mem = NULL; | ||||
return new_mem; | ||||
} | ||||
#define g_memdup2 _glnx_memdup2 | ||||
#endif | ||||
#ifndef G_OPTION_ENTRY_NULL /* added in 2.70 */ | #ifndef G_OPTION_ENTRY_NULL /* added in 2.70 */ | |||
#define G_OPTION_ENTRY_NULL { NULL, 0, 0, 0, NULL, NULL, NULL } | #define G_OPTION_ENTRY_NULL { NULL, 0, 0, 0, NULL, NULL, NULL } | |||
#endif | #endif | |||
#ifndef G_APPROX_VALUE /* added in 2.58 */ | #ifndef G_APPROX_VALUE /* added in 2.58 */ | |||
#define G_APPROX_VALUE(a, b, epsilon) \ | #define G_APPROX_VALUE(a, b, epsilon) \ | |||
(((a) > (b) ? (a) - (b) : (b) - (a)) < (epsilon)) | (((a) > (b) ? (a) - (b) : (b) - (a)) < (epsilon)) | |||
#endif | #endif | |||
#if !GLIB_CHECK_VERSION(2, 74, 0) | #if !GLIB_CHECK_VERSION(2, 74, 0) | |||
End of changes. 6 change blocks. | ||||
5 lines changed or deleted | 30 lines changed or added |