9
9
<refname>Miscellaneous Macros</refname>
10
10
<refpurpose>specialized macros which are not used often</refpurpose>
11
<!--[<xref linkend="desc" endterm="desc.title"/>]-->
14
<refsynopsisdiv role="synopsis">
13
<refsynopsisdiv id="glib-Miscellaneous-Macros.synopsis" role="synopsis">
15
14
<title role="synopsis.title">Synopsis</title>
19
18
#include <glib.h>
22
#define <link linkend="G-INLINE-FUNC:CAPS">G_INLINE_FUNC</link>
24
#define <link linkend="G-STMT-START:CAPS">G_STMT_START</link>
25
#define <link linkend="G-STMT-END:CAPS">G_STMT_END</link>
27
#define <link linkend="G-BEGIN-DECLS:CAPS">G_BEGIN_DECLS</link>
28
#define <link linkend="G-END-DECLS:CAPS">G_END_DECLS</link>
30
#define <link linkend="G-N-ELEMENTS:CAPS">G_N_ELEMENTS</link> (arr)
32
#define <link linkend="G-VA-COPY:CAPS">G_VA_COPY</link> (ap1,ap2)
34
#define <link linkend="G-STRINGIFY:CAPS">G_STRINGIFY</link> (macro_or_string)
36
#define <link linkend="G-GNUC-EXTENSION:CAPS">G_GNUC_EXTENSION</link>
37
#define <link linkend="G-GNUC-CONST:CAPS">G_GNUC_CONST</link>
38
#define <link linkend="G-GNUC-PURE:CAPS">G_GNUC_PURE</link>
39
#define <link linkend="G-GNUC-MALLOC:CAPS">G_GNUC_MALLOC</link>
40
#define <link linkend="G-GNUC-DEPRECATED:CAPS">G_GNUC_DEPRECATED</link>
41
#define <link linkend="G-GNUC-NORETURN:CAPS">G_GNUC_NORETURN</link>
42
#define <link linkend="G-GNUC-UNUSED:CAPS">G_GNUC_UNUSED</link>
43
#define <link linkend="G-GNUC-PRINTF:CAPS">G_GNUC_PRINTF</link> ( format_idx, arg_idx )
44
#define <link linkend="G-GNUC-SCANF:CAPS">G_GNUC_SCANF</link> ( format_idx, arg_idx )
45
#define <link linkend="G-GNUC-FORMAT:CAPS">G_GNUC_FORMAT</link> ( arg_idx )
46
#define <link linkend="G-GNUC-NULL-TERMINATED:CAPS">G_GNUC_NULL_TERMINATED</link>
47
#define <link linkend="G-GNUC-WARN-UNUSED-RESULT:CAPS">G_GNUC_WARN_UNUSED_RESULT</link>
48
#define <link linkend="G-GNUC-FUNCTION:CAPS">G_GNUC_FUNCTION</link>
49
#define <link linkend="G-GNUC-PRETTY-FUNCTION:CAPS">G_GNUC_PRETTY_FUNCTION</link>
50
#define <link linkend="G-GNUC-NO-INSTRUMENT:CAPS">G_GNUC_NO_INSTRUMENT</link>
51
#define <link linkend="G-HAVE-GNUC-VISIBILITY:CAPS">G_HAVE_GNUC_VISIBILITY</link>
52
#define <link linkend="G-GNUC-INTERNAL:CAPS">G_GNUC_INTERNAL</link>
53
#define <link linkend="G-GNUC-MAY-ALIAS:CAPS">G_GNUC_MAY_ALIAS</link>
55
<link linkend="if">if</link> <link linkend="G-LIKELY:CAPS">G_LIKELY</link> ();
56
#define <link linkend="G-UNLIKELY:CAPS">G_UNLIKELY</link> (expr)
58
#define <link linkend="G-STRLOC:CAPS">G_STRLOC</link>
59
#define <link linkend="G-STRFUNC:CAPS">G_STRFUNC</link>
61
#define <link linkend="G-GINT16-MODIFIER:CAPS">G_GINT16_MODIFIER</link>
62
#define <link linkend="G-GINT16-FORMAT:CAPS">G_GINT16_FORMAT</link>
63
#define <link linkend="G-GUINT16-FORMAT:CAPS">G_GUINT16_FORMAT</link>
64
#define <link linkend="G-GINT32-MODIFIER:CAPS">G_GINT32_MODIFIER</link>
65
#define <link linkend="G-GINT32-FORMAT:CAPS">G_GINT32_FORMAT</link>
66
#define <link linkend="G-GUINT32-FORMAT:CAPS">G_GUINT32_FORMAT</link>
67
#define <link linkend="G-GINT64-MODIFIER:CAPS">G_GINT64_MODIFIER</link>
68
#define <link linkend="G-GINT64-FORMAT:CAPS">G_GINT64_FORMAT</link>
69
#define <link linkend="G-GUINT64-FORMAT:CAPS">G_GUINT64_FORMAT</link>
70
#define <link linkend="G-GSIZE-MODIFIER:CAPS">G_GSIZE_MODIFIER</link>
71
#define <link linkend="G-GSIZE-FORMAT:CAPS">G_GSIZE_FORMAT</link>
72
#define <link linkend="G-GSSIZE-FORMAT:CAPS">G_GSSIZE_FORMAT</link>
20
#define <link linkend="G-INLINE-FUNC--CAPS">G_INLINE_FUNC</link>
22
#define <link linkend="G-STMT-START--CAPS">G_STMT_START</link>
23
#define <link linkend="G-STMT-END--CAPS">G_STMT_END</link>
25
#define <link linkend="G-BEGIN-DECLS--CAPS">G_BEGIN_DECLS</link>
26
#define <link linkend="G-END-DECLS--CAPS">G_END_DECLS</link>
28
#define <link linkend="G-N-ELEMENTS--CAPS">G_N_ELEMENTS</link> (arr)
30
#define <link linkend="G-VA-COPY--CAPS">G_VA_COPY</link> (ap1,ap2)
32
#define <link linkend="G-STRINGIFY--CAPS">G_STRINGIFY</link> (macro_or_string)
34
#define <link linkend="G-GNUC-EXTENSION--CAPS">G_GNUC_EXTENSION</link>
35
#define <link linkend="G-GNUC-CONST--CAPS">G_GNUC_CONST</link>
36
#define <link linkend="G-GNUC-PURE--CAPS">G_GNUC_PURE</link>
37
#define <link linkend="G-GNUC-MALLOC--CAPS">G_GNUC_MALLOC</link>
38
#define <link linkend="G-GNUC-ALLOC-SIZE--CAPS">G_GNUC_ALLOC_SIZE</link> (x)
39
#define <link linkend="G-GNUC-ALLOC-SIZE2--CAPS">G_GNUC_ALLOC_SIZE2</link> (x,y)
40
#define <link linkend="G-GNUC-DEPRECATED--CAPS">G_GNUC_DEPRECATED</link>
41
#define <link linkend="G-GNUC-NORETURN--CAPS">G_GNUC_NORETURN</link>
42
#define <link linkend="G-GNUC-UNUSED--CAPS">G_GNUC_UNUSED</link>
43
#define <link linkend="G-GNUC-PRINTF--CAPS">G_GNUC_PRINTF</link> ( format_idx, arg_idx )
44
#define <link linkend="G-GNUC-SCANF--CAPS">G_GNUC_SCANF</link> ( format_idx, arg_idx )
45
#define <link linkend="G-GNUC-FORMAT--CAPS">G_GNUC_FORMAT</link> ( arg_idx )
46
#define <link linkend="G-GNUC-NULL-TERMINATED--CAPS">G_GNUC_NULL_TERMINATED</link>
47
#define <link linkend="G-GNUC-WARN-UNUSED-RESULT--CAPS">G_GNUC_WARN_UNUSED_RESULT</link>
48
#define <link linkend="G-GNUC-FUNCTION--CAPS">G_GNUC_FUNCTION</link>
49
#define <link linkend="G-GNUC-PRETTY-FUNCTION--CAPS">G_GNUC_PRETTY_FUNCTION</link>
50
#define <link linkend="G-GNUC-NO-INSTRUMENT--CAPS">G_GNUC_NO_INSTRUMENT</link>
51
#define <link linkend="G-GNUC-INTERNAL--CAPS">G_GNUC_INTERNAL</link>
52
#define <link linkend="G-GNUC-MAY-ALIAS--CAPS">G_GNUC_MAY_ALIAS</link>
54
<link linkend="if">if</link> <link linkend="G-LIKELY--CAPS">G_LIKELY</link> ();
55
#define <link linkend="G-UNLIKELY--CAPS">G_UNLIKELY</link> (expr)
57
#define <link linkend="G-STRLOC--CAPS">G_STRLOC</link>
58
#define <link linkend="G-STRFUNC--CAPS">G_STRFUNC</link>
60
#define <link linkend="G-GINT16-MODIFIER--CAPS">G_GINT16_MODIFIER</link>
61
#define <link linkend="G-GINT16-FORMAT--CAPS">G_GINT16_FORMAT</link>
62
#define <link linkend="G-GUINT16-FORMAT--CAPS">G_GUINT16_FORMAT</link>
63
#define <link linkend="G-GINT32-MODIFIER--CAPS">G_GINT32_MODIFIER</link>
64
#define <link linkend="G-GINT32-FORMAT--CAPS">G_GINT32_FORMAT</link>
65
#define <link linkend="G-GUINT32-FORMAT--CAPS">G_GUINT32_FORMAT</link>
66
#define <link linkend="G-GINT64-MODIFIER--CAPS">G_GINT64_MODIFIER</link>
67
#define <link linkend="G-GINT64-FORMAT--CAPS">G_GINT64_FORMAT</link>
68
#define <link linkend="G-GUINT64-FORMAT--CAPS">G_GUINT64_FORMAT</link>
69
#define <link linkend="G-GSIZE-MODIFIER--CAPS">G_GSIZE_MODIFIER</link>
70
#define <link linkend="G-GSIZE-FORMAT--CAPS">G_GSIZE_FORMAT</link>
71
#define <link linkend="G-GSSIZE-FORMAT--CAPS">G_GSSIZE_FORMAT</link>
108
106
inline is already declared in a portable manner in the glib headers
109
107
and can be used normally.
110
108
</para></refsect2>
112
<title><anchor id="G-STMT-START:CAPS" role="macro"/>G_STMT_START</title>
113
<indexterm><primary>G_STMT_START</primary></indexterm><programlisting>#define G_STMT_START</programlisting>
115
Used within multi-statement macros so that they can be used in places where
116
only one statement is expected by the compiler.
119
<title><anchor id="G-STMT-END:CAPS" role="macro"/>G_STMT_END</title>
120
<indexterm><primary>G_STMT_END</primary></indexterm><programlisting>#define G_STMT_END</programlisting>
122
Used within multi-statement macros so that they can be used in places where
123
only one statement is expected by the compiler.
126
<title><anchor id="G-BEGIN-DECLS:CAPS" role="macro"/>G_BEGIN_DECLS</title>
127
<indexterm><primary>G_BEGIN_DECLS</primary></indexterm><programlisting>#define G_BEGIN_DECLS</programlisting>
129
Used (along with <link linkend="G-END-DECLS:CAPS"><type>G_END_DECLS</type></link>) to bracket header files. If the
130
compiler in use is a C++ compiler, adds <literal>extern "C"</literal>
134
<title><anchor id="G-END-DECLS:CAPS" role="macro"/>G_END_DECLS</title>
135
<indexterm><primary>G_END_DECLS</primary></indexterm><programlisting>#define G_END_DECLS</programlisting>
137
Used (along with <link linkend="G-BEGIN-DECLS:CAPS"><type>G_BEGIN_DECLS</type></link>) to bracket header files. If the
138
compiler in use is a C++ compiler, adds <literal>extern "C"</literal>
142
<title><anchor id="G-N-ELEMENTS:CAPS" role="macro"/>G_N_ELEMENTS()</title>
143
<indexterm><primary>G_N_ELEMENTS</primary></indexterm><programlisting>#define G_N_ELEMENTS(arr) (sizeof (arr) / sizeof ((arr)[0]))
109
<refsect2 id="G-STMT-START--CAPS" role="macro">
110
<title>G_STMT_START</title>
111
<indexterm zone="G-STMT-START--CAPS"><primary sortas="G_STMT_START">G_STMT_START</primary></indexterm><programlisting># define G_STMT_START do
114
Used within multi-statement macros so that they can be used in places where
115
only one statement is expected by the compiler.
117
<refsect2 id="G-STMT-END--CAPS" role="macro">
118
<title>G_STMT_END</title>
119
<indexterm zone="G-STMT-END--CAPS"><primary sortas="G_STMT_END">G_STMT_END</primary></indexterm><programlisting># define G_STMT_END while (0)
122
Used within multi-statement macros so that they can be used in places where
123
only one statement is expected by the compiler.
125
<refsect2 id="G-BEGIN-DECLS--CAPS" role="macro">
126
<title>G_BEGIN_DECLS</title>
127
<indexterm zone="G-BEGIN-DECLS--CAPS"><primary sortas="G_BEGIN_DECLS">G_BEGIN_DECLS</primary></indexterm><programlisting>#define G_BEGIN_DECLS</programlisting>
129
Used (along with <link linkend="G-END-DECLS--CAPS"><type>G_END_DECLS</type></link>) to bracket header files. If the
130
compiler in use is a C++ compiler, adds <literal>extern "C"</literal>
133
<refsect2 id="G-END-DECLS--CAPS" role="macro">
134
<title>G_END_DECLS</title>
135
<indexterm zone="G-END-DECLS--CAPS"><primary sortas="G_END_DECLS">G_END_DECLS</primary></indexterm><programlisting>#define G_END_DECLS</programlisting>
137
Used (along with <link linkend="G-BEGIN-DECLS--CAPS"><type>G_BEGIN_DECLS</type></link>) to bracket header files. If the
138
compiler in use is a C++ compiler, adds <literal>extern "C"</literal>
141
<refsect2 id="G-N-ELEMENTS--CAPS" role="macro">
142
<title>G_N_ELEMENTS()</title>
143
<indexterm zone="G-N-ELEMENTS--CAPS"><primary sortas="G_N_ELEMENTS">G_N_ELEMENTS</primary></indexterm><programlisting>#define G_N_ELEMENTS(arr) (sizeof (arr) / sizeof ((arr)[0]))
144
144
</programlisting>
146
146
Determines the number of elements in an array. The array must be
147
declared so the compiler knows its size at compile-time; this
147
declared so the compiler knows its size at compile-time; this
148
148
macro will not work on an array allocated on the heap, only static
149
149
arrays or arrays on the stack.
150
150
</para><variablelist role="params">
151
<varlistentry><term><parameter>arr</parameter> :</term>
151
<varlistentry><term><parameter>arr</parameter> :</term>
152
152
<listitem><simpara>the array
155
153
</simpara></listitem></varlistentry>
156
154
</variablelist></refsect2>
158
<title><anchor id="G-VA-COPY:CAPS" role="macro"/>G_VA_COPY()</title>
159
<indexterm><primary>G_VA_COPY</primary></indexterm><programlisting>#define G_VA_COPY(ap1,ap2)</programlisting>
155
<refsect2 id="G-VA-COPY--CAPS" role="macro">
156
<title>G_VA_COPY()</title>
157
<indexterm zone="G-VA-COPY--CAPS"><primary sortas="G_VA_COPY">G_VA_COPY</primary></indexterm><programlisting>#define G_VA_COPY(ap1,ap2)</programlisting>
161
159
Portable way to copy <type>va_list</type> variables.
164
In order to use this function, you must include <filename>string.h</filename>
165
yourself, because this macro may use <function><link linkend="memmove"><function>memmove()</function></link></function> and GLib
162
In order to use this function, you must include <filename>string.h</filename>
163
yourself, because this macro may use <function><link linkend="memmove"><function>memmove()</function></link></function> and GLib
166
164
does not include <function>string.h</function> for you.
167
165
</para><variablelist role="params">
168
<varlistentry><term><parameter>ap1</parameter> :</term>
166
<varlistentry><term><parameter>ap1</parameter> :</term>
169
167
<listitem><simpara>the <type>va_list</type> variable to place a copy of <parameter>ap2</parameter> in.
170
168
</simpara></listitem></varlistentry>
171
<varlistentry><term><parameter>ap2</parameter> :</term>
169
<varlistentry><term><parameter>ap2</parameter> :</term>
172
170
<listitem><simpara>a <type>va_list</type>.
175
171
</simpara></listitem></varlistentry>
176
172
</variablelist></refsect2>
178
<title><anchor id="G-STRINGIFY:CAPS" role="macro"/>G_STRINGIFY()</title>
179
<indexterm><primary>G_STRINGIFY</primary></indexterm><programlisting>#define G_STRINGIFY(macro_or_string) G_STRINGIFY_ARG (macro_or_string)
173
<refsect2 id="G-STRINGIFY--CAPS" role="macro">
174
<title>G_STRINGIFY()</title>
175
<indexterm zone="G-STRINGIFY--CAPS"><primary sortas="G_STRINGIFY">G_STRINGIFY</primary></indexterm><programlisting>#define G_STRINGIFY(macro_or_string) G_STRINGIFY_ARG (macro_or_string)
180
176
</programlisting>
182
178
Accepts a macro or a string and converts it into a string.
183
179
</para><variablelist role="params">
184
<varlistentry><term><parameter>macro_or_string</parameter> :</term>
180
<varlistentry><term><parameter>macro_or_string</parameter> :</term>
185
181
<listitem><simpara>a macro or a string.
188
182
</simpara></listitem></varlistentry>
189
183
</variablelist></refsect2>
191
<title><anchor id="G-GNUC-EXTENSION:CAPS" role="macro"/>G_GNUC_EXTENSION</title>
192
<indexterm><primary>G_GNUC_EXTENSION</primary></indexterm><programlisting>#define G_GNUC_EXTENSION</programlisting>
184
<refsect2 id="G-GNUC-EXTENSION--CAPS" role="macro">
185
<title>G_GNUC_EXTENSION</title>
186
<indexterm zone="G-GNUC-EXTENSION--CAPS"><primary sortas="G_GNUC_EXTENSION">G_GNUC_EXTENSION</primary></indexterm><programlisting>#define G_GNUC_EXTENSION</programlisting>
194
Expands to <literal>__extension__</literal> when <command>gcc</command> is
188
Expands to <literal>__extension__</literal> when <command>gcc</command> is
195
189
used as the compiler.
196
190
This simply tells <command>gcc</command> not to warn about the following non-standard code
197
191
when compiling with the <option>-pedantic</option> option.
198
192
</para></refsect2>
200
<title><anchor id="G-GNUC-CONST:CAPS" role="macro"/>G_GNUC_CONST</title>
201
<indexterm><primary>G_GNUC_CONST</primary></indexterm><programlisting>#define G_GNUC_CONST</programlisting>
193
<refsect2 id="G-GNUC-CONST--CAPS" role="macro">
194
<title>G_GNUC_CONST</title>
195
<indexterm zone="G-GNUC-CONST--CAPS"><primary sortas="G_GNUC_CONST">G_GNUC_CONST</primary></indexterm><programlisting>#define G_GNUC_CONST</programlisting>
203
Expands to the GNU C <literal>const</literal> function attribute if the compiler is
204
<command>gcc</command>. Declaring a function as const enables better optimization of calls
205
to the function. A const function doesn't examine any values except its parameters, and has no
206
effects except its return value. See the GNU C documentation for details.
197
Expands to the GNU C <literal>const</literal> function attribute if the compiler is
198
<command>gcc</command>. Declaring a function as const enables better optimization of calls
199
to the function. A const function doesn't examine any values except its parameters, and has no
200
effects except its return value. See the GNU C documentation for details.
209
A function that has pointer arguments and examines the data pointed to
210
must <emphasis>not</emphasis> be declared const. Likewise, a function that
211
calls a non-const function usually must not be const. It doesn't make sense
203
A function that has pointer arguments and examines the data pointed to
204
must <emphasis>not</emphasis> be declared const. Likewise, a function that
205
calls a non-const function usually must not be const. It doesn't make sense
212
206
for a const function to return void.
213
207
</para></note></refsect2>
215
<title><anchor id="G-GNUC-PURE:CAPS" role="macro"/>G_GNUC_PURE</title>
216
<indexterm><primary>G_GNUC_PURE</primary></indexterm><programlisting>#define G_GNUC_PURE</programlisting>
208
<refsect2 id="G-GNUC-PURE--CAPS" role="macro">
209
<title>G_GNUC_PURE</title>
210
<indexterm zone="G-GNUC-PURE--CAPS"><primary sortas="G_GNUC_PURE">G_GNUC_PURE</primary></indexterm><programlisting>#define G_GNUC_PURE</programlisting>
218
Expands to the GNU C <literal>pure</literal> function attribute if the compiler is
219
<command>gcc</command>. Declaring a function as pure enables better optimization of
220
calls to the function. A pure function has no effects except its return value and the
212
Expands to the GNU C <literal>pure</literal> function attribute if the compiler is
213
<command>gcc</command>. Declaring a function as pure enables better optimization of
214
calls to the function. A pure function has no effects except its return value and the
221
215
return value depends only on the parameters and/or global variables.
222
See the GNU C documentation for details.
225
<title><anchor id="G-GNUC-MALLOC:CAPS" role="macro" condition="since:2.6"/>G_GNUC_MALLOC</title>
226
<indexterm role="2.6"><primary>G_GNUC_MALLOC</primary></indexterm><programlisting>#define G_GNUC_MALLOC</programlisting>
228
Expands to the GNU C <literal>malloc</literal> function attribute if the compiler is
229
<command>gcc</command>. Declaring a function as malloc enables better optimization of the
230
function. A function can have the malloc attribute if it returns a pointer which is guaranteed
231
to not alias with any other pointer when the function returns (in practice, this means newly
233
See the GNU C documentation for details.
234
</para><para role="since">Since 2.6
239
<title><anchor id="G-GNUC-DEPRECATED:CAPS" role="macro" condition="since:2.2"/>G_GNUC_DEPRECATED</title>
240
<indexterm role="2.2"><primary>G_GNUC_DEPRECATED</primary></indexterm><programlisting>#define G_GNUC_DEPRECATED</programlisting>
242
Expands to the GNU C <literal>deprecated</literal> attribute if the compiler
216
See the GNU C documentation for details.
218
<refsect2 id="G-GNUC-MALLOC--CAPS" role="macro" condition="since:2.6">
219
<title>G_GNUC_MALLOC</title>
220
<indexterm zone="G-GNUC-MALLOC--CAPS" role="2.6"><primary sortas="G_GNUC_MALLOC">G_GNUC_MALLOC</primary></indexterm><programlisting>#define G_GNUC_MALLOC</programlisting>
222
Expands to the GNU C <literal>malloc</literal> function attribute if the
223
compiler is <command>gcc</command>. Declaring a function as malloc enables
224
better optimization of the function. A function can have the malloc attribute
225
if it returns a pointer which is guaranteed to not alias with any other pointer
226
when the function returns (in practice, this means newly allocated memory).
227
See the GNU C documentation for details.
228
</para><para role="since">Since 2.6</para></refsect2>
229
<refsect2 id="G-GNUC-ALLOC-SIZE--CAPS" role="macro" condition="since:2.18">
230
<title>G_GNUC_ALLOC_SIZE()</title>
231
<indexterm zone="G-GNUC-ALLOC-SIZE--CAPS" role="2.18"><primary sortas="G_GNUC_ALLOC_SIZE">G_GNUC_ALLOC_SIZE</primary></indexterm><programlisting>#define G_GNUC_ALLOC_SIZE(x)</programlisting>
233
Expands to the GNU C <literal>alloc_size</literal> function attribute if the
234
compiler is a new enough <command>gcc</command>. This attribute tells the
235
compiler that the function returns a pointer to memory of a size that is
236
specified by the <parameter>x</parameter><!-- -->th function parameter.
237
See the GNU C documentation for details.
238
</para><variablelist role="params">
239
<varlistentry><term><parameter>x</parameter> :</term>
240
<listitem><simpara>the index of the argument specifying the allocation size
241
</simpara></listitem></varlistentry>
242
</variablelist><para role="since">Since 2.18</para></refsect2>
243
<refsect2 id="G-GNUC-ALLOC-SIZE2--CAPS" role="macro" condition="since:2.18">
244
<title>G_GNUC_ALLOC_SIZE2()</title>
245
<indexterm zone="G-GNUC-ALLOC-SIZE2--CAPS" role="2.18"><primary sortas="G_GNUC_ALLOC_SIZE2">G_GNUC_ALLOC_SIZE2</primary></indexterm><programlisting>#define G_GNUC_ALLOC_SIZE2(x,y)</programlisting>
247
Expands to the GNU C <literal>alloc_size</literal> function attribute if the
248
compiler is a new enough <command>gcc</command>. This attribute tells the
249
compiler that the function returns a pointer to memory of a size that is
250
specified by the product of two function parameters.
251
See the GNU C documentation for details.
252
</para><variablelist role="params">
253
<varlistentry><term><parameter>x</parameter> :</term>
254
<listitem><simpara>the index of the argument specifying one factor of the allocation size
255
</simpara></listitem></varlistentry>
256
<varlistentry><term><parameter>y</parameter> :</term>
257
<listitem><simpara>the index of the argument specifying the second factor of the allocation size
258
</simpara></listitem></varlistentry>
259
</variablelist><para role="since">Since 2.18</para></refsect2>
260
<refsect2 id="G-GNUC-DEPRECATED--CAPS" role="macro" condition="since:2.2">
261
<title>G_GNUC_DEPRECATED</title>
262
<indexterm zone="G-GNUC-DEPRECATED--CAPS" role="2.2"><primary sortas="G_GNUC_DEPRECATED">G_GNUC_DEPRECATED</primary></indexterm><programlisting>#define G_GNUC_DEPRECATED</programlisting>
264
Expands to the GNU C <literal>deprecated</literal> attribute if the compiler
243
265
is <command>gcc</command>.
244
It can be used to mark typedefs, variables and functions as deprecated.
245
When called with the <option>-Wdeprecated</option> option, the compiler will
266
It can be used to mark typedefs, variables and functions as deprecated.
267
When called with the <option>-Wdeprecated</option> option, the compiler will
246
268
generate warnings when deprecated interfaces are used.
247
See the GNU C documentation for details.
248
</para><para role="since">Since 2.2
253
<title><anchor id="G-GNUC-NORETURN:CAPS" role="macro"/>G_GNUC_NORETURN</title>
254
<indexterm><primary>G_GNUC_NORETURN</primary></indexterm><programlisting>#define G_GNUC_NORETURN</programlisting>
269
See the GNU C documentation for details.
270
</para><para role="since">Since 2.2</para></refsect2>
271
<refsect2 id="G-GNUC-NORETURN--CAPS" role="macro">
272
<title>G_GNUC_NORETURN</title>
273
<indexterm zone="G-GNUC-NORETURN--CAPS"><primary sortas="G_GNUC_NORETURN">G_GNUC_NORETURN</primary></indexterm><programlisting>#define G_GNUC_NORETURN</programlisting>
256
Expands to the GNU C <literal>noreturn</literal> function attribute if the
275
Expands to the GNU C <literal>noreturn</literal> function attribute if the
257
276
compiler is <command>gcc</command>. It is used for declaring functions which never return.
258
277
It enables optimization of the function, and avoids possible compiler
259
warnings. See the GNU C documentation for details.
278
warnings. See the GNU C documentation for details.
260
279
</para></refsect2>
262
<title><anchor id="G-GNUC-UNUSED:CAPS" role="macro"/>G_GNUC_UNUSED</title>
263
<indexterm><primary>G_GNUC_UNUSED</primary></indexterm><programlisting>#define G_GNUC_UNUSED</programlisting>
280
<refsect2 id="G-GNUC-UNUSED--CAPS" role="macro">
281
<title>G_GNUC_UNUSED</title>
282
<indexterm zone="G-GNUC-UNUSED--CAPS"><primary sortas="G_GNUC_UNUSED">G_GNUC_UNUSED</primary></indexterm><programlisting>#define G_GNUC_UNUSED</programlisting>
265
Expands to the GNU C <literal>unused</literal> function attribute if the compiler is
284
Expands to the GNU C <literal>unused</literal> function attribute if the compiler is
266
285
<command>gcc</command>. It is used for declaring functions which may never be used.
267
It avoids possible compiler warnings. See the GNU C documentation for details.
286
It avoids possible compiler warnings. See the GNU C documentation for details.
268
287
</para></refsect2>
270
<title><anchor id="G-GNUC-PRINTF:CAPS" role="macro"/>G_GNUC_PRINTF()</title>
271
<indexterm><primary>G_GNUC_PRINTF</primary></indexterm><programlisting>#define G_GNUC_PRINTF( format_idx, arg_idx )</programlisting>
288
<refsect2 id="G-GNUC-PRINTF--CAPS" role="macro">
289
<title>G_GNUC_PRINTF()</title>
290
<indexterm zone="G-GNUC-PRINTF--CAPS"><primary sortas="G_GNUC_PRINTF">G_GNUC_PRINTF</primary></indexterm><programlisting>#define G_GNUC_PRINTF( format_idx, arg_idx )</programlisting>
273
Expands to the GNU C <literal>format</literal> function attribute if the compiler is
292
Expands to the GNU C <literal>format</literal> function attribute if the compiler is
274
293
<command>gcc</command>. This is used for declaring functions which take a variable number of
275
294
arguments, with the same syntax as <function><link linkend="printf"><function>printf()</function></link></function>.
276
295
It allows the compiler to type-check the arguments passed to the function.
277
See the GNU C documentation for details.
296
See the GNU C documentation for details.
279
298
<informalexample><programlisting>
280
299
gint g_snprintf (gchar *string,
282
301
gchar const *format,
283
302
...) G_GNUC_PRINTF (3, 4);
284
303
</programlisting></informalexample><variablelist role="params">
285
<varlistentry><term><parameter>format_idx</parameter> :</term>
304
<varlistentry><term><parameter>format_idx</parameter> :</term>
286
305
<listitem><simpara>the index of the argument corresponding to the format string.
287
306
(The arguments are numbered from 1).
288
307
</simpara></listitem></varlistentry>
289
<varlistentry><term><parameter>arg_idx</parameter> :</term>
308
<varlistentry><term><parameter>arg_idx</parameter> :</term>
290
309
<listitem><simpara>the index of the first of the format arguments.
293
310
</simpara></listitem></varlistentry>
294
311
</variablelist></refsect2>
296
<title><anchor id="G-GNUC-SCANF:CAPS" role="macro"/>G_GNUC_SCANF()</title>
297
<indexterm><primary>G_GNUC_SCANF</primary></indexterm><programlisting>#define G_GNUC_SCANF( format_idx, arg_idx )</programlisting>
312
<refsect2 id="G-GNUC-SCANF--CAPS" role="macro">
313
<title>G_GNUC_SCANF()</title>
314
<indexterm zone="G-GNUC-SCANF--CAPS"><primary sortas="G_GNUC_SCANF">G_GNUC_SCANF</primary></indexterm><programlisting>#define G_GNUC_SCANF( format_idx, arg_idx )</programlisting>
299
316
Expands to the GNU C <literal>format</literal> function attribute if the compiler is <command>gcc</command>.
300
317
This is used for declaring functions which take a variable number of
301
318
arguments, with the same syntax as <function><link linkend="scanf"><function>scanf()</function></link></function>.
302
319
It allows the compiler to type-check the arguments passed to the function.
303
See the GNU C documentation for details.
320
See the GNU C documentation for details.
304
321
</para><variablelist role="params">
305
<varlistentry><term><parameter>format_idx</parameter> :</term>
322
<varlistentry><term><parameter>format_idx</parameter> :</term>
306
323
<listitem><simpara>the index of the argument corresponding to the format string.
307
324
(The arguments are numbered from 1).
308
325
</simpara></listitem></varlistentry>
309
<varlistentry><term><parameter>arg_idx</parameter> :</term>
326
<varlistentry><term><parameter>arg_idx</parameter> :</term>
310
327
<listitem><simpara>the index of the first of the format arguments.
313
328
</simpara></listitem></varlistentry>
314
329
</variablelist></refsect2>
316
<title><anchor id="G-GNUC-FORMAT:CAPS" role="macro"/>G_GNUC_FORMAT()</title>
317
<indexterm><primary>G_GNUC_FORMAT</primary></indexterm><programlisting>#define G_GNUC_FORMAT( arg_idx )</programlisting>
330
<refsect2 id="G-GNUC-FORMAT--CAPS" role="macro">
331
<title>G_GNUC_FORMAT()</title>
332
<indexterm zone="G-GNUC-FORMAT--CAPS"><primary sortas="G_GNUC_FORMAT">G_GNUC_FORMAT</primary></indexterm><programlisting>#define G_GNUC_FORMAT( arg_idx )</programlisting>
319
334
Expands to the GNU C <literal>format_arg</literal> function attribute if the compiler is <command>gcc</command>.
320
335
This function attribute specifies that a function takes a format
321
string for a <function><link linkend="printf"><function>printf()</function></link></function>, <function><link linkend="scanf"><function>scanf()</function></link></function>,
322
<function><link linkend="strftime"><function>strftime()</function></link></function> or <function><link linkend="strfmon"><function>strfmon()</function></link></function> style
323
function and modifies it, so that the result can be passed to a
324
<function><link linkend="printf"><function>printf()</function></link></function>, <function><link linkend="scanf"><function>scanf()</function></link></function>,
325
<function><link linkend="strftime"><function>strftime()</function></link></function> or <function><link linkend="strfmon"><function>strfmon()</function></link></function> style
326
function (with the remaining arguments to the format function the same as
327
they would have been for the unmodified string).
328
See the GNU C documentation for details.
336
string for a <function><link linkend="printf"><function>printf()</function></link></function>, <function><link linkend="scanf"><function>scanf()</function></link></function>,
337
<function><link linkend="strftime"><function>strftime()</function></link></function> or <function><link linkend="strfmon"><function>strfmon()</function></link></function> style
338
function and modifies it, so that the result can be passed to a
339
<function><link linkend="printf"><function>printf()</function></link></function>, <function><link linkend="scanf"><function>scanf()</function></link></function>,
340
<function><link linkend="strftime"><function>strftime()</function></link></function> or <function><link linkend="strfmon"><function>strfmon()</function></link></function> style
341
function (with the remaining arguments to the format function the same as
342
they would have been for the unmodified string).
343
See the GNU C documentation for details.
330
345
<informalexample><programlisting>
331
346
gchar *g_dgettext (gchar *domain_name, gchar *msgid) G_GNUC_FORMAT (2);
332
347
</programlisting></informalexample><variablelist role="params">
333
<varlistentry><term><parameter>arg_idx</parameter> :</term>
348
<varlistentry><term><parameter>arg_idx</parameter> :</term>
334
349
<listitem><simpara>the index of the argument.
337
350
</simpara></listitem></varlistentry>
338
351
</variablelist></refsect2>
340
<title><anchor id="G-GNUC-NULL-TERMINATED:CAPS" role="macro"/>G_GNUC_NULL_TERMINATED</title>
341
<indexterm><primary>G_GNUC_NULL_TERMINATED</primary></indexterm><programlisting>#define G_GNUC_NULL_TERMINATED</programlisting>
352
<refsect2 id="G-GNUC-NULL-TERMINATED--CAPS" role="macro">
353
<title>G_GNUC_NULL_TERMINATED</title>
354
<indexterm zone="G-GNUC-NULL-TERMINATED--CAPS"><primary sortas="G_GNUC_NULL_TERMINATED">G_GNUC_NULL_TERMINATED</primary></indexterm><programlisting>#define G_GNUC_NULL_TERMINATED</programlisting>
343
Expands to the GNU C <literal>sentinel</literal> function attribute if the
356
Expands to the GNU C <literal>sentinel</literal> function attribute if the
344
357
compiler is <command>gcc</command>, or "" if it isn't. This function attribute
345
only applies to variadic functions and instructs the compiler to check that
346
the argument list is terminated with an explicit <link linkend="NULL:CAPS"><literal>NULL</literal></link>.
347
See the GNU C documentation for details.
358
only applies to variadic functions and instructs the compiler to check that
359
the argument list is terminated with an explicit <link linkend="NULL--CAPS"><literal>NULL</literal></link>.
360
See the GNU C documentation for details.
350
362
Since: 2.8</refsect2>
352
<title><anchor id="G-GNUC-WARN-UNUSED-RESULT:CAPS" role="macro" condition="since:2.10"/>G_GNUC_WARN_UNUSED_RESULT</title>
353
<indexterm role="2.10"><primary>G_GNUC_WARN_UNUSED_RESULT</primary></indexterm><programlisting>#define G_GNUC_WARN_UNUSED_RESULT</programlisting>
363
<refsect2 id="G-GNUC-WARN-UNUSED-RESULT--CAPS" role="macro" condition="since:2.10">
364
<title>G_GNUC_WARN_UNUSED_RESULT</title>
365
<indexterm zone="G-GNUC-WARN-UNUSED-RESULT--CAPS" role="2.10"><primary sortas="G_GNUC_WARN_UNUSED_RESULT">G_GNUC_WARN_UNUSED_RESULT</primary></indexterm><programlisting>#define G_GNUC_WARN_UNUSED_RESULT</programlisting>
355
Expands to the GNU C <literal>warn_unused_result</literal> function attribute
356
if the compiler is <command>gcc</command>, or "" if it isn't. This function
367
Expands to the GNU C <literal>warn_unused_result</literal> function attribute
368
if the compiler is <command>gcc</command>, or "" if it isn't. This function
357
369
attribute makes the compiler emit a warning if the result of a function call
358
is ignored. See the GNU C documentation for details.
359
</para><para role="since">Since 2.10
364
<title><anchor id="G-GNUC-FUNCTION:CAPS" role="macro" condition="deprecated:2.16"/>G_GNUC_FUNCTION</title>
365
<indexterm role="deprecated"><primary>G_GNUC_FUNCTION</primary></indexterm><programlisting>#define G_GNUC_FUNCTION</programlisting>
370
is ignored. See the GNU C documentation for details.
371
</para><para role="since">Since 2.10</para></refsect2>
372
<refsect2 id="G-GNUC-FUNCTION--CAPS" role="macro" condition="deprecated:2.16">
373
<title>G_GNUC_FUNCTION</title>
374
<indexterm zone="G-GNUC-FUNCTION--CAPS" role="deprecated"><primary sortas="G_GNUC_FUNCTION">G_GNUC_FUNCTION</primary></indexterm><programlisting>#define G_GNUC_FUNCTION</programlisting>
366
375
<warning><para><literal>G_GNUC_FUNCTION</literal> is deprecated and should not be used in newly-written code. 2.16</para></warning>
368
377
Expands to "" on all modern compilers, and to <literal>__FUNCTION__</literal>
369
378
on <command>gcc</command> version 2.x. Don't use it.
370
379
</para></refsect2>
372
<title><anchor id="G-GNUC-PRETTY-FUNCTION:CAPS" role="macro" condition="deprecated:2.16"/>G_GNUC_PRETTY_FUNCTION</title>
373
<indexterm role="deprecated"><primary>G_GNUC_PRETTY_FUNCTION</primary></indexterm><programlisting>#define G_GNUC_PRETTY_FUNCTION</programlisting>
380
<refsect2 id="G-GNUC-PRETTY-FUNCTION--CAPS" role="macro" condition="deprecated:2.16">
381
<title>G_GNUC_PRETTY_FUNCTION</title>
382
<indexterm zone="G-GNUC-PRETTY-FUNCTION--CAPS" role="deprecated"><primary sortas="G_GNUC_PRETTY_FUNCTION">G_GNUC_PRETTY_FUNCTION</primary></indexterm><programlisting>#define G_GNUC_PRETTY_FUNCTION</programlisting>
374
383
<warning><para><literal>G_GNUC_PRETTY_FUNCTION</literal> is deprecated and should not be used in newly-written code. 2.16</para></warning>
376
Expands to "" on all modern compilers, and to
377
<literal>__PRETTY_FUNCTION__</literal> on <command>gcc</command> version 2.x.
385
Expands to "" on all modern compilers, and to
386
<literal>__PRETTY_FUNCTION__</literal> on <command>gcc</command> version 2.x.
379
388
</para></refsect2>
381
<title><anchor id="G-GNUC-NO-INSTRUMENT:CAPS" role="macro"/>G_GNUC_NO_INSTRUMENT</title>
382
<indexterm><primary>G_GNUC_NO_INSTRUMENT</primary></indexterm><programlisting>#define G_GNUC_NO_INSTRUMENT</programlisting>
389
<refsect2 id="G-GNUC-NO-INSTRUMENT--CAPS" role="macro">
390
<title>G_GNUC_NO_INSTRUMENT</title>
391
<indexterm zone="G-GNUC-NO-INSTRUMENT--CAPS"><primary sortas="G_GNUC_NO_INSTRUMENT">G_GNUC_NO_INSTRUMENT</primary></indexterm><programlisting>#define G_GNUC_NO_INSTRUMENT</programlisting>
384
Expands to the GNU C <literal>no_instrument_function</literal> function
385
attribute if the compiler is <command>gcc</command>. Functions with this
386
attribute will not be
393
Expands to the GNU C <literal>no_instrument_function</literal> function
394
attribute if the compiler is <command>gcc</command>. Functions with this
395
attribute will not be
387
396
instrumented for profiling, when the compiler is called with the
388
397
<option>-finstrument-functions</option> option.
389
See the GNU C documentation for details.
398
See the GNU C documentation for details.
390
399
</para></refsect2>
392
<title><anchor id="G-HAVE-GNUC-VISIBILITY:CAPS" role="macro"/>G_HAVE_GNUC_VISIBILITY</title>
393
<indexterm><primary>G_HAVE_GNUC_VISIBILITY</primary></indexterm><programlisting>#define G_HAVE_GNUC_VISIBILITY 1
396
This macro is defined as 1 if the the compiler supports ELF visibility
397
attributes (currently only <command>gcc</command>).
400
Since: 2.6</refsect2>
402
<title><anchor id="G-GNUC-INTERNAL:CAPS" role="macro"/>G_GNUC_INTERNAL</title>
403
<indexterm><primary>G_GNUC_INTERNAL</primary></indexterm><programlisting>#define G_GNUC_INTERNAL</programlisting>
405
This attribute can be used for marking library functions as being used
400
<refsect2 id="G-GNUC-INTERNAL--CAPS" role="macro">
401
<title>G_GNUC_INTERNAL</title>
402
<indexterm zone="G-GNUC-INTERNAL--CAPS"><primary sortas="G_GNUC_INTERNAL">G_GNUC_INTERNAL</primary></indexterm><programlisting>#define G_GNUC_INTERNAL</programlisting>
404
This attribute can be used for marking library functions as being used
406
405
internally to the library only, which may allow the compiler to handle
407
function calls more efficiently.
408
Note that static functions do not need to be marked as internal in this way.
409
See the GNU C documentation for details.
406
function calls more efficiently.
407
Note that static functions do not need to be marked as internal in this way.
408
See the GNU C documentation for details.
412
When using a compiler that supports the GNU C hidden visibility attribute,
411
When using a compiler that supports the GNU C hidden visibility attribute,
413
412
this macro expands to <literal>__attribute__((visibility("hidden")))</literal>.
414
413
When using the Sun Studio compiler, it expands to <literal>__hidden</literal>.
417
416
Note that for portability, the attribute should be placed before the
418
function declaration. While GCC allows the macro after the declaration,
417
function declaration. While GCC allows the macro after the declaration,
419
418
Sun Studio does not.
421
420
<informalexample><programlisting>
529
520
</programlisting>
530
521
</informalexample>
531
522
</para></refsect2>
533
<title><anchor id="G-GUINT16-FORMAT:CAPS" role="macro"/>G_GUINT16_FORMAT</title>
534
<indexterm><primary>G_GUINT16_FORMAT</primary></indexterm><programlisting>#define G_GUINT16_FORMAT "hu"
537
This is the platform dependent conversion specifier for scanning and
538
printing values of type <link linkend="guint16"><type>guint16</type></link>. See also <link linkend="G-GINT16-FORMAT:CAPS"><type>G_GINT16_FORMAT</type></link>.
541
<title><anchor id="G-GINT32-MODIFIER:CAPS" role="macro" condition="since:2.4"/>G_GINT32_MODIFIER</title>
542
<indexterm role="2.4"><primary>G_GINT32_MODIFIER</primary></indexterm><programlisting>#define G_GINT32_MODIFIER ""
545
The platform dependent length modifier for constructing <link linkend="printf"><function>printf()</function></link> conversion
546
specifiers for values of type <link linkend="gint32"><type>gint32</type></link> or <link linkend="guint32"><type>guint32</type></link>. See also <link linkend="G-GINT16-MODIFIER:CAPS"><type>G_GINT16_MODIFIER</type></link>.
547
</para><para role="since">Since 2.4
552
<title><anchor id="G-GINT32-FORMAT:CAPS" role="macro"/>G_GINT32_FORMAT</title>
553
<indexterm><primary>G_GINT32_FORMAT</primary></indexterm><programlisting>#define G_GINT32_FORMAT "i"
556
This is the platform dependent conversion specifier for scanning and
557
printing values of type <link linkend="gint32"><type>gint32</type></link>. See also <link linkend="G-GINT16-FORMAT:CAPS"><type>G_GINT16_FORMAT</type></link>.
560
<title><anchor id="G-GUINT32-FORMAT:CAPS" role="macro"/>G_GUINT32_FORMAT</title>
561
<indexterm><primary>G_GUINT32_FORMAT</primary></indexterm><programlisting>#define G_GUINT32_FORMAT "u"
564
This is the platform dependent conversion specifier for scanning and
565
printing values of type <link linkend="guint32"><type>guint32</type></link>. See also <link linkend="G-GINT16-FORMAT:CAPS"><type>G_GINT16_FORMAT</type></link>.
568
<title><anchor id="G-GINT64-MODIFIER:CAPS" role="macro" condition="since:2.4"/>G_GINT64_MODIFIER</title>
569
<indexterm role="2.4"><primary>G_GINT64_MODIFIER</primary></indexterm><programlisting>#define G_GINT64_MODIFIER "ll"
572
The platform dependent length modifier for constructing <link linkend="printf"><function>printf()</function></link> conversion
573
specifiers for values of type <link linkend="gint64"><type>gint64</type></link> or <link linkend="guint64"><type>guint64</type></link>. See also <link linkend="G-GINT16-MODIFIER:CAPS"><type>G_GINT16_MODIFIER</type></link>.
523
<refsect2 id="G-GUINT16-FORMAT--CAPS" role="macro">
524
<title>G_GUINT16_FORMAT</title>
525
<indexterm zone="G-GUINT16-FORMAT--CAPS"><primary sortas="G_GUINT16_FORMAT">G_GUINT16_FORMAT</primary></indexterm><programlisting>#define G_GUINT16_FORMAT "hu"
528
This is the platform dependent conversion specifier for scanning and
529
printing values of type <link linkend="guint16"><type>guint16</type></link>. See also <link linkend="G-GINT16-FORMAT--CAPS"><type>G_GINT16_FORMAT</type></link>.
531
<refsect2 id="G-GINT32-MODIFIER--CAPS" role="macro" condition="since:2.4">
532
<title>G_GINT32_MODIFIER</title>
533
<indexterm zone="G-GINT32-MODIFIER--CAPS" role="2.4"><primary sortas="G_GINT32_MODIFIER">G_GINT32_MODIFIER</primary></indexterm><programlisting>#define G_GINT32_MODIFIER ""
536
The platform dependent length modifier for constructing <link linkend="printf"><function>printf()</function></link> conversion
537
specifiers for values of type <link linkend="gint32"><type>gint32</type></link> or <link linkend="guint32"><type>guint32</type></link>. See also <link linkend="G-GINT16-MODIFIER--CAPS"><type>G_GINT16_MODIFIER</type></link>.
538
</para><para role="since">Since 2.4</para></refsect2>
539
<refsect2 id="G-GINT32-FORMAT--CAPS" role="macro">
540
<title>G_GINT32_FORMAT</title>
541
<indexterm zone="G-GINT32-FORMAT--CAPS"><primary sortas="G_GINT32_FORMAT">G_GINT32_FORMAT</primary></indexterm><programlisting>#define G_GINT32_FORMAT "i"
544
This is the platform dependent conversion specifier for scanning and
545
printing values of type <link linkend="gint32"><type>gint32</type></link>. See also <link linkend="G-GINT16-FORMAT--CAPS"><type>G_GINT16_FORMAT</type></link>.
547
<refsect2 id="G-GUINT32-FORMAT--CAPS" role="macro">
548
<title>G_GUINT32_FORMAT</title>
549
<indexterm zone="G-GUINT32-FORMAT--CAPS"><primary sortas="G_GUINT32_FORMAT">G_GUINT32_FORMAT</primary></indexterm><programlisting>#define G_GUINT32_FORMAT "u"
552
This is the platform dependent conversion specifier for scanning and
553
printing values of type <link linkend="guint32"><type>guint32</type></link>. See also <link linkend="G-GINT16-FORMAT--CAPS"><type>G_GINT16_FORMAT</type></link>.
555
<refsect2 id="G-GINT64-MODIFIER--CAPS" role="macro" condition="since:2.4">
556
<title>G_GINT64_MODIFIER</title>
557
<indexterm zone="G-GINT64-MODIFIER--CAPS" role="2.4"><primary sortas="G_GINT64_MODIFIER">G_GINT64_MODIFIER</primary></indexterm><programlisting>#define G_GINT64_MODIFIER "ll"
560
The platform dependent length modifier for constructing <link linkend="printf"><function>printf()</function></link> conversion
561
specifiers for values of type <link linkend="gint64"><type>gint64</type></link> or <link linkend="guint64"><type>guint64</type></link>. See also <link linkend="G-GINT16-MODIFIER--CAPS"><type>G_GINT16_MODIFIER</type></link>.
578
565
Some platforms do not support printing 64 bit integers,
579
even though the types are supported. On such platforms <link linkend="G-GINT64-MODIFIER:CAPS"><type>G_GINT64_MODIFIER</type></link>
566
even though the types are supported. On such platforms <link linkend="G-GINT64-MODIFIER--CAPS"><type>G_GINT64_MODIFIER</type></link>
582
</note><para role="since">Since 2.4
587
<title><anchor id="G-GINT64-FORMAT:CAPS" role="macro"/>G_GINT64_FORMAT</title>
588
<indexterm><primary>G_GINT64_FORMAT</primary></indexterm><programlisting>#define G_GINT64_FORMAT "lli"
569
</note><para role="since">Since 2.4</para></refsect2>
570
<refsect2 id="G-GINT64-FORMAT--CAPS" role="macro">
571
<title>G_GINT64_FORMAT</title>
572
<indexterm zone="G-GINT64-FORMAT--CAPS"><primary sortas="G_GINT64_FORMAT">G_GINT64_FORMAT</primary></indexterm><programlisting>#define G_GINT64_FORMAT "lli"
589
573
</programlisting>
591
575
This is the platform dependent conversion specifier for scanning and
592
printing values of type <link linkend="gint64"><type>gint64</type></link>. See also <link linkend="G-GINT16-FORMAT:CAPS"><type>G_GINT16_FORMAT</type></link>.
576
printing values of type <link linkend="gint64"><type>gint64</type></link>. See also <link linkend="G-GINT16-FORMAT--CAPS"><type>G_GINT16_FORMAT</type></link>.
597
580
Some platforms do not support scanning and printing 64 bit integers,
598
even though the types are supported. On such platforms <link linkend="G-GINT64-FORMAT:CAPS"><type>G_GINT64_FORMAT</type></link>
581
even though the types are supported. On such platforms <link linkend="G-GINT64-FORMAT--CAPS"><type>G_GINT64_FORMAT</type></link>
599
582
is not defined. Note that <link linkend="scanf"><function>scanf()</function></link> may not support 64 bit integers, even
600
if <link linkend="G-GINT64-FORMAT:CAPS"><type>G_GINT64_FORMAT</type></link> is defined. Due to its weak error handling, <link linkend="scanf"><function>scanf()</function></link> is not
583
if <link linkend="G-GINT64-FORMAT--CAPS"><type>G_GINT64_FORMAT</type></link> is defined. Due to its weak error handling, <link linkend="scanf"><function>scanf()</function></link> is not
601
584
recommended for parsing anyway; consider using <link linkend="g-strtoull"><function>g_strtoull()</function></link> instead.
603
586
</note></refsect2>
605
<title><anchor id="G-GUINT64-FORMAT:CAPS" role="macro"/>G_GUINT64_FORMAT</title>
606
<indexterm><primary>G_GUINT64_FORMAT</primary></indexterm><programlisting>#define G_GUINT64_FORMAT "llu"
587
<refsect2 id="G-GUINT64-FORMAT--CAPS" role="macro">
588
<title>G_GUINT64_FORMAT</title>
589
<indexterm zone="G-GUINT64-FORMAT--CAPS"><primary sortas="G_GUINT64_FORMAT">G_GUINT64_FORMAT</primary></indexterm><programlisting>#define G_GUINT64_FORMAT "llu"
607
590
</programlisting>
609
592
This is the platform dependent conversion specifier for scanning and
610
printing values of type <link linkend="guint64"><type>guint64</type></link>. See also <link linkend="G-GINT16-FORMAT:CAPS"><type>G_GINT16_FORMAT</type></link>.
593
printing values of type <link linkend="guint64"><type>guint64</type></link>. See also <link linkend="G-GINT16-FORMAT--CAPS"><type>G_GINT16_FORMAT</type></link>.
615
597
Some platforms do not support scanning and printing 64 bit integers,
616
even though the types are supported. On such platforms <link linkend="G-GUINT64-FORMAT:CAPS"><type>G_GUINT64_FORMAT</type></link>
598
even though the types are supported. On such platforms <link linkend="G-GUINT64-FORMAT--CAPS"><type>G_GUINT64_FORMAT</type></link>
617
599
is not defined. Note that <link linkend="scanf"><function>scanf()</function></link> may not support 64 bit integers, even
618
if <link linkend="G-GINT64-FORMAT:CAPS"><type>G_GINT64_FORMAT</type></link> is defined. Due to its weak error handling, <link linkend="scanf"><function>scanf()</function></link> is not
600
if <link linkend="G-GINT64-FORMAT--CAPS"><type>G_GINT64_FORMAT</type></link> is defined. Due to its weak error handling, <link linkend="scanf"><function>scanf()</function></link> is not
619
601
recommended for parsing anyway; consider using <link linkend="g-strtoull"><function>g_strtoull()</function></link> instead.
621
603
</note></refsect2>
623
<title><anchor id="G-GSIZE-MODIFIER:CAPS" role="macro" condition="since:2.6"/>G_GSIZE_MODIFIER</title>
624
<indexterm role="2.6"><primary>G_GSIZE_MODIFIER</primary></indexterm><programlisting>#define G_GSIZE_MODIFIER ""
604
<refsect2 id="G-GSIZE-MODIFIER--CAPS" role="macro" condition="since:2.6">
605
<title>G_GSIZE_MODIFIER</title>
606
<indexterm zone="G-GSIZE-MODIFIER--CAPS" role="2.6"><primary sortas="G_GSIZE_MODIFIER">G_GSIZE_MODIFIER</primary></indexterm><programlisting>#define G_GSIZE_MODIFIER ""
625
607
</programlisting>
627
609
The platform dependent length modifier for constructing <link linkend="printf"><function>printf()</function></link> conversion
628
specifiers for values of type <link linkend="gsize"><type>gsize</type></link> or <link linkend="gssize"><type>gssize</type></link>. See also <link linkend="G-GINT16-MODIFIER:CAPS"><type>G_GINT16_MODIFIER</type></link>.
629
</para><para role="since">Since 2.6
634
<title><anchor id="G-GSIZE-FORMAT:CAPS" role="macro" condition="since:2.6"/>G_GSIZE_FORMAT</title>
635
<indexterm role="2.6"><primary>G_GSIZE_FORMAT</primary></indexterm><programlisting>#define G_GSIZE_FORMAT "u"
638
This is the platform dependent conversion specifier for scanning and
639
printing values of type <link linkend="gsize"><type>gsize</type></link>. See also <link linkend="G-GINT16-FORMAT:CAPS"><type>G_GINT16_FORMAT</type></link>.
640
</para><para role="since">Since 2.6
645
<title><anchor id="G-GSSIZE-FORMAT:CAPS" role="macro" condition="since:2.6"/>G_GSSIZE_FORMAT</title>
646
<indexterm role="2.6"><primary>G_GSSIZE_FORMAT</primary></indexterm><programlisting>#define G_GSSIZE_FORMAT "i"
649
This is the platform dependent conversion specifier for scanning and
650
printing values of type <link linkend="gssize"><type>gssize</type></link>. See also <link linkend="G-GINT16-FORMAT:CAPS"><type>G_GINT16_FORMAT</type></link>.
651
</para><para role="since">Since 2.6
610
specifiers for values of type <link linkend="gsize"><type>gsize</type></link> or <link linkend="gssize"><type>gssize</type></link>. See also <link linkend="G-GINT16-MODIFIER--CAPS"><type>G_GINT16_MODIFIER</type></link>.
611
</para><para role="since">Since 2.6</para></refsect2>
612
<refsect2 id="G-GSIZE-FORMAT--CAPS" role="macro" condition="since:2.6">
613
<title>G_GSIZE_FORMAT</title>
614
<indexterm zone="G-GSIZE-FORMAT--CAPS" role="2.6"><primary sortas="G_GSIZE_FORMAT">G_GSIZE_FORMAT</primary></indexterm><programlisting>#define G_GSIZE_FORMAT "u"
617
This is the platform dependent conversion specifier for scanning and
618
printing values of type <link linkend="gsize"><type>gsize</type></link>. See also <link linkend="G-GINT16-FORMAT--CAPS"><type>G_GINT16_FORMAT</type></link>.
619
</para><para role="since">Since 2.6</para></refsect2>
620
<refsect2 id="G-GSSIZE-FORMAT--CAPS" role="macro" condition="since:2.6">
621
<title>G_GSSIZE_FORMAT</title>
622
<indexterm zone="G-GSSIZE-FORMAT--CAPS" role="2.6"><primary sortas="G_GSSIZE_FORMAT">G_GSSIZE_FORMAT</primary></indexterm><programlisting>#define G_GSSIZE_FORMAT "i"
625
This is the platform dependent conversion specifier for scanning and
626
printing values of type <link linkend="gssize"><type>gssize</type></link>. See also <link linkend="G-GINT16-FORMAT--CAPS"><type>G_GINT16_FORMAT</type></link>.
627
</para><para role="since">Since 2.6</para></refsect2>
662
<refsect1><refsect2 /><refsect2 /></refsect1>