index
:
riscv-gnu-toolchain/gdb.git
FSF
add-fakeroots-dir
arc-20081103-branch
arc-insight_6_8-branch
binutils-2_10-branch
binutils-2_11-branch
binutils-2_12-branch
binutils-2_13-branch
binutils-2_14-branch
binutils-2_15-branch
binutils-2_16-branch
binutils-2_17-branch
binutils-2_18-branch
binutils-2_19-branch
binutils-2_20-branch
binutils-2_21-branch
binutils-2_22-branch
binutils-2_22_branch
binutils-2_23-branch
binutils-2_24-branch
binutils-2_25-branch
binutils-2_26-branch
binutils-2_27-branch
binutils-2_28-branch
binutils-2_29-branch
binutils-2_30-branch
binutils-2_31-branch
binutils-2_32-branch
binutils-2_33-branch
binutils-2_34-branch
binutils-2_35-branch
binutils-2_36-branch
binutils-2_37-branch
binutils-2_38-branch
binutils-2_39-branch
binutils-2_40-branch
binutils-2_41-branch
binutils-2_41-release-point
binutils-2_42-branch
binutils-2_43-branch
binutils-arc-20080908-branch
binutils-arc-20081103-branch
binutils-csl-2_17-branch
binutils-csl-arm-2005q1-branch
binutils-csl-gxxpro-3_4-branch
cagney-unwind-20030108-branch
cagney_bfdfile-20040213-branch
cagney_bigcore-20040122-branch
cagney_convert-20030606-branch
cagney_fileio-20030521-branch
cagney_frameaddr-20030403-branch
cagney_framebase-20030326-branch
cagney_lazyid-20030317-branch
cagney_offbyone-20030303-branch
cagney_regbuf-20020515-branch
cagney_sysregs-20020825-branch
cagney_tramp-20040309-branch
cagney_writestrings-20030508-branch
cagney_x86i386-20030821-branch
carlton_dictionary-branch
cgen-1_1-branch
cr-0x5f1
csl-arm-20050325-branch
cygnus
cygwin-64bit-branch
cygwin-64bit-premerge-branch
dberlin-typesystem-branch
dje-cgen-play1-branch
drow-cplus-branch
drow-reverse-20070409-branch
drow_intercu-20040221-branch
ezannoni_pie-20030916-branch
ezannoni_pie-20040323-branch
gdb-10-branch
gdb-11-branch
gdb-12-branch
gdb-13-branch
gdb-14-branch
gdb-15-branch
gdb-16-branch
gdb-4_18-branch
gdb-7.10-branch
gdb-7.11-branch
gdb-7.12-branch
gdb-7.7-branch
gdb-7.8-branch
gdb-7.9-branch
gdb-8.0-branch
gdb-8.1-branch
gdb-8.2-branch
gdb-8.3-branch
gdb-9-branch
gdb-csl-20060226-branch
gdb-csl-arm-20051020-branch
gdb-csl-available-20060303-branch
gdb-csl-gxxpro-6_3-branch
gdb-csl-symbian-20060226-branch
gdb-premipsmulti-2000-06-06-branch
gdb_5_0-2000-04-10-branch
gdb_5_1-2001-07-29-branch
gdb_5_1_0_1-2002-01-03-branch
gdb_5_2-branch
gdb_5_3-branch
gdb_6_0-branch
gdb_6_1-branch
gdb_6_2-branch
gdb_6_3-branch
gdb_6_4-branch
gdb_6_5-branch
gdb_6_6-branch
gdb_6_7-branch
gdb_6_8-branch
* Paolo Bonzini <pbonzini@redhat.com>
*
* This work is licensed under the terms of the GNU GPL, version 2 or later.
* See the COPYING file in the top-level directory.
*
*/
#ifndef QEMU_GLIB_COMPAT_H
#define QEMU_GLIB_COMPAT_H
/* Ask for warnings for anything that was marked deprecated in
* the defined version, or before. It is a candidate for rewrite.
*/
#define GLIB_VERSION_MIN_REQUIRED GLIB_VERSION_2_48
/* Ask for warnings if code tries to use function that did not
* exist in the defined version. These risk breaking builds
*/
#define GLIB_VERSION_MAX_ALLOWED GLIB_VERSION_2_48
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored
"-Wdeprecated-declarations"
#include <glib.h>
/*
* Note that because of the GLIB_VERSION_MAX_ALLOWED constant above, allowing
* use of functions from newer GLib via this compat header needs a little
* trickery to prevent warnings being emitted.
*
* Consider a function from newer glib-X.Y that we want to use
*
* int g_foo(const char *wibble)
*
* We must define a static inline function with the same signature that does
* what we need, but with a "_qemu" suffix e.g.
*
* static inline void g_foo_qemu(const char *wibble)
* {
* #if GLIB_CHECK_VERSION(X, Y, 0)
* g_foo(wibble)
* #else
* g_something_equivalent_in_older_glib(wibble);
* #endif
* }
*
* The #pragma at the top of this file turns off -Wdeprecated-declarations,
* ensuring this wrapper function impl doesn't trigger the compiler warning
* about using too new glib APIs. Finally we can do
*
* #define g_foo(a) g_foo_qemu(a)
*
* So now the code elsewhere in QEMU, which *does* have the
* -Wdeprecated-declarations warning active, can call g_foo(...) as normal,
* without generating warnings.
*/
#if defined(_WIN32) && !GLIB_CHECK_VERSION(2, 50, 0)
/*
* g_poll has a problem on Windows when using
* timeouts < 10ms, so use wrapper.
*/
#define g_poll(fds, nfds, timeout) g_poll_fixed(fds, nfds, timeout)
gint
g_poll_fixed
(
GPollFD
*
fds
,
guint nfds
,
gint timeout
);
#endif
#pragma GCC diagnostic pop
#endif