Split glib.h into many header files mostly according to the resp.
2000-10-12 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
* glib.h, galloca.h, garray.h, gasyncqueue.h, gbacktrace.h,
gcache.h, gcompletion.h, gconvert.h, gdataset.h, gdate.h, ghash.h,
ghook.h, giochannel.h, glist.h , gmacros.h, gmain.h, gmem.h,
gmessages.h, gnode.h, gprimes.h, gquark.h, gqueue.h, grand.h,
grel.h, gscanner.h, gslist.h, gstrfuncs.h, gstring.h, gthread.h,
gthreadpool.h, gtimer.h, gtree.h, gtypes.h, gutils.h: Split glib.h
into many header files mostly according to the resp. *.c-files.
* gmacros.h: Added G_BEGIN_DECLS and G_END_DECLS to mean: 'in case
of C++: extern "C" { ... }' analogous to glibc __BEGIN_DECLS and
__END_DECLS.
* configure.in, gerror.h, gfileutils.h, gshell.h, gspawn.h,
gunicode.h, : Changed guard-macro names to something more
consistent.
* configure.in, *.h: Use G_BEGIN_DECLS and G_END_DECLS.
2000-10-12 13:52:07 +02:00
|
|
|
/* GLIB - Library of useful routines for C programming
|
|
|
|
* Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the
|
|
|
|
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
|
|
|
* Boston, MA 02111-1307, USA.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Modified by the GLib Team and others 1997-2000. See the AUTHORS
|
|
|
|
* file for a list of people on the GLib Team. See the ChangeLog
|
|
|
|
* files for a list of changes. These files are distributed with
|
2008-03-14 20:30:38 +01:00
|
|
|
* GLib at ftp://ftp.gtk.org/pub/gtk/.
|
Split glib.h into many header files mostly according to the resp.
2000-10-12 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
* glib.h, galloca.h, garray.h, gasyncqueue.h, gbacktrace.h,
gcache.h, gcompletion.h, gconvert.h, gdataset.h, gdate.h, ghash.h,
ghook.h, giochannel.h, glist.h , gmacros.h, gmain.h, gmem.h,
gmessages.h, gnode.h, gprimes.h, gquark.h, gqueue.h, grand.h,
grel.h, gscanner.h, gslist.h, gstrfuncs.h, gstring.h, gthread.h,
gthreadpool.h, gtimer.h, gtree.h, gtypes.h, gutils.h: Split glib.h
into many header files mostly according to the resp. *.c-files.
* gmacros.h: Added G_BEGIN_DECLS and G_END_DECLS to mean: 'in case
of C++: extern "C" { ... }' analogous to glibc __BEGIN_DECLS and
__END_DECLS.
* configure.in, gerror.h, gfileutils.h, gshell.h, gspawn.h,
gunicode.h, : Changed guard-macro names to something more
consistent.
* configure.in, *.h: Use G_BEGIN_DECLS and G_END_DECLS.
2000-10-12 13:52:07 +02:00
|
|
|
*/
|
|
|
|
|
|
|
|
/* This file must not include any other glib header file and must thus
|
2008-03-14 20:30:38 +01:00
|
|
|
* not refer to variables from glibconfig.h
|
Split glib.h into many header files mostly according to the resp.
2000-10-12 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
* glib.h, galloca.h, garray.h, gasyncqueue.h, gbacktrace.h,
gcache.h, gcompletion.h, gconvert.h, gdataset.h, gdate.h, ghash.h,
ghook.h, giochannel.h, glist.h , gmacros.h, gmain.h, gmem.h,
gmessages.h, gnode.h, gprimes.h, gquark.h, gqueue.h, grand.h,
grel.h, gscanner.h, gslist.h, gstrfuncs.h, gstring.h, gthread.h,
gthreadpool.h, gtimer.h, gtree.h, gtypes.h, gutils.h: Split glib.h
into many header files mostly according to the resp. *.c-files.
* gmacros.h: Added G_BEGIN_DECLS and G_END_DECLS to mean: 'in case
of C++: extern "C" { ... }' analogous to glibc __BEGIN_DECLS and
__END_DECLS.
* configure.in, gerror.h, gfileutils.h, gshell.h, gspawn.h,
gunicode.h, : Changed guard-macro names to something more
consistent.
* configure.in, *.h: Use G_BEGIN_DECLS and G_END_DECLS.
2000-10-12 13:52:07 +02:00
|
|
|
*/
|
|
|
|
|
2011-10-12 06:24:46 +02:00
|
|
|
#if !defined (__GLIB_H_INSIDE__) && !defined (GLIB_COMPILATION)
|
2008-03-14 20:30:38 +01:00
|
|
|
#error "Only <glib.h> can be included directly."
|
|
|
|
#endif
|
|
|
|
|
Split glib.h into many header files mostly according to the resp.
2000-10-12 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
* glib.h, galloca.h, garray.h, gasyncqueue.h, gbacktrace.h,
gcache.h, gcompletion.h, gconvert.h, gdataset.h, gdate.h, ghash.h,
ghook.h, giochannel.h, glist.h , gmacros.h, gmain.h, gmem.h,
gmessages.h, gnode.h, gprimes.h, gquark.h, gqueue.h, grand.h,
grel.h, gscanner.h, gslist.h, gstrfuncs.h, gstring.h, gthread.h,
gthreadpool.h, gtimer.h, gtree.h, gtypes.h, gutils.h: Split glib.h
into many header files mostly according to the resp. *.c-files.
* gmacros.h: Added G_BEGIN_DECLS and G_END_DECLS to mean: 'in case
of C++: extern "C" { ... }' analogous to glibc __BEGIN_DECLS and
__END_DECLS.
* configure.in, gerror.h, gfileutils.h, gshell.h, gspawn.h,
gunicode.h, : Changed guard-macro names to something more
consistent.
* configure.in, *.h: Use G_BEGIN_DECLS and G_END_DECLS.
2000-10-12 13:52:07 +02:00
|
|
|
#ifndef __G_MACROS_H__
|
|
|
|
#define __G_MACROS_H__
|
|
|
|
|
2001-08-05 14:37:37 +02:00
|
|
|
/* We include stddef.h to get the system's definition of NULL
|
|
|
|
*/
|
|
|
|
#include <stddef.h>
|
|
|
|
|
Split glib.h into many header files mostly according to the resp.
2000-10-12 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
* glib.h, galloca.h, garray.h, gasyncqueue.h, gbacktrace.h,
gcache.h, gcompletion.h, gconvert.h, gdataset.h, gdate.h, ghash.h,
ghook.h, giochannel.h, glist.h , gmacros.h, gmain.h, gmem.h,
gmessages.h, gnode.h, gprimes.h, gquark.h, gqueue.h, grand.h,
grel.h, gscanner.h, gslist.h, gstrfuncs.h, gstring.h, gthread.h,
gthreadpool.h, gtimer.h, gtree.h, gtypes.h, gutils.h: Split glib.h
into many header files mostly according to the resp. *.c-files.
* gmacros.h: Added G_BEGIN_DECLS and G_END_DECLS to mean: 'in case
of C++: extern "C" { ... }' analogous to glibc __BEGIN_DECLS and
__END_DECLS.
* configure.in, gerror.h, gfileutils.h, gshell.h, gspawn.h,
gunicode.h, : Changed guard-macro names to something more
consistent.
* configure.in, *.h: Use G_BEGIN_DECLS and G_END_DECLS.
2000-10-12 13:52:07 +02:00
|
|
|
/* Here we provide G_GNUC_EXTENSION as an alias for __extension__,
|
|
|
|
* where this is valid. This allows for warningless compilation of
|
|
|
|
* "long long" types even in the presence of '-ansi -pedantic'.
|
|
|
|
*/
|
|
|
|
#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 8)
|
|
|
|
# define G_GNUC_EXTENSION __extension__
|
|
|
|
#else
|
|
|
|
# define G_GNUC_EXTENSION
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/* Provide macros to feature the GCC function attribute.
|
|
|
|
*/
|
|
|
|
#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96)
|
|
|
|
#define G_GNUC_PURE \
|
2001-12-06 23:58:58 +01:00
|
|
|
__attribute__((__pure__))
|
2004-11-29 15:50:47 +01:00
|
|
|
#define G_GNUC_MALLOC \
|
|
|
|
__attribute__((__malloc__))
|
Split glib.h into many header files mostly according to the resp.
2000-10-12 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
* glib.h, galloca.h, garray.h, gasyncqueue.h, gbacktrace.h,
gcache.h, gcompletion.h, gconvert.h, gdataset.h, gdate.h, ghash.h,
ghook.h, giochannel.h, glist.h , gmacros.h, gmain.h, gmem.h,
gmessages.h, gnode.h, gprimes.h, gquark.h, gqueue.h, grand.h,
grel.h, gscanner.h, gslist.h, gstrfuncs.h, gstring.h, gthread.h,
gthreadpool.h, gtimer.h, gtree.h, gtypes.h, gutils.h: Split glib.h
into many header files mostly according to the resp. *.c-files.
* gmacros.h: Added G_BEGIN_DECLS and G_END_DECLS to mean: 'in case
of C++: extern "C" { ... }' analogous to glibc __BEGIN_DECLS and
__END_DECLS.
* configure.in, gerror.h, gfileutils.h, gshell.h, gspawn.h,
gunicode.h, : Changed guard-macro names to something more
consistent.
* configure.in, *.h: Use G_BEGIN_DECLS and G_END_DECLS.
2000-10-12 13:52:07 +02:00
|
|
|
#else
|
|
|
|
#define G_GNUC_PURE
|
2004-11-29 15:50:47 +01:00
|
|
|
#define G_GNUC_MALLOC
|
Split glib.h into many header files mostly according to the resp.
2000-10-12 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
* glib.h, galloca.h, garray.h, gasyncqueue.h, gbacktrace.h,
gcache.h, gcompletion.h, gconvert.h, gdataset.h, gdate.h, ghash.h,
ghook.h, giochannel.h, glist.h , gmacros.h, gmain.h, gmem.h,
gmessages.h, gnode.h, gprimes.h, gquark.h, gqueue.h, grand.h,
grel.h, gscanner.h, gslist.h, gstrfuncs.h, gstring.h, gthread.h,
gthreadpool.h, gtimer.h, gtree.h, gtypes.h, gutils.h: Split glib.h
into many header files mostly according to the resp. *.c-files.
* gmacros.h: Added G_BEGIN_DECLS and G_END_DECLS to mean: 'in case
of C++: extern "C" { ... }' analogous to glibc __BEGIN_DECLS and
__END_DECLS.
* configure.in, gerror.h, gfileutils.h, gshell.h, gspawn.h,
gunicode.h, : Changed guard-macro names to something more
consistent.
* configure.in, *.h: Use G_BEGIN_DECLS and G_END_DECLS.
2000-10-12 13:52:07 +02:00
|
|
|
#endif
|
|
|
|
|
2005-03-08 06:41:45 +01:00
|
|
|
#if __GNUC__ >= 4
|
|
|
|
#define G_GNUC_NULL_TERMINATED __attribute__((__sentinel__))
|
|
|
|
#else
|
|
|
|
#define G_GNUC_NULL_TERMINATED
|
|
|
|
#endif
|
|
|
|
|
2008-03-31 06:17:22 +02:00
|
|
|
#if (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)
|
|
|
|
#define G_GNUC_ALLOC_SIZE(x) __attribute__((__alloc_size__(x)))
|
|
|
|
#define G_GNUC_ALLOC_SIZE2(x,y) __attribute__((__alloc_size__(x,y)))
|
|
|
|
#else
|
|
|
|
#define G_GNUC_ALLOC_SIZE(x)
|
|
|
|
#define G_GNUC_ALLOC_SIZE2(x,y)
|
|
|
|
#endif
|
|
|
|
|
Split glib.h into many header files mostly according to the resp.
2000-10-12 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
* glib.h, galloca.h, garray.h, gasyncqueue.h, gbacktrace.h,
gcache.h, gcompletion.h, gconvert.h, gdataset.h, gdate.h, ghash.h,
ghook.h, giochannel.h, glist.h , gmacros.h, gmain.h, gmem.h,
gmessages.h, gnode.h, gprimes.h, gquark.h, gqueue.h, grand.h,
grel.h, gscanner.h, gslist.h, gstrfuncs.h, gstring.h, gthread.h,
gthreadpool.h, gtimer.h, gtree.h, gtypes.h, gutils.h: Split glib.h
into many header files mostly according to the resp. *.c-files.
* gmacros.h: Added G_BEGIN_DECLS and G_END_DECLS to mean: 'in case
of C++: extern "C" { ... }' analogous to glibc __BEGIN_DECLS and
__END_DECLS.
* configure.in, gerror.h, gfileutils.h, gshell.h, gspawn.h,
gunicode.h, : Changed guard-macro names to something more
consistent.
* configure.in, *.h: Use G_BEGIN_DECLS and G_END_DECLS.
2000-10-12 13:52:07 +02:00
|
|
|
#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ > 4)
|
|
|
|
#define G_GNUC_PRINTF( format_idx, arg_idx ) \
|
2001-12-06 23:37:05 +01:00
|
|
|
__attribute__((__format__ (__printf__, format_idx, arg_idx)))
|
Split glib.h into many header files mostly according to the resp.
2000-10-12 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
* glib.h, galloca.h, garray.h, gasyncqueue.h, gbacktrace.h,
gcache.h, gcompletion.h, gconvert.h, gdataset.h, gdate.h, ghash.h,
ghook.h, giochannel.h, glist.h , gmacros.h, gmain.h, gmem.h,
gmessages.h, gnode.h, gprimes.h, gquark.h, gqueue.h, grand.h,
grel.h, gscanner.h, gslist.h, gstrfuncs.h, gstring.h, gthread.h,
gthreadpool.h, gtimer.h, gtree.h, gtypes.h, gutils.h: Split glib.h
into many header files mostly according to the resp. *.c-files.
* gmacros.h: Added G_BEGIN_DECLS and G_END_DECLS to mean: 'in case
of C++: extern "C" { ... }' analogous to glibc __BEGIN_DECLS and
__END_DECLS.
* configure.in, gerror.h, gfileutils.h, gshell.h, gspawn.h,
gunicode.h, : Changed guard-macro names to something more
consistent.
* configure.in, *.h: Use G_BEGIN_DECLS and G_END_DECLS.
2000-10-12 13:52:07 +02:00
|
|
|
#define G_GNUC_SCANF( format_idx, arg_idx ) \
|
2001-12-06 23:37:05 +01:00
|
|
|
__attribute__((__format__ (__scanf__, format_idx, arg_idx)))
|
Split glib.h into many header files mostly according to the resp.
2000-10-12 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
* glib.h, galloca.h, garray.h, gasyncqueue.h, gbacktrace.h,
gcache.h, gcompletion.h, gconvert.h, gdataset.h, gdate.h, ghash.h,
ghook.h, giochannel.h, glist.h , gmacros.h, gmain.h, gmem.h,
gmessages.h, gnode.h, gprimes.h, gquark.h, gqueue.h, grand.h,
grel.h, gscanner.h, gslist.h, gstrfuncs.h, gstring.h, gthread.h,
gthreadpool.h, gtimer.h, gtree.h, gtypes.h, gutils.h: Split glib.h
into many header files mostly according to the resp. *.c-files.
* gmacros.h: Added G_BEGIN_DECLS and G_END_DECLS to mean: 'in case
of C++: extern "C" { ... }' analogous to glibc __BEGIN_DECLS and
__END_DECLS.
* configure.in, gerror.h, gfileutils.h, gshell.h, gspawn.h,
gunicode.h, : Changed guard-macro names to something more
consistent.
* configure.in, *.h: Use G_BEGIN_DECLS and G_END_DECLS.
2000-10-12 13:52:07 +02:00
|
|
|
#define G_GNUC_FORMAT( arg_idx ) \
|
2001-12-06 23:37:05 +01:00
|
|
|
__attribute__((__format_arg__ (arg_idx)))
|
Split glib.h into many header files mostly according to the resp.
2000-10-12 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
* glib.h, galloca.h, garray.h, gasyncqueue.h, gbacktrace.h,
gcache.h, gcompletion.h, gconvert.h, gdataset.h, gdate.h, ghash.h,
ghook.h, giochannel.h, glist.h , gmacros.h, gmain.h, gmem.h,
gmessages.h, gnode.h, gprimes.h, gquark.h, gqueue.h, grand.h,
grel.h, gscanner.h, gslist.h, gstrfuncs.h, gstring.h, gthread.h,
gthreadpool.h, gtimer.h, gtree.h, gtypes.h, gutils.h: Split glib.h
into many header files mostly according to the resp. *.c-files.
* gmacros.h: Added G_BEGIN_DECLS and G_END_DECLS to mean: 'in case
of C++: extern "C" { ... }' analogous to glibc __BEGIN_DECLS and
__END_DECLS.
* configure.in, gerror.h, gfileutils.h, gshell.h, gspawn.h,
gunicode.h, : Changed guard-macro names to something more
consistent.
* configure.in, *.h: Use G_BEGIN_DECLS and G_END_DECLS.
2000-10-12 13:52:07 +02:00
|
|
|
#define G_GNUC_NORETURN \
|
2001-12-06 23:37:05 +01:00
|
|
|
__attribute__((__noreturn__))
|
Split glib.h into many header files mostly according to the resp.
2000-10-12 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
* glib.h, galloca.h, garray.h, gasyncqueue.h, gbacktrace.h,
gcache.h, gcompletion.h, gconvert.h, gdataset.h, gdate.h, ghash.h,
ghook.h, giochannel.h, glist.h , gmacros.h, gmain.h, gmem.h,
gmessages.h, gnode.h, gprimes.h, gquark.h, gqueue.h, grand.h,
grel.h, gscanner.h, gslist.h, gstrfuncs.h, gstring.h, gthread.h,
gthreadpool.h, gtimer.h, gtree.h, gtypes.h, gutils.h: Split glib.h
into many header files mostly according to the resp. *.c-files.
* gmacros.h: Added G_BEGIN_DECLS and G_END_DECLS to mean: 'in case
of C++: extern "C" { ... }' analogous to glibc __BEGIN_DECLS and
__END_DECLS.
* configure.in, gerror.h, gfileutils.h, gshell.h, gspawn.h,
gunicode.h, : Changed guard-macro names to something more
consistent.
* configure.in, *.h: Use G_BEGIN_DECLS and G_END_DECLS.
2000-10-12 13:52:07 +02:00
|
|
|
#define G_GNUC_CONST \
|
2001-12-06 23:37:05 +01:00
|
|
|
__attribute__((__const__))
|
Split glib.h into many header files mostly according to the resp.
2000-10-12 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
* glib.h, galloca.h, garray.h, gasyncqueue.h, gbacktrace.h,
gcache.h, gcompletion.h, gconvert.h, gdataset.h, gdate.h, ghash.h,
ghook.h, giochannel.h, glist.h , gmacros.h, gmain.h, gmem.h,
gmessages.h, gnode.h, gprimes.h, gquark.h, gqueue.h, grand.h,
grel.h, gscanner.h, gslist.h, gstrfuncs.h, gstring.h, gthread.h,
gthreadpool.h, gtimer.h, gtree.h, gtypes.h, gutils.h: Split glib.h
into many header files mostly according to the resp. *.c-files.
* gmacros.h: Added G_BEGIN_DECLS and G_END_DECLS to mean: 'in case
of C++: extern "C" { ... }' analogous to glibc __BEGIN_DECLS and
__END_DECLS.
* configure.in, gerror.h, gfileutils.h, gshell.h, gspawn.h,
gunicode.h, : Changed guard-macro names to something more
consistent.
* configure.in, *.h: Use G_BEGIN_DECLS and G_END_DECLS.
2000-10-12 13:52:07 +02:00
|
|
|
#define G_GNUC_UNUSED \
|
2001-12-06 23:37:05 +01:00
|
|
|
__attribute__((__unused__))
|
2001-08-23 16:13:32 +02:00
|
|
|
#define G_GNUC_NO_INSTRUMENT \
|
2001-12-06 23:37:05 +01:00
|
|
|
__attribute__((__no_instrument_function__))
|
Split glib.h into many header files mostly according to the resp.
2000-10-12 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
* glib.h, galloca.h, garray.h, gasyncqueue.h, gbacktrace.h,
gcache.h, gcompletion.h, gconvert.h, gdataset.h, gdate.h, ghash.h,
ghook.h, giochannel.h, glist.h , gmacros.h, gmain.h, gmem.h,
gmessages.h, gnode.h, gprimes.h, gquark.h, gqueue.h, grand.h,
grel.h, gscanner.h, gslist.h, gstrfuncs.h, gstring.h, gthread.h,
gthreadpool.h, gtimer.h, gtree.h, gtypes.h, gutils.h: Split glib.h
into many header files mostly according to the resp. *.c-files.
* gmacros.h: Added G_BEGIN_DECLS and G_END_DECLS to mean: 'in case
of C++: extern "C" { ... }' analogous to glibc __BEGIN_DECLS and
__END_DECLS.
* configure.in, gerror.h, gfileutils.h, gshell.h, gspawn.h,
gunicode.h, : Changed guard-macro names to something more
consistent.
* configure.in, *.h: Use G_BEGIN_DECLS and G_END_DECLS.
2000-10-12 13:52:07 +02:00
|
|
|
#else /* !__GNUC__ */
|
|
|
|
#define G_GNUC_PRINTF( format_idx, arg_idx )
|
|
|
|
#define G_GNUC_SCANF( format_idx, arg_idx )
|
|
|
|
#define G_GNUC_FORMAT( arg_idx )
|
|
|
|
#define G_GNUC_NORETURN
|
|
|
|
#define G_GNUC_CONST
|
|
|
|
#define G_GNUC_UNUSED
|
2001-08-23 16:13:32 +02:00
|
|
|
#define G_GNUC_NO_INSTRUMENT
|
Split glib.h into many header files mostly according to the resp.
2000-10-12 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
* glib.h, galloca.h, garray.h, gasyncqueue.h, gbacktrace.h,
gcache.h, gcompletion.h, gconvert.h, gdataset.h, gdate.h, ghash.h,
ghook.h, giochannel.h, glist.h , gmacros.h, gmain.h, gmem.h,
gmessages.h, gnode.h, gprimes.h, gquark.h, gqueue.h, grand.h,
grel.h, gscanner.h, gslist.h, gstrfuncs.h, gstring.h, gthread.h,
gthreadpool.h, gtimer.h, gtree.h, gtypes.h, gutils.h: Split glib.h
into many header files mostly according to the resp. *.c-files.
* gmacros.h: Added G_BEGIN_DECLS and G_END_DECLS to mean: 'in case
of C++: extern "C" { ... }' analogous to glibc __BEGIN_DECLS and
__END_DECLS.
* configure.in, gerror.h, gfileutils.h, gshell.h, gspawn.h,
gunicode.h, : Changed guard-macro names to something more
consistent.
* configure.in, *.h: Use G_BEGIN_DECLS and G_END_DECLS.
2000-10-12 13:52:07 +02:00
|
|
|
#endif /* !__GNUC__ */
|
2002-11-21 21:44:54 +01:00
|
|
|
|
|
|
|
#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1)
|
|
|
|
#define G_GNUC_DEPRECATED \
|
|
|
|
__attribute__((__deprecated__))
|
|
|
|
#else
|
|
|
|
#define G_GNUC_DEPRECATED
|
|
|
|
#endif /* __GNUC__ */
|
Split glib.h into many header files mostly according to the resp.
2000-10-12 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
* glib.h, galloca.h, garray.h, gasyncqueue.h, gbacktrace.h,
gcache.h, gcompletion.h, gconvert.h, gdataset.h, gdate.h, ghash.h,
ghook.h, giochannel.h, glist.h , gmacros.h, gmain.h, gmem.h,
gmessages.h, gnode.h, gprimes.h, gquark.h, gqueue.h, grand.h,
grel.h, gscanner.h, gslist.h, gstrfuncs.h, gstring.h, gthread.h,
gthreadpool.h, gtimer.h, gtree.h, gtypes.h, gutils.h: Split glib.h
into many header files mostly according to the resp. *.c-files.
* gmacros.h: Added G_BEGIN_DECLS and G_END_DECLS to mean: 'in case
of C++: extern "C" { ... }' analogous to glibc __BEGIN_DECLS and
__END_DECLS.
* configure.in, gerror.h, gfileutils.h, gshell.h, gspawn.h,
gunicode.h, : Changed guard-macro names to something more
consistent.
* configure.in, *.h: Use G_BEGIN_DECLS and G_END_DECLS.
2000-10-12 13:52:07 +02:00
|
|
|
|
2010-04-06 17:17:18 +02:00
|
|
|
#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5)
|
|
|
|
#define G_GNUC_DEPRECATED_FOR(f) \
|
|
|
|
__attribute__((deprecated("Use " #f " instead")))
|
|
|
|
#else
|
|
|
|
#define G_GNUC_DEPRECATED_FOR(f) G_GNUC_DEPRECATED
|
|
|
|
#endif /* __GNUC__ */
|
|
|
|
|
2012-02-10 14:49:17 +01:00
|
|
|
#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)
|
|
|
|
#define G_GNUC_BEGIN_IGNORE_DEPRECATIONS \
|
|
|
|
_Pragma ("GCC diagnostic push") \
|
|
|
|
_Pragma ("GCC diagnostic ignored \"-Wdeprecated-declarations\"")
|
|
|
|
#define G_GNUC_END_IGNORE_DEPRECATIONS \
|
|
|
|
_Pragma ("GCC diagnostic pop")
|
|
|
|
#else
|
|
|
|
#define G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
|
|
|
#define G_GNUC_END_IGNORE_DEPRECATIONS
|
|
|
|
#endif
|
|
|
|
|
2006-11-22 16:54:58 +01:00
|
|
|
#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3)
|
|
|
|
# define G_GNUC_MAY_ALIAS __attribute__((may_alias))
|
|
|
|
#else
|
|
|
|
# define G_GNUC_MAY_ALIAS
|
|
|
|
#endif
|
|
|
|
|
2005-12-04 07:41:58 +01:00
|
|
|
#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
|
|
|
|
#define G_GNUC_WARN_UNUSED_RESULT \
|
|
|
|
__attribute__((warn_unused_result))
|
|
|
|
#else
|
|
|
|
#define G_GNUC_WARN_UNUSED_RESULT
|
|
|
|
#endif /* __GNUC__ */
|
|
|
|
|
2008-01-28 00:42:33 +01:00
|
|
|
#ifndef G_DISABLE_DEPRECATED
|
Split glib.h into many header files mostly according to the resp.
2000-10-12 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
* glib.h, galloca.h, garray.h, gasyncqueue.h, gbacktrace.h,
gcache.h, gcompletion.h, gconvert.h, gdataset.h, gdate.h, ghash.h,
ghook.h, giochannel.h, glist.h , gmacros.h, gmain.h, gmem.h,
gmessages.h, gnode.h, gprimes.h, gquark.h, gqueue.h, grand.h,
grel.h, gscanner.h, gslist.h, gstrfuncs.h, gstring.h, gthread.h,
gthreadpool.h, gtimer.h, gtree.h, gtypes.h, gutils.h: Split glib.h
into many header files mostly according to the resp. *.c-files.
* gmacros.h: Added G_BEGIN_DECLS and G_END_DECLS to mean: 'in case
of C++: extern "C" { ... }' analogous to glibc __BEGIN_DECLS and
__END_DECLS.
* configure.in, gerror.h, gfileutils.h, gshell.h, gspawn.h,
gunicode.h, : Changed guard-macro names to something more
consistent.
* configure.in, *.h: Use G_BEGIN_DECLS and G_END_DECLS.
2000-10-12 13:52:07 +02:00
|
|
|
/* Wrap the gcc __PRETTY_FUNCTION__ and __FUNCTION__ variables with
|
|
|
|
* macros, so we can refer to them as strings unconditionally.
|
2003-11-27 18:08:58 +01:00
|
|
|
* usage not-recommended since gcc-3.0
|
Split glib.h into many header files mostly according to the resp.
2000-10-12 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
* glib.h, galloca.h, garray.h, gasyncqueue.h, gbacktrace.h,
gcache.h, gcompletion.h, gconvert.h, gdataset.h, gdate.h, ghash.h,
ghook.h, giochannel.h, glist.h , gmacros.h, gmain.h, gmem.h,
gmessages.h, gnode.h, gprimes.h, gquark.h, gqueue.h, grand.h,
grel.h, gscanner.h, gslist.h, gstrfuncs.h, gstring.h, gthread.h,
gthreadpool.h, gtimer.h, gtree.h, gtypes.h, gutils.h: Split glib.h
into many header files mostly according to the resp. *.c-files.
* gmacros.h: Added G_BEGIN_DECLS and G_END_DECLS to mean: 'in case
of C++: extern "C" { ... }' analogous to glibc __BEGIN_DECLS and
__END_DECLS.
* configure.in, gerror.h, gfileutils.h, gshell.h, gspawn.h,
gunicode.h, : Changed guard-macro names to something more
consistent.
* configure.in, *.h: Use G_BEGIN_DECLS and G_END_DECLS.
2000-10-12 13:52:07 +02:00
|
|
|
*/
|
2002-01-29 01:29:24 +01:00
|
|
|
#if defined (__GNUC__) && (__GNUC__ < 3)
|
Split glib.h into many header files mostly according to the resp.
2000-10-12 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
* glib.h, galloca.h, garray.h, gasyncqueue.h, gbacktrace.h,
gcache.h, gcompletion.h, gconvert.h, gdataset.h, gdate.h, ghash.h,
ghook.h, giochannel.h, glist.h , gmacros.h, gmain.h, gmem.h,
gmessages.h, gnode.h, gprimes.h, gquark.h, gqueue.h, grand.h,
grel.h, gscanner.h, gslist.h, gstrfuncs.h, gstring.h, gthread.h,
gthreadpool.h, gtimer.h, gtree.h, gtypes.h, gutils.h: Split glib.h
into many header files mostly according to the resp. *.c-files.
* gmacros.h: Added G_BEGIN_DECLS and G_END_DECLS to mean: 'in case
of C++: extern "C" { ... }' analogous to glibc __BEGIN_DECLS and
__END_DECLS.
* configure.in, gerror.h, gfileutils.h, gshell.h, gspawn.h,
gunicode.h, : Changed guard-macro names to something more
consistent.
* configure.in, *.h: Use G_BEGIN_DECLS and G_END_DECLS.
2000-10-12 13:52:07 +02:00
|
|
|
#define G_GNUC_FUNCTION __FUNCTION__
|
|
|
|
#define G_GNUC_PRETTY_FUNCTION __PRETTY_FUNCTION__
|
|
|
|
#else /* !__GNUC__ */
|
|
|
|
#define G_GNUC_FUNCTION ""
|
|
|
|
#define G_GNUC_PRETTY_FUNCTION ""
|
|
|
|
#endif /* !__GNUC__ */
|
2008-01-28 00:42:33 +01:00
|
|
|
#endif /* !G_DISABLE_DEPRECATED */
|
Split glib.h into many header files mostly according to the resp.
2000-10-12 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
* glib.h, galloca.h, garray.h, gasyncqueue.h, gbacktrace.h,
gcache.h, gcompletion.h, gconvert.h, gdataset.h, gdate.h, ghash.h,
ghook.h, giochannel.h, glist.h , gmacros.h, gmain.h, gmem.h,
gmessages.h, gnode.h, gprimes.h, gquark.h, gqueue.h, grand.h,
grel.h, gscanner.h, gslist.h, gstrfuncs.h, gstring.h, gthread.h,
gthreadpool.h, gtimer.h, gtree.h, gtypes.h, gutils.h: Split glib.h
into many header files mostly according to the resp. *.c-files.
* gmacros.h: Added G_BEGIN_DECLS and G_END_DECLS to mean: 'in case
of C++: extern "C" { ... }' analogous to glibc __BEGIN_DECLS and
__END_DECLS.
* configure.in, gerror.h, gfileutils.h, gshell.h, gspawn.h,
gunicode.h, : Changed guard-macro names to something more
consistent.
* configure.in, *.h: Use G_BEGIN_DECLS and G_END_DECLS.
2000-10-12 13:52:07 +02:00
|
|
|
|
|
|
|
#define G_STRINGIFY(macro_or_string) G_STRINGIFY_ARG (macro_or_string)
|
|
|
|
#define G_STRINGIFY_ARG(contents) #contents
|
|
|
|
|
2011-10-05 17:27:45 +02:00
|
|
|
#ifndef __GI_SCANNER__ /* The static assert macro really confuses the introspection parser */
|
2008-10-29 16:14:06 +01:00
|
|
|
#define G_PASTE_ARGS(identifier1,identifier2) identifier1 ## identifier2
|
|
|
|
#define G_PASTE(identifier1,identifier2) G_PASTE_ARGS (identifier1, identifier2)
|
2011-10-07 07:19:15 +02:00
|
|
|
#ifdef __COUNTER__
|
|
|
|
#define G_STATIC_ASSERT(expr) typedef char G_PASTE (_GStaticAssertCompileTimeAssertion_, __COUNTER__)[(expr) ? 1 : -1]
|
|
|
|
#else
|
2011-10-04 17:52:47 +02:00
|
|
|
#define G_STATIC_ASSERT(expr) typedef char G_PASTE (_GStaticAssertCompileTimeAssertion_, __LINE__)[(expr) ? 1 : -1]
|
2011-10-07 07:19:15 +02:00
|
|
|
#endif
|
2011-05-22 18:44:12 +02:00
|
|
|
#define G_STATIC_ASSERT_EXPR(expr) ((void) sizeof (char[(expr) ? 1 : -1]))
|
2011-10-05 17:27:45 +02:00
|
|
|
#endif
|
2008-10-29 16:14:06 +01:00
|
|
|
|
Split glib.h into many header files mostly according to the resp.
2000-10-12 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
* glib.h, galloca.h, garray.h, gasyncqueue.h, gbacktrace.h,
gcache.h, gcompletion.h, gconvert.h, gdataset.h, gdate.h, ghash.h,
ghook.h, giochannel.h, glist.h , gmacros.h, gmain.h, gmem.h,
gmessages.h, gnode.h, gprimes.h, gquark.h, gqueue.h, grand.h,
grel.h, gscanner.h, gslist.h, gstrfuncs.h, gstring.h, gthread.h,
gthreadpool.h, gtimer.h, gtree.h, gtypes.h, gutils.h: Split glib.h
into many header files mostly according to the resp. *.c-files.
* gmacros.h: Added G_BEGIN_DECLS and G_END_DECLS to mean: 'in case
of C++: extern "C" { ... }' analogous to glibc __BEGIN_DECLS and
__END_DECLS.
* configure.in, gerror.h, gfileutils.h, gshell.h, gspawn.h,
gunicode.h, : Changed guard-macro names to something more
consistent.
* configure.in, *.h: Use G_BEGIN_DECLS and G_END_DECLS.
2000-10-12 13:52:07 +02:00
|
|
|
/* Provide a string identifying the current code position */
|
2003-05-28 18:53:20 +02:00
|
|
|
#if defined(__GNUC__) && (__GNUC__ < 3) && !defined(__cplusplus)
|
Split glib.h into many header files mostly according to the resp.
2000-10-12 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
* glib.h, galloca.h, garray.h, gasyncqueue.h, gbacktrace.h,
gcache.h, gcompletion.h, gconvert.h, gdataset.h, gdate.h, ghash.h,
ghook.h, giochannel.h, glist.h , gmacros.h, gmain.h, gmem.h,
gmessages.h, gnode.h, gprimes.h, gquark.h, gqueue.h, grand.h,
grel.h, gscanner.h, gslist.h, gstrfuncs.h, gstring.h, gthread.h,
gthreadpool.h, gtimer.h, gtree.h, gtypes.h, gutils.h: Split glib.h
into many header files mostly according to the resp. *.c-files.
* gmacros.h: Added G_BEGIN_DECLS and G_END_DECLS to mean: 'in case
of C++: extern "C" { ... }' analogous to glibc __BEGIN_DECLS and
__END_DECLS.
* configure.in, gerror.h, gfileutils.h, gshell.h, gspawn.h,
gunicode.h, : Changed guard-macro names to something more
consistent.
* configure.in, *.h: Use G_BEGIN_DECLS and G_END_DECLS.
2000-10-12 13:52:07 +02:00
|
|
|
# define G_STRLOC __FILE__ ":" G_STRINGIFY (__LINE__) ":" __PRETTY_FUNCTION__ "()"
|
|
|
|
#else
|
|
|
|
# define G_STRLOC __FILE__ ":" G_STRINGIFY (__LINE__)
|
|
|
|
#endif
|
|
|
|
|
2003-11-27 18:08:58 +01:00
|
|
|
/* Provide a string identifying the current function, non-concatenatable */
|
|
|
|
#if defined (__GNUC__)
|
|
|
|
# define G_STRFUNC ((const char*) (__PRETTY_FUNCTION__))
|
2008-09-10 05:21:42 +02:00
|
|
|
#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 19901L
|
2003-11-27 18:08:58 +01:00
|
|
|
# define G_STRFUNC ((const char*) (__func__))
|
2012-02-16 10:04:50 +01:00
|
|
|
#elif defined(_MSC_VER) && (_MSC_VER > 1300)
|
|
|
|
# define G_STRFUNC ((const char*) (__FUNCTION__))
|
2003-12-11 19:31:46 +01:00
|
|
|
#else
|
2003-11-27 18:08:58 +01:00
|
|
|
# define G_STRFUNC ((const char*) ("???"))
|
|
|
|
#endif
|
|
|
|
|
Split glib.h into many header files mostly according to the resp.
2000-10-12 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
* glib.h, galloca.h, garray.h, gasyncqueue.h, gbacktrace.h,
gcache.h, gcompletion.h, gconvert.h, gdataset.h, gdate.h, ghash.h,
ghook.h, giochannel.h, glist.h , gmacros.h, gmain.h, gmem.h,
gmessages.h, gnode.h, gprimes.h, gquark.h, gqueue.h, grand.h,
grel.h, gscanner.h, gslist.h, gstrfuncs.h, gstring.h, gthread.h,
gthreadpool.h, gtimer.h, gtree.h, gtypes.h, gutils.h: Split glib.h
into many header files mostly according to the resp. *.c-files.
* gmacros.h: Added G_BEGIN_DECLS and G_END_DECLS to mean: 'in case
of C++: extern "C" { ... }' analogous to glibc __BEGIN_DECLS and
__END_DECLS.
* configure.in, gerror.h, gfileutils.h, gshell.h, gspawn.h,
gunicode.h, : Changed guard-macro names to something more
consistent.
* configure.in, *.h: Use G_BEGIN_DECLS and G_END_DECLS.
2000-10-12 13:52:07 +02:00
|
|
|
/* Guard C code in headers, while including them from C++ */
|
|
|
|
#ifdef __cplusplus
|
|
|
|
# define G_BEGIN_DECLS extern "C" {
|
|
|
|
# define G_END_DECLS }
|
|
|
|
#else
|
|
|
|
# define G_BEGIN_DECLS
|
|
|
|
# define G_END_DECLS
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/* Provide definitions for some commonly used macros.
|
|
|
|
* Some of them are only provided if they haven't already
|
|
|
|
* been defined. It is assumed that if they are already
|
|
|
|
* defined then the current definition is correct.
|
|
|
|
*/
|
|
|
|
#ifndef NULL
|
|
|
|
# ifdef __cplusplus
|
|
|
|
# define NULL (0L)
|
|
|
|
# else /* !__cplusplus */
|
|
|
|
# define NULL ((void*) 0)
|
|
|
|
# endif /* !__cplusplus */
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef FALSE
|
|
|
|
#define FALSE (0)
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef TRUE
|
|
|
|
#define TRUE (!FALSE)
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#undef MAX
|
|
|
|
#define MAX(a, b) (((a) > (b)) ? (a) : (b))
|
|
|
|
|
|
|
|
#undef MIN
|
|
|
|
#define MIN(a, b) (((a) < (b)) ? (a) : (b))
|
|
|
|
|
|
|
|
#undef ABS
|
|
|
|
#define ABS(a) (((a) < 0) ? -(a) : (a))
|
|
|
|
|
|
|
|
#undef CLAMP
|
|
|
|
#define CLAMP(x, low, high) (((x) > (high)) ? (high) : (((x) < (low)) ? (low) : (x)))
|
|
|
|
|
|
|
|
/* Count the number of elements in an array. The array must be defined
|
|
|
|
* as such; using this with a dynamically allocated array will give
|
|
|
|
* incorrect results.
|
|
|
|
*/
|
|
|
|
#define G_N_ELEMENTS(arr) (sizeof (arr) / sizeof ((arr)[0]))
|
|
|
|
|
Changes for 64-bit cleanliness, loosely based on patch from Mark Murnane.
Wed Jun 20 12:00:54 2001 Owen Taylor <otaylor@redhat.com>
Changes for 64-bit cleanliness, loosely based on patch
from Mark Murnane.
* gconvert.c (g_convert/g_convert_with_fallback): Remove
workarounds for since-fixed GNU libc bugs. Minor
doc fix.
* gconvert.[ch]: Change gint to gsize/gssize as
appropriate.
* gconvert.c (g_locale/filename_to/from_utf8): Fix incorrect
computation of bytes_read / bytes_written.
* gfileutils.[ch] (g_file_get_contents): Make length
out parameter 'gsize *len'.
* ghook.c (g_hook_compare_ids): Don't compare a
and b as 'a - b'.
* gmacros.h (GSIZE_TO_POINTER): Add GPOINTER_TO_SIZE,
GSIZE_TO_POINTER.
* gmain.c (g_timeout_prepare): Rewrite to avoid
overflows. (Fixes bug when system clock skews
backwards more than 24 days.)
* gmarkup.[ch]: Make lengths passed to callbacks
gsize, length for g_markup_parse-context_parse(),
g_markup_escape_text() gssize.
* gmessages.[ch] (g_printf_string_upper_bound): Change
return value to gsize.
* gmessages.c (printf_string_upper_bound): Remove
a ridiculous use of 'inline' on a 300 line function.
* gstring.[ch]: Represent size of string as a gsize,
not gint. Make parameters to functions take gsize,
or gssize where -1 is allowed.
* gstring.c (g_string_erase): Make
g_string_erase (string, pos, -1) a synonym for
g_string_truncate for consistency with other G*
APIs.
* gstrfuncs.[ch]: Make all functions taking a string
length, take a gsize, or gssize if -1 is allowed.
(g_strstr_len, g_strrstr_len). Also fix some boundary
conditions in g_str[r]str[_len].
* gutf8.c tests/unicode-encoding.c: Make parameters that
are byte lengths gsize, gssize as appropriate. Make
character offsets, other counts, glong.
* gasyncqueue.c gcompletion.c
timeloop.c timeloop-basic.c gutils.c gspawn.c.
Small 64 bit cleanliness fixups.
* glist.c (g_list_sort2, g_list_sort_real): Fix functions
that should have been static.
* gdate.c (g_date_fill_parse_tokens): Fix extra
declaration that was shadowing another.
* tests/module-test.c: Include string.h
Mon Jun 18 15:43:29 2001 Owen Taylor <otaylor@redhat.com>
* gutf8.c (g_get_charset): Make argument
G_CONST_RETURN char **.
2001-06-23 15:55:09 +02:00
|
|
|
/* Macros by analogy to GINT_TO_POINTER, GPOINTER_TO_INT
|
|
|
|
*/
|
|
|
|
#define GPOINTER_TO_SIZE(p) ((gsize) (p))
|
|
|
|
#define GSIZE_TO_POINTER(s) ((gpointer) (gsize) (s))
|
|
|
|
|
Split glib.h into many header files mostly according to the resp.
2000-10-12 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
* glib.h, galloca.h, garray.h, gasyncqueue.h, gbacktrace.h,
gcache.h, gcompletion.h, gconvert.h, gdataset.h, gdate.h, ghash.h,
ghook.h, giochannel.h, glist.h , gmacros.h, gmain.h, gmem.h,
gmessages.h, gnode.h, gprimes.h, gquark.h, gqueue.h, grand.h,
grel.h, gscanner.h, gslist.h, gstrfuncs.h, gstring.h, gthread.h,
gthreadpool.h, gtimer.h, gtree.h, gtypes.h, gutils.h: Split glib.h
into many header files mostly according to the resp. *.c-files.
* gmacros.h: Added G_BEGIN_DECLS and G_END_DECLS to mean: 'in case
of C++: extern "C" { ... }' analogous to glibc __BEGIN_DECLS and
__END_DECLS.
* configure.in, gerror.h, gfileutils.h, gshell.h, gspawn.h,
gunicode.h, : Changed guard-macro names to something more
consistent.
* configure.in, *.h: Use G_BEGIN_DECLS and G_END_DECLS.
2000-10-12 13:52:07 +02:00
|
|
|
/* Provide convenience macros for handling structure
|
|
|
|
* fields through their offsets.
|
|
|
|
*/
|
2008-06-11 09:37:45 +02:00
|
|
|
|
|
|
|
#if defined(__GNUC__) && __GNUC__ >= 4
|
|
|
|
# define G_STRUCT_OFFSET(struct_type, member) \
|
2009-01-18 02:03:00 +01:00
|
|
|
((glong) offsetof (struct_type, member))
|
2008-06-11 09:37:45 +02:00
|
|
|
#else
|
|
|
|
# define G_STRUCT_OFFSET(struct_type, member) \
|
|
|
|
((glong) ((guint8*) &((struct_type*) 0)->member))
|
|
|
|
#endif
|
|
|
|
|
Split glib.h into many header files mostly according to the resp.
2000-10-12 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
* glib.h, galloca.h, garray.h, gasyncqueue.h, gbacktrace.h,
gcache.h, gcompletion.h, gconvert.h, gdataset.h, gdate.h, ghash.h,
ghook.h, giochannel.h, glist.h , gmacros.h, gmain.h, gmem.h,
gmessages.h, gnode.h, gprimes.h, gquark.h, gqueue.h, grand.h,
grel.h, gscanner.h, gslist.h, gstrfuncs.h, gstring.h, gthread.h,
gthreadpool.h, gtimer.h, gtree.h, gtypes.h, gutils.h: Split glib.h
into many header files mostly according to the resp. *.c-files.
* gmacros.h: Added G_BEGIN_DECLS and G_END_DECLS to mean: 'in case
of C++: extern "C" { ... }' analogous to glibc __BEGIN_DECLS and
__END_DECLS.
* configure.in, gerror.h, gfileutils.h, gshell.h, gspawn.h,
gunicode.h, : Changed guard-macro names to something more
consistent.
* configure.in, *.h: Use G_BEGIN_DECLS and G_END_DECLS.
2000-10-12 13:52:07 +02:00
|
|
|
#define G_STRUCT_MEMBER_P(struct_p, struct_offset) \
|
|
|
|
((gpointer) ((guint8*) (struct_p) + (glong) (struct_offset)))
|
|
|
|
#define G_STRUCT_MEMBER(member_type, struct_p, struct_offset) \
|
|
|
|
(*(member_type*) G_STRUCT_MEMBER_P ((struct_p), (struct_offset)))
|
|
|
|
|
2008-05-22 10:53:15 +02:00
|
|
|
/* Provide simple macro statement wrappers:
|
|
|
|
* G_STMT_START { statements; } G_STMT_END;
|
|
|
|
* This can be used as a single statement, like:
|
|
|
|
* if (x) G_STMT_START { ... } G_STMT_END; else ...
|
|
|
|
* This intentionally does not use compiler extensions like GCC's '({...})' to
|
|
|
|
* avoid portability issue or side effects when compiled with different compilers.
|
Split glib.h into many header files mostly according to the resp.
2000-10-12 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
* glib.h, galloca.h, garray.h, gasyncqueue.h, gbacktrace.h,
gcache.h, gcompletion.h, gconvert.h, gdataset.h, gdate.h, ghash.h,
ghook.h, giochannel.h, glist.h , gmacros.h, gmain.h, gmem.h,
gmessages.h, gnode.h, gprimes.h, gquark.h, gqueue.h, grand.h,
grel.h, gscanner.h, gslist.h, gstrfuncs.h, gstring.h, gthread.h,
gthreadpool.h, gtimer.h, gtree.h, gtypes.h, gutils.h: Split glib.h
into many header files mostly according to the resp. *.c-files.
* gmacros.h: Added G_BEGIN_DECLS and G_END_DECLS to mean: 'in case
of C++: extern "C" { ... }' analogous to glibc __BEGIN_DECLS and
__END_DECLS.
* configure.in, gerror.h, gfileutils.h, gshell.h, gspawn.h,
gunicode.h, : Changed guard-macro names to something more
consistent.
* configure.in, *.h: Use G_BEGIN_DECLS and G_END_DECLS.
2000-10-12 13:52:07 +02:00
|
|
|
*/
|
|
|
|
#if !(defined (G_STMT_START) && defined (G_STMT_END))
|
2008-05-22 10:53:15 +02:00
|
|
|
# define G_STMT_START do
|
|
|
|
# define G_STMT_END while (0)
|
Split glib.h into many header files mostly according to the resp.
2000-10-12 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
* glib.h, galloca.h, garray.h, gasyncqueue.h, gbacktrace.h,
gcache.h, gcompletion.h, gconvert.h, gdataset.h, gdate.h, ghash.h,
ghook.h, giochannel.h, glist.h , gmacros.h, gmain.h, gmem.h,
gmessages.h, gnode.h, gprimes.h, gquark.h, gqueue.h, grand.h,
grel.h, gscanner.h, gslist.h, gstrfuncs.h, gstring.h, gthread.h,
gthreadpool.h, gtimer.h, gtree.h, gtypes.h, gutils.h: Split glib.h
into many header files mostly according to the resp. *.c-files.
* gmacros.h: Added G_BEGIN_DECLS and G_END_DECLS to mean: 'in case
of C++: extern "C" { ... }' analogous to glibc __BEGIN_DECLS and
__END_DECLS.
* configure.in, gerror.h, gfileutils.h, gshell.h, gspawn.h,
gunicode.h, : Changed guard-macro names to something more
consistent.
* configure.in, *.h: Use G_BEGIN_DECLS and G_END_DECLS.
2000-10-12 13:52:07 +02:00
|
|
|
#endif
|
|
|
|
|
2011-06-13 15:27:41 +02:00
|
|
|
/* Deprecated -- do not use. */
|
|
|
|
#ifndef G_DISABLE_DEPRECATED
|
2000-12-01 06:42:51 +01:00
|
|
|
#ifdef G_DISABLE_CONST_RETURNS
|
|
|
|
#define G_CONST_RETURN
|
|
|
|
#else
|
|
|
|
#define G_CONST_RETURN const
|
|
|
|
#endif
|
2011-06-13 15:27:41 +02:00
|
|
|
#endif
|
2000-12-01 06:42:51 +01:00
|
|
|
|
2002-11-20 22:50:16 +01:00
|
|
|
/*
|
|
|
|
* The G_LIKELY and G_UNLIKELY macros let the programmer give hints to
|
|
|
|
* the compiler about the expected result of an expression. Some compilers
|
|
|
|
* can use this information for optimizations.
|
2002-11-25 22:34:16 +01:00
|
|
|
*
|
|
|
|
* The _G_BOOLEAN_EXPR macro is intended to trigger a gcc warning when
|
|
|
|
* putting assignments in g_return_if_fail ().
|
2002-11-20 22:50:16 +01:00
|
|
|
*/
|
2002-11-25 22:34:16 +01:00
|
|
|
#if defined(__GNUC__) && (__GNUC__ > 2) && defined(__OPTIMIZE__)
|
|
|
|
#define _G_BOOLEAN_EXPR(expr) \
|
2011-05-31 16:35:38 +02:00
|
|
|
G_GNUC_EXTENSION ({ \
|
2002-11-25 22:34:16 +01:00
|
|
|
int _g_boolean_var_; \
|
|
|
|
if (expr) \
|
|
|
|
_g_boolean_var_ = 1; \
|
|
|
|
else \
|
|
|
|
_g_boolean_var_ = 0; \
|
|
|
|
_g_boolean_var_; \
|
|
|
|
})
|
2002-11-27 19:50:34 +01:00
|
|
|
#define G_LIKELY(expr) (__builtin_expect (_G_BOOLEAN_EXPR(expr), 1))
|
|
|
|
#define G_UNLIKELY(expr) (__builtin_expect (_G_BOOLEAN_EXPR(expr), 0))
|
2002-11-20 22:50:16 +01:00
|
|
|
#else
|
2002-11-26 01:35:11 +01:00
|
|
|
#define G_LIKELY(expr) (expr)
|
|
|
|
#define G_UNLIKELY(expr) (expr)
|
2002-11-20 22:50:16 +01:00
|
|
|
#endif
|
|
|
|
|
2011-10-11 19:06:58 +02:00
|
|
|
#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1)
|
|
|
|
#define G_DEPRECATED __attribute__((__deprecated__))
|
|
|
|
#elif defined(_MSC_VER) && (_MSC_VER >= 1300)
|
2011-10-12 04:38:47 +02:00
|
|
|
#define G_DEPRECATED __declspec(deprecated)
|
2011-10-11 19:06:58 +02:00
|
|
|
#else
|
|
|
|
#define G_DEPRECATED
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5)
|
|
|
|
#define G_DEPRECATED_FOR(f) __attribute__((deprecated("Use '" #f "' instead")))
|
|
|
|
#elif defined(_MSC_FULL_VER) && (_MSC_FULL_VER > 140050320)
|
|
|
|
#define G_DEPRECATED_FOR(f) __declspec(deprecated("is deprecated. Use '" #f "' instead"))
|
|
|
|
#else
|
|
|
|
#define G_DEPRECATED_FOR(f) G_DEPRECATED
|
|
|
|
#endif
|
|
|
|
|
2012-02-20 17:20:15 +01:00
|
|
|
#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5)
|
|
|
|
#define G_UNAVAILABLE(maj,min) __attribute__((deprecated("Not available for " #maj "." #min)))
|
|
|
|
#elif defined(_MSC_FULL_VER) && (_MSC_FULL_VER > 140050320)
|
|
|
|
#define G_UNAVAILABLE(maj,min) __declspec(deprecated("is not available for " #maj "." #min))
|
|
|
|
#else
|
|
|
|
#define G_UNAVAILABLE(maj,min)
|
|
|
|
#endif
|
2011-10-11 19:06:58 +02:00
|
|
|
|
2011-10-11 19:33:07 +02:00
|
|
|
/* These macros are used to mark deprecated functions in GLib headers,
|
|
|
|
* and thus have to be exposed in installed headers. But please
|
|
|
|
* do *not* use them in other projects. Instead, use G_DEPRECATED
|
|
|
|
* or define your own wrappers around it.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifdef GLIB_DISABLE_DEPRECATION_WARNINGS
|
|
|
|
#define GLIB_DEPRECATED
|
|
|
|
#define GLIB_DEPRECATED_FOR(f)
|
2012-02-20 17:20:15 +01:00
|
|
|
#define GLIB_UNAVAILABLE(maj,min)
|
2011-10-11 19:33:07 +02:00
|
|
|
#else
|
|
|
|
#define GLIB_DEPRECATED G_DEPRECATED
|
|
|
|
#define GLIB_DEPRECATED_FOR(f) G_DEPRECATED_FOR(f)
|
2012-02-20 17:20:15 +01:00
|
|
|
#define GLIB_UNAVAILABLE(maj,min) G_UNAVAILABLE(maj,min)
|
2011-10-11 19:33:07 +02:00
|
|
|
#endif
|
|
|
|
|
Split glib.h into many header files mostly according to the resp.
2000-10-12 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
* glib.h, galloca.h, garray.h, gasyncqueue.h, gbacktrace.h,
gcache.h, gcompletion.h, gconvert.h, gdataset.h, gdate.h, ghash.h,
ghook.h, giochannel.h, glist.h , gmacros.h, gmain.h, gmem.h,
gmessages.h, gnode.h, gprimes.h, gquark.h, gqueue.h, grand.h,
grel.h, gscanner.h, gslist.h, gstrfuncs.h, gstring.h, gthread.h,
gthreadpool.h, gtimer.h, gtree.h, gtypes.h, gutils.h: Split glib.h
into many header files mostly according to the resp. *.c-files.
* gmacros.h: Added G_BEGIN_DECLS and G_END_DECLS to mean: 'in case
of C++: extern "C" { ... }' analogous to glibc __BEGIN_DECLS and
__END_DECLS.
* configure.in, gerror.h, gfileutils.h, gshell.h, gspawn.h,
gunicode.h, : Changed guard-macro names to something more
consistent.
* configure.in, *.h: Use G_BEGIN_DECLS and G_END_DECLS.
2000-10-12 13:52:07 +02:00
|
|
|
#endif /* __G_MACROS_H__ */
|