diff options
author | Leo Tenenbaum <pommicket@gmail.com> | 2018-08-20 21:12:06 -0400 |
---|---|---|
committer | Leo Tenenbaum <pommicket@gmail.com> | 2018-08-20 21:12:06 -0400 |
commit | 63e87c2d0c9d263f14c77b68f85c67d46ece82a9 (patch) | |
tree | 6260365cbf7d24f37d27669e8538227fcb72e243 /gtk+-mingw/share/gtk-doc/html/glib/glib-Miscellaneous-Macros.html | |
parent | a4460f6d9453bbd7e584937686449cef3e19f052 (diff) |
Diffstat (limited to 'gtk+-mingw/share/gtk-doc/html/glib/glib-Miscellaneous-Macros.html')
-rw-r--r-- | gtk+-mingw/share/gtk-doc/html/glib/glib-Miscellaneous-Macros.html | 921 |
1 files changed, 0 insertions, 921 deletions
diff --git a/gtk+-mingw/share/gtk-doc/html/glib/glib-Miscellaneous-Macros.html b/gtk+-mingw/share/gtk-doc/html/glib/glib-Miscellaneous-Macros.html deleted file mode 100644 index bf8323b..0000000 --- a/gtk+-mingw/share/gtk-doc/html/glib/glib-Miscellaneous-Macros.html +++ /dev/null @@ -1,921 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> -<html> -<head> -<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> -<title>Miscellaneous Macros</title> -<meta name="generator" content="DocBook XSL Stylesheets V1.76.1"> -<link rel="home" href="index.html" title="GLib Reference Manual"> -<link rel="up" href="glib-fundamentals.html" title="GLib Fundamentals"> -<link rel="prev" href="glib-Numerical-Definitions.html" title="Numerical Definitions"> -<link rel="next" href="glib-Atomic-Operations.html" title="Atomic Operations"> -<meta name="generator" content="GTK-Doc V1.18 (XML mode)"> -<link rel="stylesheet" href="style.css" type="text/css"> -</head> -<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"> -<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2"> -<tr valign="middle"> -<td><a accesskey="p" href="glib-Numerical-Definitions.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td> -<td><a accesskey="u" href="glib-fundamentals.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td> -<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td> -<th width="100%" align="center">GLib Reference Manual</th> -<td><a accesskey="n" href="glib-Atomic-Operations.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td> -</tr> -<tr><td colspan="5" class="shortcuts"> -<a href="#glib-Miscellaneous-Macros.synopsis" class="shortcut">Top</a> - | - <a href="#glib-Miscellaneous-Macros.description" class="shortcut">Description</a> -</td></tr> -</table> -<div class="refentry"> -<a name="glib-Miscellaneous-Macros"></a><div class="titlepage"></div> -<div class="refnamediv"><table width="100%"><tr> -<td valign="top"> -<h2><span class="refentrytitle"><a name="glib-Miscellaneous-Macros.top_of_page"></a>Miscellaneous Macros</span></h2> -<p>Miscellaneous Macros — specialized macros which are not used often</p> -</td> -<td valign="top" align="right"></td> -</tr></table></div> -<div class="refsynopsisdiv"> -<a name="glib-Miscellaneous-Macros.synopsis"></a><h2>Synopsis</h2> -<pre class="synopsis"> -#include <glib.h> - -#define <a class="link" href="glib-Miscellaneous-Macros.html#G-INLINE-FUNC:CAPS" title="G_INLINE_FUNC">G_INLINE_FUNC</a> - -#define <a class="link" href="glib-Miscellaneous-Macros.html#G-STMT-START:CAPS" title="G_STMT_START">G_STMT_START</a> -#define <a class="link" href="glib-Miscellaneous-Macros.html#G-STMT-END:CAPS" title="G_STMT_END">G_STMT_END</a> - -#define <a class="link" href="glib-Miscellaneous-Macros.html#G-BEGIN-DECLS:CAPS" title="G_BEGIN_DECLS">G_BEGIN_DECLS</a> -#define <a class="link" href="glib-Miscellaneous-Macros.html#G-END-DECLS:CAPS" title="G_END_DECLS">G_END_DECLS</a> - -#define <a class="link" href="glib-Miscellaneous-Macros.html#G-VA-COPY:CAPS" title="G_VA_COPY()">G_VA_COPY</a> (ap1, - ap2) - -#define <a class="link" href="glib-Miscellaneous-Macros.html#G-STRINGIFY:CAPS" title="G_STRINGIFY()">G_STRINGIFY</a> (macro_or_string) -#define <a class="link" href="glib-Miscellaneous-Macros.html#G-PASTE:CAPS" title="G_PASTE()">G_PASTE</a> (identifier1, - identifier2) -#define <a class="link" href="glib-Miscellaneous-Macros.html#G-STATIC-ASSERT:CAPS" title="G_STATIC_ASSERT()">G_STATIC_ASSERT</a> (expr) -#define <a class="link" href="glib-Miscellaneous-Macros.html#G-STATIC-ASSERT-EXPR:CAPS" title="G_STATIC_ASSERT_EXPR()">G_STATIC_ASSERT_EXPR</a> (expr) - -#define <a class="link" href="glib-Miscellaneous-Macros.html#G-GNUC-EXTENSION:CAPS" title="G_GNUC_EXTENSION">G_GNUC_EXTENSION</a> -#define <a class="link" href="glib-Miscellaneous-Macros.html#G-GNUC-CONST:CAPS" title="G_GNUC_CONST">G_GNUC_CONST</a> -#define <a class="link" href="glib-Miscellaneous-Macros.html#G-GNUC-PURE:CAPS" title="G_GNUC_PURE">G_GNUC_PURE</a> -#define <a class="link" href="glib-Miscellaneous-Macros.html#G-GNUC-MALLOC:CAPS" title="G_GNUC_MALLOC">G_GNUC_MALLOC</a> -#define <a class="link" href="glib-Miscellaneous-Macros.html#G-GNUC-ALLOC-SIZE:CAPS" title="G_GNUC_ALLOC_SIZE()">G_GNUC_ALLOC_SIZE</a> (x) -#define <a class="link" href="glib-Miscellaneous-Macros.html#G-GNUC-ALLOC-SIZE2:CAPS" title="G_GNUC_ALLOC_SIZE2()">G_GNUC_ALLOC_SIZE2</a> (x, - y) -#define <a class="link" href="glib-Miscellaneous-Macros.html#G-GNUC-DEPRECATED:CAPS" title="G_GNUC_DEPRECATED">G_GNUC_DEPRECATED</a> -#define <a class="link" href="glib-Miscellaneous-Macros.html#G-GNUC-DEPRECATED-FOR:CAPS" title="G_GNUC_DEPRECATED_FOR()">G_GNUC_DEPRECATED_FOR</a> (f) -#define <a class="link" href="glib-Miscellaneous-Macros.html#G-GNUC-BEGIN-IGNORE-DEPRECATIONS:CAPS" title="G_GNUC_BEGIN_IGNORE_DEPRECATIONS">G_GNUC_BEGIN_IGNORE_DEPRECATIONS</a> -#define <a class="link" href="glib-Miscellaneous-Macros.html#G-GNUC-END-IGNORE-DEPRECATIONS:CAPS" title="G_GNUC_END_IGNORE_DEPRECATIONS">G_GNUC_END_IGNORE_DEPRECATIONS</a> -#define <a class="link" href="glib-Miscellaneous-Macros.html#G-GNUC-NORETURN:CAPS" title="G_GNUC_NORETURN">G_GNUC_NORETURN</a> -#define <a class="link" href="glib-Miscellaneous-Macros.html#G-GNUC-UNUSED:CAPS" title="G_GNUC_UNUSED">G_GNUC_UNUSED</a> -#define <a class="link" href="glib-Miscellaneous-Macros.html#G-GNUC-PRINTF:CAPS" title="G_GNUC_PRINTF()">G_GNUC_PRINTF</a> (format_idx, - arg_idx) -#define <a class="link" href="glib-Miscellaneous-Macros.html#G-GNUC-SCANF:CAPS" title="G_GNUC_SCANF()">G_GNUC_SCANF</a> (format_idx, - arg_idx) -#define <a class="link" href="glib-Miscellaneous-Macros.html#G-GNUC-FORMAT:CAPS" title="G_GNUC_FORMAT()">G_GNUC_FORMAT</a> (arg_idx) -#define <a class="link" href="glib-Miscellaneous-Macros.html#G-GNUC-NULL-TERMINATED:CAPS" title="G_GNUC_NULL_TERMINATED">G_GNUC_NULL_TERMINATED</a> -#define <a class="link" href="glib-Miscellaneous-Macros.html#G-GNUC-WARN-UNUSED-RESULT:CAPS" title="G_GNUC_WARN_UNUSED_RESULT">G_GNUC_WARN_UNUSED_RESULT</a> -#define <a class="link" href="glib-Miscellaneous-Macros.html#G-GNUC-FUNCTION:CAPS" title="G_GNUC_FUNCTION">G_GNUC_FUNCTION</a> -#define <a class="link" href="glib-Miscellaneous-Macros.html#G-GNUC-PRETTY-FUNCTION:CAPS" title="G_GNUC_PRETTY_FUNCTION">G_GNUC_PRETTY_FUNCTION</a> -#define <a class="link" href="glib-Miscellaneous-Macros.html#G-GNUC-NO-INSTRUMENT:CAPS" title="G_GNUC_NO_INSTRUMENT">G_GNUC_NO_INSTRUMENT</a> -#define <a class="link" href="glib-Miscellaneous-Macros.html#G-HAVE-GNUC-VISIBILITY:CAPS" title="G_HAVE_GNUC_VISIBILITY">G_HAVE_GNUC_VISIBILITY</a> -#define <a class="link" href="glib-Miscellaneous-Macros.html#G-GNUC-INTERNAL:CAPS" title="G_GNUC_INTERNAL">G_GNUC_INTERNAL</a> -#define <a class="link" href="glib-Miscellaneous-Macros.html#G-GNUC-MAY-ALIAS:CAPS" title="G_GNUC_MAY_ALIAS">G_GNUC_MAY_ALIAS</a> - -#define <a class="link" href="glib-Miscellaneous-Macros.html#G-DEPRECATED:CAPS" title="G_DEPRECATED">G_DEPRECATED</a> -#define <a class="link" href="glib-Miscellaneous-Macros.html#G-DEPRECATED-FOR:CAPS" title="G_DEPRECATED_FOR()">G_DEPRECATED_FOR</a> (f) -#define <a class="link" href="glib-Miscellaneous-Macros.html#G-UNAVAILABLE:CAPS" title="G_UNAVAILABLE()">G_UNAVAILABLE</a> (maj, - min) - -#define <a class="link" href="glib-Miscellaneous-Macros.html#G-LIKELY:CAPS" title="G_LIKELY()">G_LIKELY</a> (expr) -#define <a class="link" href="glib-Miscellaneous-Macros.html#G-UNLIKELY:CAPS" title="G_UNLIKELY()">G_UNLIKELY</a> (expr) - -#define <a class="link" href="glib-Miscellaneous-Macros.html#G-STRLOC:CAPS" title="G_STRLOC">G_STRLOC</a> -#define <a class="link" href="glib-Miscellaneous-Macros.html#G-STRFUNC:CAPS" title="G_STRFUNC">G_STRFUNC</a> -</pre> -</div> -<div class="refsect1"> -<a name="glib-Miscellaneous-Macros.description"></a><h2>Description</h2> -<p> -These macros provide more specialized features which are not -needed so often by application programmers. -</p> -</div> -<div class="refsect1"> -<a name="glib-Miscellaneous-Macros.details"></a><h2>Details</h2> -<div class="refsect2"> -<a name="G-INLINE-FUNC:CAPS"></a><h3>G_INLINE_FUNC</h3> -<pre class="programlisting"># define G_INLINE_FUNC -</pre> -<p> -This macro is used to export function prototypes so they can be linked -with an external version when no inlining is performed. The file which -implements the functions should define <code class="literal">G_IMPLEMENTS_INLINES</code> -before including the headers which contain <a class="link" href="glib-Miscellaneous-Macros.html#G-INLINE-FUNC:CAPS" title="G_INLINE_FUNC"><code class="literal">G_INLINE_FUNC</code></a> declarations. -Since inlining is very compiler-dependent using these macros correctly -is very difficult. Their use is strongly discouraged. -</p> -<p> -This macro is often mistaken for a replacement for the inline keyword; -inline is already declared in a portable manner in the GLib headers -and can be used normally. -</p> -</div> -<hr> -<div class="refsect2"> -<a name="G-STMT-START:CAPS"></a><h3>G_STMT_START</h3> -<pre class="programlisting"># define G_STMT_START do -</pre> -<p> -Used within multi-statement macros so that they can be used in places -where only one statement is expected by the compiler. -</p> -</div> -<hr> -<div class="refsect2"> -<a name="G-STMT-END:CAPS"></a><h3>G_STMT_END</h3> -<pre class="programlisting"># define G_STMT_END while (0) -</pre> -<p> -Used within multi-statement macros so that they can be used in places -where only one statement is expected by the compiler. -</p> -</div> -<hr> -<div class="refsect2"> -<a name="G-BEGIN-DECLS:CAPS"></a><h3>G_BEGIN_DECLS</h3> -<pre class="programlisting"># define G_BEGIN_DECLS extern "C" { -</pre> -<p> -Used (along with <a class="link" href="glib-Miscellaneous-Macros.html#G-END-DECLS:CAPS" title="G_END_DECLS"><span class="type">G_END_DECLS</span></a>) to bracket header files. If the -compiler in use is a C++ compiler, adds <code class="literal">extern "C"</code> -around the header. -</p> -</div> -<hr> -<div class="refsect2"> -<a name="G-END-DECLS:CAPS"></a><h3>G_END_DECLS</h3> -<pre class="programlisting"># define G_END_DECLS } -</pre> -<p> -Used (along with <a class="link" href="glib-Miscellaneous-Macros.html#G-BEGIN-DECLS:CAPS" title="G_BEGIN_DECLS"><span class="type">G_BEGIN_DECLS</span></a>) to bracket header files. If the -compiler in use is a C++ compiler, adds <code class="literal">extern "C"</code> -around the header. -</p> -</div> -<hr> -<div class="refsect2"> -<a name="G-VA-COPY:CAPS"></a><h3>G_VA_COPY()</h3> -<pre class="programlisting">#define G_VA_COPY(ap1,ap2)</pre> -<p> -Portable way to copy <span class="type">va_list</span> variables. -</p> -<p> -In order to use this function, you must include -<code class="filename">string.h</code> yourself, because this macro may -use <code class="function">memmove()</code> and GLib does not include <code class="filename">string.h</code> -for you. -</p> -<div class="variablelist"><table border="0"> -<col align="left" valign="top"> -<tbody> -<tr> -<td><p><span class="term"><em class="parameter"><code>ap1</code></em> :</span></p></td> -<td>the <span class="type">va_list</span> variable to place a copy of <em class="parameter"><code>ap2</code></em> in</td> -</tr> -<tr> -<td><p><span class="term"><em class="parameter"><code>ap2</code></em> :</span></p></td> -<td>a <span class="type">va_list</span> -</td> -</tr> -</tbody> -</table></div> -</div> -<hr> -<div class="refsect2"> -<a name="G-STRINGIFY:CAPS"></a><h3>G_STRINGIFY()</h3> -<pre class="programlisting">#define G_STRINGIFY(macro_or_string) G_STRINGIFY_ARG (macro_or_string) -</pre> -<p> -Accepts a macro or a string and converts it into a string after -preprocessor argument expansion. For example, the following code: -</p> -<p> -</p> -<div class="informalexample"><pre class="programlisting"> -#define AGE 27 -const gchar *greeting = G_STRINGIFY (AGE) " today!"; -</pre></div> -<p> -</p> -<p> -is transformed by the preprocessor into (code equivalent to): -</p> -<p> -</p> -<div class="informalexample"><pre class="programlisting"> -const gchar *greeting = "27 today!"; -</pre></div> -<p> -</p> -<div class="variablelist"><table border="0"> -<col align="left" valign="top"> -<tbody><tr> -<td><p><span class="term"><em class="parameter"><code>macro_or_string</code></em> :</span></p></td> -<td>a macro or a string</td> -</tr></tbody> -</table></div> -</div> -<hr> -<div class="refsect2"> -<a name="G-PASTE:CAPS"></a><h3>G_PASTE()</h3> -<pre class="programlisting">#define G_PASTE(identifier1,identifier2) G_PASTE_ARGS (identifier1, identifier2) -</pre> -<p> -Yields a new preprocessor pasted identifier -<code class="code">identifier1identifier2</code> from its expanded -arguments <em class="parameter"><code>identifier1</code></em> and <em class="parameter"><code>identifier2</code></em>. For example, -the following code: -</p> -<div class="informalexample"><pre class="programlisting"> -#define GET(traveller,method) G_PASTE(traveller_get_, method) (traveller) -const gchar *name = GET (traveller, name); -const gchar *quest = GET (traveller, quest); -GdkColor *favourite = GET (traveller, favourite_colour); -</pre></div> -<p> -</p> -<p> -is transformed by the preprocessor into: -</p> -<div class="informalexample"><pre class="programlisting"> -const gchar *name = traveller_get_name (traveller); -const gchar *quest = traveller_get_quest (traveller); -GdkColor *favourite = traveller_get_favourite_colour (traveller); -</pre></div> -<p> -</p> -<div class="variablelist"><table border="0"> -<col align="left" valign="top"> -<tbody> -<tr> -<td><p><span class="term"><em class="parameter"><code>identifier1</code></em> :</span></p></td> -<td>an identifier</td> -</tr> -<tr> -<td><p><span class="term"><em class="parameter"><code>identifier2</code></em> :</span></p></td> -<td>an identifier</td> -</tr> -</tbody> -</table></div> -<p class="since">Since 2.20</p> -</div> -<hr> -<div class="refsect2"> -<a name="G-STATIC-ASSERT:CAPS"></a><h3>G_STATIC_ASSERT()</h3> -<pre class="programlisting">#define G_STATIC_ASSERT(expr) typedef char G_PASTE (_GStaticAssertCompileTimeAssertion_, __COUNTER__)[(expr) ? 1 : -1] -</pre> -<p> -The G_STATIC_ASSERT macro lets the programmer check -a condition at compile time, the condition needs to -be compile time computable. The macro can be used in -any place where a <code class="literal">typedef</code> is valid. -</p> -<p> -</p> -<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"> -<h3 class="title">Note</h3> -<p> -A <code class="literal">typedef</code> is generally allowed in -exactly the same places that a variable declaration is -allowed. For this reason, you should not use -<code class="literal">G_STATIC_ASSERT</code> in the middle of -blocks of code. -</p> -</div> -<p> -</p> -<p> -The macro should only be used once per source code line. -</p> -<div class="variablelist"><table border="0"> -<col align="left" valign="top"> -<tbody><tr> -<td><p><span class="term"><em class="parameter"><code>expr</code></em> :</span></p></td> -<td>a constant expression</td> -</tr></tbody> -</table></div> -<p class="since">Since 2.20</p> -</div> -<hr> -<div class="refsect2"> -<a name="G-STATIC-ASSERT-EXPR:CAPS"></a><h3>G_STATIC_ASSERT_EXPR()</h3> -<pre class="programlisting">#define G_STATIC_ASSERT_EXPR(expr) ((void) sizeof (char[(expr) ? 1 : -1])) -</pre> -<p> -The G_STATIC_ASSERT_EXPR macro lets the programmer check -a condition at compile time. The condition needs to be -compile time computable. -</p> -<p> -Unlike <code class="literal">G_STATIC_ASSERT</code>, this macro -evaluates to an expression and, as such, can be used in -the middle of other expressions. Its value should be -ignored. This can be accomplished by placing it as -the first argument of a comma expression. -</p> -<p> -</p> -<div class="informalexample"><pre class="programlisting"> -#define ADD_ONE_TO_INT(x) \ - (G_STATIC_ASSERT_EXPR(sizeof (x) == sizeof (int)), ((x) + 1)) -</pre></div> -<p> -</p> -<div class="variablelist"><table border="0"> -<col align="left" valign="top"> -<tbody><tr> -<td><p><span class="term"><em class="parameter"><code>expr</code></em> :</span></p></td> -<td>a constant expression</td> -</tr></tbody> -</table></div> -<p class="since">Since 2.30</p> -</div> -<hr> -<div class="refsect2"> -<a name="G-GNUC-EXTENSION:CAPS"></a><h3>G_GNUC_EXTENSION</h3> -<pre class="programlisting"># define G_GNUC_EXTENSION __extension__ -</pre> -<p> -Expands to <code class="literal">__extension__</code> when <span class="command"><strong>gcc</strong></span> -is used as the compiler. This simply tells <span class="command"><strong>gcc</strong></span> not -to warn about the following non-standard code when compiling with the -<code class="option">-pedantic</code> option. -</p> -</div> -<hr> -<div class="refsect2"> -<a name="G-GNUC-CONST:CAPS"></a><h3>G_GNUC_CONST</h3> -<pre class="programlisting">#define G_GNUC_CONST</pre> -<p> -Expands to the GNU C <code class="literal">const</code> function attribute if -the compiler is <span class="command"><strong>gcc</strong></span>. Declaring a function as const -enables better optimization of calls to the function. A const function -doesn't examine any values except its parameters, and has no effects -except its return value. See the GNU C documentation for details. -</p> -<p> -</p> -<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"> -<h3 class="title">Note</h3> -<p> -A function that has pointer arguments and examines the data pointed to -must <span class="emphasis"><em>not</em></span> be declared const. Likewise, a function -that calls a non-const function usually must not be const. It doesn't -make sense for a const function to return void. -</p> -</div> -<p> -</p> -</div> -<hr> -<div class="refsect2"> -<a name="G-GNUC-PURE:CAPS"></a><h3>G_GNUC_PURE</h3> -<pre class="programlisting">#define G_GNUC_PURE</pre> -<p> -Expands to the GNU C <code class="literal">pure</code> function attribute if the -compiler is <span class="command"><strong>gcc</strong></span>. Declaring a function as pure enables -better optimization of calls to the function. A pure function has no -effects except its return value and the return value depends only on -the parameters and/or global variables. See the GNU C documentation -for details. -</p> -</div> -<hr> -<div class="refsect2"> -<a name="G-GNUC-MALLOC:CAPS"></a><h3>G_GNUC_MALLOC</h3> -<pre class="programlisting">#define G_GNUC_MALLOC</pre> -<p> -Expands to the GNU C <code class="literal">malloc</code> function attribute if the -compiler is <span class="command"><strong>gcc</strong></span>. Declaring a function as malloc enables -better optimization of the function. A function can have the malloc -attribute if it returns a pointer which is guaranteed to not alias with -any other pointer when the function returns (in practice, this means newly -allocated memory). See the GNU C documentation for details. -</p> -<p class="since">Since 2.6</p> -</div> -<hr> -<div class="refsect2"> -<a name="G-GNUC-ALLOC-SIZE:CAPS"></a><h3>G_GNUC_ALLOC_SIZE()</h3> -<pre class="programlisting">#define G_GNUC_ALLOC_SIZE(x) __attribute__((__alloc_size__(x))) -</pre> -<p> -Expands to the GNU C <code class="literal">alloc_size</code> function attribute -if the compiler is a new enough <span class="command"><strong>gcc</strong></span>. This attribute -tells the compiler that the function returns a pointer to memory of a -size that is specified by the <em class="parameter"><code>x</code></em>th function parameter. -See the GNU C documentation for details. -</p> -<div class="variablelist"><table border="0"> -<col align="left" valign="top"> -<tbody><tr> -<td><p><span class="term"><em class="parameter"><code>x</code></em> :</span></p></td> -<td>the index of the argument specifying the allocation size</td> -</tr></tbody> -</table></div> -<p class="since">Since 2.18</p> -</div> -<hr> -<div class="refsect2"> -<a name="G-GNUC-ALLOC-SIZE2:CAPS"></a><h3>G_GNUC_ALLOC_SIZE2()</h3> -<pre class="programlisting">#define G_GNUC_ALLOC_SIZE2(x,y) __attribute__((__alloc_size__(x,y))) -</pre> -<p> -Expands to the GNU C <code class="literal">alloc_size</code> function attribute -if the compiler is a new enough <span class="command"><strong>gcc</strong></span>. This attribute -tells the compiler that the function returns a pointer to memory of a -size that is specified by the product of two function parameters. -See the GNU C documentation for details. -</p> -<div class="variablelist"><table border="0"> -<col align="left" valign="top"> -<tbody> -<tr> -<td><p><span class="term"><em class="parameter"><code>x</code></em> :</span></p></td> -<td>the index of the argument specifying one factor of the allocation size</td> -</tr> -<tr> -<td><p><span class="term"><em class="parameter"><code>y</code></em> :</span></p></td> -<td>the index of the argument specifying the second factor of the allocation size</td> -</tr> -</tbody> -</table></div> -<p class="since">Since 2.18</p> -</div> -<hr> -<div class="refsect2"> -<a name="G-GNUC-DEPRECATED:CAPS"></a><h3>G_GNUC_DEPRECATED</h3> -<pre class="programlisting">#define G_GNUC_DEPRECATED</pre> -<p> -Expands to the GNU C <code class="literal">deprecated</code> attribute if the -compiler is <span class="command"><strong>gcc</strong></span>. It can be used to mark typedefs, -variables and functions as deprecated. When called with the -<code class="option">-Wdeprecated-declarations</code> option, the compiler will -generate warnings when deprecated interfaces are used. -See the GNU C documentation for details. -</p> -<p class="since">Since 2.2</p> -</div> -<hr> -<div class="refsect2"> -<a name="G-GNUC-DEPRECATED-FOR:CAPS"></a><h3>G_GNUC_DEPRECATED_FOR()</h3> -<pre class="programlisting">#define G_GNUC_DEPRECATED_FOR(f)</pre> -<p> -Like <a class="link" href="glib-Miscellaneous-Macros.html#G-GNUC-DEPRECATED:CAPS" title="G_GNUC_DEPRECATED"><code class="literal">G_GNUC_DEPRECATED</code></a>, but names the intended replacement for the -deprecated symbol if the version of <span class="command"><strong>gcc</strong></span> in use is -new enough to support custom deprecation messages. -See the GNU C documentation for details. -</p> -<p> -Note that if <em class="parameter"><code>f</code></em> is a macro, it will be expanded in the warning message. -You can enclose it in quotes to prevent this. (The quotes will show up -in the warning, but it's better than showing the macro expansion.) -</p> -<div class="variablelist"><table border="0"> -<col align="left" valign="top"> -<tbody><tr> -<td><p><span class="term"><em class="parameter"><code>f</code></em> :</span></p></td> -<td>the intended replacement for the deprecated symbol, -such as the name of a function</td> -</tr></tbody> -</table></div> -<p class="since">Since 2.26</p> -</div> -<hr> -<div class="refsect2"> -<a name="G-GNUC-BEGIN-IGNORE-DEPRECATIONS:CAPS"></a><h3>G_GNUC_BEGIN_IGNORE_DEPRECATIONS</h3> -<pre class="programlisting">#define G_GNUC_BEGIN_IGNORE_DEPRECATIONS</pre> -<p> -Tells <span class="command"><strong>gcc</strong></span> (if it is a new enough version) to -temporarily stop emitting warnings when functions marked with -<a class="link" href="glib-Miscellaneous-Macros.html#G-GNUC-DEPRECATED:CAPS" title="G_GNUC_DEPRECATED"><code class="literal">G_GNUC_DEPRECATED</code></a> or <a class="link" href="glib-Miscellaneous-Macros.html#G-GNUC-DEPRECATED-FOR:CAPS" title="G_GNUC_DEPRECATED_FOR()"><code class="literal">G_GNUC_DEPRECATED_FOR</code></a> are called. This is -useful for when you have one deprecated function calling another -one, or when you still have regression tests for deprecated -functions. -</p> -<p> -Use <a class="link" href="glib-Miscellaneous-Macros.html#G-GNUC-END-IGNORE-DEPRECATIONS:CAPS" title="G_GNUC_END_IGNORE_DEPRECATIONS"><code class="literal">G_GNUC_END_IGNORE_DEPRECATIONS</code></a> to begin warning again. (If you -are not compiling with <code class="literal">-Wdeprecated-declarations</code> -then neither macro has any effect.) -</p> -<p> -This macro can be used either inside or outside of a function body, -but must appear on a line by itself. -</p> -<p class="since">Since 2.32</p> -</div> -<hr> -<div class="refsect2"> -<a name="G-GNUC-END-IGNORE-DEPRECATIONS:CAPS"></a><h3>G_GNUC_END_IGNORE_DEPRECATIONS</h3> -<pre class="programlisting">#define G_GNUC_END_IGNORE_DEPRECATIONS</pre> -<p> -Undoes the effect of <a class="link" href="glib-Miscellaneous-Macros.html#G-GNUC-BEGIN-IGNORE-DEPRECATIONS:CAPS" title="G_GNUC_BEGIN_IGNORE_DEPRECATIONS"><code class="literal">G_GNUC_BEGIN_IGNORE_DEPRECATIONS</code></a>, telling -<span class="command"><strong>gcc</strong></span> to begin outputting warnings again -(assuming those warnings had been enabled to begin with). -</p> -<p> -This macro can be used either inside or outside of a function body, -but must appear on a line by itself. -</p> -<p class="since">Since 2.32</p> -</div> -<hr> -<div class="refsect2"> -<a name="G-GNUC-NORETURN:CAPS"></a><h3>G_GNUC_NORETURN</h3> -<pre class="programlisting">#define G_GNUC_NORETURN</pre> -<p> -Expands to the GNU C <code class="literal">noreturn</code> function attribute -if the compiler is <span class="command"><strong>gcc</strong></span>. It is used for declaring -functions which never return. It enables optimization of the function, -and avoids possible compiler warnings. See the GNU C documentation for -details. -</p> -</div> -<hr> -<div class="refsect2"> -<a name="G-GNUC-UNUSED:CAPS"></a><h3>G_GNUC_UNUSED</h3> -<pre class="programlisting">#define G_GNUC_UNUSED</pre> -<p> -Expands to the GNU C <code class="literal">unused</code> function attribute if -the compiler is <span class="command"><strong>gcc</strong></span>. It is used for declaring -functions which may never be used. It avoids possible compiler warnings. -See the GNU C documentation for details. -</p> -</div> -<hr> -<div class="refsect2"> -<a name="G-GNUC-PRINTF:CAPS"></a><h3>G_GNUC_PRINTF()</h3> -<pre class="programlisting">#define G_GNUC_PRINTF( format_idx, arg_idx )</pre> -<p> -Expands to the GNU C <code class="literal">format</code> function attribute -if the compiler is <span class="command"><strong>gcc</strong></span>. This is used for declaring -functions which take a variable number of arguments, with the same -syntax as <code class="function">printf()</code>. It allows the compiler to type-check the arguments -passed to the function. See the GNU C documentation for details. -</p> -<p> -</p> -<div class="informalexample"><pre class="programlisting"> -gint g_snprintf (gchar *string, - gulong n, - gchar const *format, - ...) G_GNUC_PRINTF (3, 4); -</pre></div> -<p> -</p> -<div class="variablelist"><table border="0"> -<col align="left" valign="top"> -<tbody> -<tr> -<td><p><span class="term"><em class="parameter"><code>format_idx</code></em> :</span></p></td> -<td>the index of the argument corresponding to the -format string (The arguments are numbered from 1)</td> -</tr> -<tr> -<td><p><span class="term"><em class="parameter"><code>arg_idx</code></em> :</span></p></td> -<td>the index of the first of the format arguments</td> -</tr> -</tbody> -</table></div> -</div> -<hr> -<div class="refsect2"> -<a name="G-GNUC-SCANF:CAPS"></a><h3>G_GNUC_SCANF()</h3> -<pre class="programlisting">#define G_GNUC_SCANF( format_idx, arg_idx )</pre> -<p> -Expands to the GNU C <code class="literal">format</code> function attribute -if the compiler is <span class="command"><strong>gcc</strong></span>. This is used for declaring -functions which take a variable number of arguments, with the same -syntax as <code class="function">scanf()</code>. It allows the compiler to type-check the arguments -passed to the function. See the GNU C documentation for details. -</p> -<div class="variablelist"><table border="0"> -<col align="left" valign="top"> -<tbody> -<tr> -<td><p><span class="term"><em class="parameter"><code>format_idx</code></em> :</span></p></td> -<td>the index of the argument corresponding to -the format string (The arguments are numbered from 1)</td> -</tr> -<tr> -<td><p><span class="term"><em class="parameter"><code>arg_idx</code></em> :</span></p></td> -<td>the index of the first of the format arguments</td> -</tr> -</tbody> -</table></div> -</div> -<hr> -<div class="refsect2"> -<a name="G-GNUC-FORMAT:CAPS"></a><h3>G_GNUC_FORMAT()</h3> -<pre class="programlisting">#define G_GNUC_FORMAT( arg_idx )</pre> -<p> -Expands to the GNU C <code class="literal">format_arg</code> function attribute -if the compiler is <span class="command"><strong>gcc</strong></span>. This function attribute -specifies that a function takes a format string for a <code class="function">printf()</code>, -<code class="function">scanf()</code>, <code class="function">strftime()</code> or <code class="function">strfmon()</code> style function and modifies it, -so that the result can be passed to a <code class="function">printf()</code>, <code class="function">scanf()</code>, <code class="function">strftime()</code> -or <code class="function">strfmon()</code> style function (with the remaining arguments to the -format function the same as they would have been for the unmodified -string). See the GNU C documentation for details. -</p> -<p> -</p> -<div class="informalexample"><pre class="programlisting"> -gchar *g_dgettext (gchar *domain_name, gchar *msgid) G_GNUC_FORMAT (2); -</pre></div> -<p> -</p> -<div class="variablelist"><table border="0"> -<col align="left" valign="top"> -<tbody><tr> -<td><p><span class="term"><em class="parameter"><code>arg_idx</code></em> :</span></p></td> -<td>the index of the argument</td> -</tr></tbody> -</table></div> -</div> -<hr> -<div class="refsect2"> -<a name="G-GNUC-NULL-TERMINATED:CAPS"></a><h3>G_GNUC_NULL_TERMINATED</h3> -<pre class="programlisting">#define G_GNUC_NULL_TERMINATED __attribute__((__sentinel__)) -</pre> -<p> -Expands to the GNU C <code class="literal">sentinel</code> function attribute -if the compiler is <span class="command"><strong>gcc</strong></span>, or "" if it isn't. This -function attribute only applies to variadic functions and instructs -the compiler to check that the argument list is terminated with an -explicit <a class="link" href="glib-Standard-Macros.html#NULL:CAPS" title="NULL"><code class="literal">NULL</code></a>. See the GNU C documentation for details. -</p> -<p class="since">Since 2.8</p> -</div> -<hr> -<div class="refsect2"> -<a name="G-GNUC-WARN-UNUSED-RESULT:CAPS"></a><h3>G_GNUC_WARN_UNUSED_RESULT</h3> -<pre class="programlisting">#define G_GNUC_WARN_UNUSED_RESULT</pre> -<p> -Expands to the GNU C <code class="literal">warn_unused_result</code> function -attribute if the compiler is <span class="command"><strong>gcc</strong></span>, or "" if it isn't. -This function attribute makes the compiler emit a warning if the result -of a function call is ignored. See the GNU C documentation for details. -</p> -<p class="since">Since 2.10</p> -</div> -<hr> -<div class="refsect2"> -<a name="G-GNUC-FUNCTION:CAPS"></a><h3>G_GNUC_FUNCTION</h3> -<pre class="programlisting">#define G_GNUC_FUNCTION __FUNCTION__ -</pre> -<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;"> -<h3 class="title">Warning</h3> -<p><code class="literal">G_GNUC_FUNCTION</code> has been deprecated since version 2.16 and should not be used in newly-written code. Use <a class="link" href="glib-Miscellaneous-Macros.html#G-STRFUNC:CAPS" title="G_STRFUNC"><span class="type">G_STRFUNC</span></a> instead</p> -</div> -<p> -Expands to "" on all modern compilers, and to -<code class="literal">__FUNCTION__</code> on <span class="command"><strong>gcc</strong></span> version 2.x. -Don't use it. -</p> -</div> -<hr> -<div class="refsect2"> -<a name="G-GNUC-PRETTY-FUNCTION:CAPS"></a><h3>G_GNUC_PRETTY_FUNCTION</h3> -<pre class="programlisting">#define G_GNUC_PRETTY_FUNCTION __PRETTY_FUNCTION__ -</pre> -<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;"> -<h3 class="title">Warning</h3> -<p><code class="literal">G_GNUC_PRETTY_FUNCTION</code> has been deprecated since version 2.16 and should not be used in newly-written code. Use <a class="link" href="glib-Miscellaneous-Macros.html#G-STRFUNC:CAPS" title="G_STRFUNC"><span class="type">G_STRFUNC</span></a> instead</p> -</div> -<p> -Expands to "" on all modern compilers, and to -<code class="literal">__PRETTY_FUNCTION__</code> on <span class="command"><strong>gcc</strong></span> -version 2.x. Don't use it. -</p> -</div> -<hr> -<div class="refsect2"> -<a name="G-GNUC-NO-INSTRUMENT:CAPS"></a><h3>G_GNUC_NO_INSTRUMENT</h3> -<pre class="programlisting">#define G_GNUC_NO_INSTRUMENT</pre> -<p> -Expands to the GNU C <code class="literal">no_instrument_function</code> function -attribute if the compiler is <span class="command"><strong>gcc</strong></span>. Functions with this -attribute will not be instrumented for profiling, when the compiler is -called with the <code class="option">-finstrument-functions</code> option. -See the GNU C documentation for details. -</p> -</div> -<hr> -<div class="refsect2"> -<a name="G-HAVE-GNUC-VISIBILITY:CAPS"></a><h3>G_HAVE_GNUC_VISIBILITY</h3> -<pre class="programlisting">#define G_HAVE_GNUC_VISIBILITY 1 -</pre> -</div> -<hr> -<div class="refsect2"> -<a name="G-GNUC-INTERNAL:CAPS"></a><h3>G_GNUC_INTERNAL</h3> -<pre class="programlisting">#define G_GNUC_INTERNAL __attribute__((visibility("hidden"))) -</pre> -<p> -This attribute can be used for marking library functions as being used -internally to the library only, which may allow the compiler to handle -function calls more efficiently. Note that static functions do not need -to be marked as internal in this way. See the GNU C documentation for -details. -</p> -<p> -When using a compiler that supports the GNU C hidden visibility attribute, -this macro expands to <code class="literal">__attribute__((visibility("hidden")))</code>. -When using the Sun Studio compiler, it expands to <code class="literal">__hidden</code>. -</p> -<p> -Note that for portability, the attribute should be placed before the -function declaration. While GCC allows the macro after the declaration, -Sun Studio does not. -</p> -<p> -</p> -<div class="informalexample"><pre class="programlisting"> -G_GNUC_INTERNAL -void _g_log_fallback_handler (const gchar *log_domain, - GLogLevelFlags log_level, - const gchar *message, - gpointer unused_data); -</pre></div> -<p> -</p> -<p class="since">Since 2.6</p> -</div> -<hr> -<div class="refsect2"> -<a name="G-GNUC-MAY-ALIAS:CAPS"></a><h3>G_GNUC_MAY_ALIAS</h3> -<pre class="programlisting"># define G_GNUC_MAY_ALIAS __attribute__((may_alias)) -</pre> -<p> -Expands to the GNU C <code class="literal">may_alias</code> type attribute -if the compiler is <span class="command"><strong>gcc</strong></span>. Types with this attribute -will not be subjected to type-based alias analysis, but are assumed -to alias with any other type, just like char. -See the GNU C documentation for details. -</p> -<p class="since">Since 2.14</p> -</div> -<hr> -<div class="refsect2"> -<a name="G-DEPRECATED:CAPS"></a><h3>G_DEPRECATED</h3> -<pre class="programlisting">#define G_DEPRECATED __attribute__((__deprecated__)) -</pre> -<p> -This macro is similar to <a class="link" href="glib-Miscellaneous-Macros.html#G-GNUC-DEPRECATED:CAPS" title="G_GNUC_DEPRECATED"><code class="literal">G_GNUC_DEPRECATED</code></a>, and can be used to mark -functions declarations as deprecated. Unlike <a class="link" href="glib-Miscellaneous-Macros.html#G-GNUC-DEPRECATED:CAPS" title="G_GNUC_DEPRECATED"><code class="literal">G_GNUC_DEPRECATED</code></a>, it is -meant to be portable across different compilers and must be placed -before the function declaration. -</p> -<p class="since">Since 2.32</p> -</div> -<hr> -<div class="refsect2"> -<a name="G-DEPRECATED-FOR:CAPS"></a><h3>G_DEPRECATED_FOR()</h3> -<pre class="programlisting">#define G_DEPRECATED_FOR(f) __attribute__((__deprecated__("Use '" #f "' instead"))) -</pre> -<p> -This macro is similar to <a class="link" href="glib-Miscellaneous-Macros.html#G-GNUC-DEPRECATED-FOR:CAPS" title="G_GNUC_DEPRECATED_FOR()"><code class="literal">G_GNUC_DEPRECATED_FOR</code></a>, and can be used to mark -functions declarations as deprecated. Unlike <a class="link" href="glib-Miscellaneous-Macros.html#G-GNUC-DEPRECATED-FOR:CAPS" title="G_GNUC_DEPRECATED_FOR()"><code class="literal">G_GNUC_DEPRECATED_FOR</code></a>, it is -meant to be portable across different compilers and must be placed -before the function declaration. -</p> -<div class="variablelist"><table border="0"> -<col align="left" valign="top"> -<tbody><tr> -<td><p><span class="term"><em class="parameter"><code>f</code></em> :</span></p></td> -<td>the name of the function that this function was deprecated for</td> -</tr></tbody> -</table></div> -<p class="since">Since 2.32</p> -</div> -<hr> -<div class="refsect2"> -<a name="G-UNAVAILABLE:CAPS"></a><h3>G_UNAVAILABLE()</h3> -<pre class="programlisting">#define G_UNAVAILABLE(maj,min) __attribute__((deprecated("Not available before " #maj "." #min))) -</pre> -<p> -This macro can be used to mark a function declaration as unavailable. -It must be placed before the function declaration. Use of a function -that has been annotated with this macros will produce a compiler warning. -</p> -<div class="variablelist"><table border="0"> -<col align="left" valign="top"> -<tbody> -<tr> -<td><p><span class="term"><em class="parameter"><code>maj</code></em> :</span></p></td> -<td>the major version that introduced the symbol</td> -</tr> -<tr> -<td><p><span class="term"><em class="parameter"><code>min</code></em> :</span></p></td> -<td>the minor version that introduced the symbol</td> -</tr> -</tbody> -</table></div> -<p class="since">Since 2.32</p> -</div> -<hr> -<div class="refsect2"> -<a name="G-LIKELY:CAPS"></a><h3>G_LIKELY()</h3> -<pre class="programlisting">#define G_LIKELY(expr) (__builtin_expect (_G_BOOLEAN_EXPR(expr), 1)) -</pre> -<p> -Hints the compiler that the expression is likely to evaluate to -a true value. The compiler may use this information for optimizations. -</p> -<p> -</p> -<div class="informalexample"><pre class="programlisting"> -if (G_LIKELY (random () != 1)) - g_print ("not one"); -</pre></div> -<p> -</p> -<div class="variablelist"><table border="0"> -<col align="left" valign="top"> -<tbody> -<tr> -<td><p><span class="term"><em class="parameter"><code>expr</code></em> :</span></p></td> -<td>the expression</td> -</tr> -<tr> -<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> -<td>the value of <em class="parameter"><code>expr</code></em> -</td> -</tr> -</tbody> -</table></div> -<p class="since">Since 2.2</p> -</div> -<hr> -<div class="refsect2"> -<a name="G-UNLIKELY:CAPS"></a><h3>G_UNLIKELY()</h3> -<pre class="programlisting">#define G_UNLIKELY(expr) (__builtin_expect (_G_BOOLEAN_EXPR(expr), 0)) -</pre> -<p> -Hints the compiler that the expression is unlikely to evaluate to -a true value. The compiler may use this information for optimizations. -</p> -<p> -</p> -<div class="informalexample"><pre class="programlisting"> -if (G_UNLIKELY (random () == 1)) - g_print ("a random one"); -</pre></div> -<p> -</p> -<div class="variablelist"><table border="0"> -<col align="left" valign="top"> -<tbody> -<tr> -<td><p><span class="term"><em class="parameter"><code>expr</code></em> :</span></p></td> -<td>the expression</td> -</tr> -<tr> -<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> -<td>the value of <em class="parameter"><code>expr</code></em> -</td> -</tr> -</tbody> -</table></div> -<p class="since">Since 2.2</p> -</div> -<hr> -<div class="refsect2"> -<a name="G-STRLOC:CAPS"></a><h3>G_STRLOC</h3> -<pre class="programlisting"># define G_STRLOC __FILE__ ":" G_STRINGIFY (__LINE__) ":" __PRETTY_FUNCTION__ "()" -</pre> -<p> -Expands to a string identifying the current code position. -</p> -</div> -<hr> -<div class="refsect2"> -<a name="G-STRFUNC:CAPS"></a><h3>G_STRFUNC</h3> -<pre class="programlisting"># define G_STRFUNC ((const char*) (__PRETTY_FUNCTION__)) -</pre> -<p> -Expands to a string identifying the current function. -</p> -<p class="since">Since 2.4</p> -</div> -</div> -</div> -<div class="footer"> -<hr> - Generated by GTK-Doc V1.18</div> -</body> -</html>
\ No newline at end of file |