1 <!-- ##### SECTION Title ##### -->
4 <!-- ##### SECTION Short_Description ##### -->
5 specialised macros which are not used often.
7 <!-- ##### SECTION Long_Description ##### -->
9 These macros provide more specialized features which are not needed so often
10 by application programmers.
13 <!-- ##### SECTION See_Also ##### -->
18 <!-- ##### MACRO G_INLINE_FUNC ##### -->
20 Used to declare inline functions. If inline functions are not supported on
21 the particular platform, the macro evaluates to the empty string.
26 <!-- ##### MACRO G_STMT_START ##### -->
28 Used within multi-statement macros so that they can be used in places where
29 only one statement is expected by the compiler.
34 <!-- ##### MACRO G_STMT_END ##### -->
36 Used within multi-statement macros so that they can be used in places where
37 only one statement is expected by the compiler.
42 <!-- ##### MACRO G_BEGIN_DECLS ##### -->
44 Used (along with #G_END_DECLS) to bracket header files. If the
45 compiler in use is a C++ compiler, adds 'extern "C"' around the header.
50 <!-- ##### MACRO G_END_DECLS ##### -->
52 Used (along with #G_BEGIN_DECLS) to bracket header files. If the
53 compiler in use is a C++ compiler, adds 'extern "C"' around the header.
58 <!-- ##### MACRO G_N_ELEMENTS ##### -->
60 Determines the number of elements in an array. The array must be
61 declared so the compiler knows its size at compile-time; this
62 macro will not work on an array allocated on the heap, only static
63 arrays or arrays on the stack.
69 <!-- ##### MACRO G_VA_COPY ##### -->
71 Portable way to copy <type>va_list</type> variables.
74 <!-- # Unused Parameters # -->
75 @ap1: the <type>va_list</type> variable to place a copy of @ap2 in.
76 @ap2: a <type>va_list</type>.
79 <!-- ##### MACRO G_STRINGIFY ##### -->
87 <!-- ##### MACRO G_GNUC_EXTENSION ##### -->
89 Expands to "__extension__" when GNU C is used as the compiler.
90 This simply tells GNU C not to warn about the following non-standard code
91 when compiling with the -pedantic option.
96 <!-- ##### MACRO G_GNUC_CONST ##### -->
98 Expands to the GNU C const function attribute if the compiler is GNU C.
99 This enables optimization of the function.
100 See the GNU C documentation for details.
105 <!-- ##### MACRO G_GNUC_NORETURN ##### -->
107 Expands to the GNU C noreturn function attribute if the compiler is GNU C.
108 It is used for declaring functions which never return.
109 It enables optimization of the function, and avoids possible compiler
110 warnings. See the GNU C documentation for details.
115 <!-- ##### MACRO G_GNUC_UNUSED ##### -->
117 Expands to the GNU C unused function attribute if the compiler is GNU C.
118 It is used for declaring functions which may never be used.
119 It avoids possible compiler warnings. See the GNU C documentation for details.
124 <!-- ##### MACRO G_GNUC_PURE ##### -->
131 <!-- ##### MACRO G_GNUC_PRINTF ##### -->
133 Expands to the GNU C format function attribute if the compiler is GNU C.
134 This is used for declaring functions which take a variable number of
135 arguments, with the same syntax as <function>printf()</function>.
136 It allows the compiler to type-check the arguments passed to the function.
137 See the GNU C documentation for details.
140 @format_idx: the index of the argument corresponding to the format string.
141 (The arguments are numbered from 1).
142 @arg_idx: the index of the first of the format arguments.
145 <!-- ##### MACRO G_GNUC_SCANF ##### -->
147 Expands to the GNU C format function attribute if the compiler is GNU C.
148 This is used for declaring functions which take a variable number of
149 arguments, with the same syntax as <function>scanf()</function>.
150 It allows the compiler to type-check the arguments passed to the function.
151 See the GNU C documentation for details.
154 @format_idx: the index of the argument corresponding to the format string.
155 (The arguments are numbered from 1).
156 @arg_idx: the index of the first of the format arguments.
159 <!-- ##### MACRO G_GNUC_FORMAT ##### -->
161 Expands to the GNU C format_arg function attribute if the compiler is GNU C.
162 This is used for declaring functions which take a variable number of
163 parameters, like <function>printf()</function> and
164 <function>scanf()</function>. See the GNU C documentation for details.
166 FIXME: I can't find this in my GNU C documentation. Take out?
169 @arg_idx: the index of the argument.
172 <!-- ##### MACRO G_GNUC_FUNCTION ##### -->
174 Expands to the GNU C __FUNCTION__ variable if the compiler is GNU C,
176 The GNU C __FUNCTION__ variable contains the name of the current function.
177 See the GNU C documentation for details.
182 <!-- ##### MACRO G_GNUC_PRETTY_FUNCTION ##### -->
184 Expands to the GNU C __PRETTY_FUNCTION__ variable if the compiler is GNU C,
186 The GNU C __PRETTY_FUNCTION__ variable contains the name of the current
187 function. For a C program this is the same as the __FUNCTION__ variable
188 but for C++ it also includes extra information such as the class
189 and function prototype. See the GNU C documentation for details.
194 <!-- ##### MACRO G_STRLOC ##### -->
201 <!-- ##### MACRO G_GINT16_FORMAT ##### -->
203 This is the platform dependent conversion specifier for scanning and
204 printing values of type #gint16. It is a string literal, but doesn't
205 include the percent-sign, such that you can add precision and length
206 modifiers between percent-sign and conversion specifier.
214 sscanf ("42", "%" G_GINT16_FORMAT, &in)
216 g_print ("%" G_GINT32_FORMAT, out);
223 <!-- ##### MACRO G_GUINT16_FORMAT ##### -->
225 This is the platform dependent conversion specifier for scanning and
226 printing values of type #guint16. See also #G_GINT16_FORMAT.
231 <!-- ##### MACRO G_GINT32_FORMAT ##### -->
233 This is the platform dependent conversion specifier for scanning and
234 printing values of type #gint32. See also #G_GINT16_FORMAT.
239 <!-- ##### MACRO G_GUINT32_FORMAT ##### -->
241 This is the platform dependent conversion specifier for scanning and
242 printing values of type #guint32. See also #G_GINT16_FORMAT.
247 <!-- ##### MACRO G_GINT64_FORMAT ##### -->
249 This is the platform dependent conversion specifier for scanning and
250 printing values of type #gint64. See also #G_GINT16_FORMAT.
255 Some platforms do not support scanning and printing 64 bit integers,
256 even though the types are supported. On such platforms G_GINT64_FORMAT
263 <!-- ##### MACRO G_GUINT64_FORMAT ##### -->
265 This is the platform dependent conversion specifier for scanning and
266 printing values of type #guint64. See also #G_GINT16_FORMAT.
271 Some platforms do not support scanning and printing 64 bit integers,
272 even though the types are supported. On such platforms G_GUINT64_FORMAT