⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 macros_misc.sgml

📁 GLIB-C的最新源代码
💻 SGML
📖 第 1 页 / 共 2 页
字号:
<!-- ##### MACRO G_GNUC_FUNCTION ##### --><para>Expands to the GNU C <literal>__FUNCTION__</literal> variable if the compiler is <command>gcc</command>, or "" if it isn't. The GNU C <literal>__FUNCTION__</literal> variable contains the name of the current function. See the GNU C documentation for details. </para><!-- ##### MACRO G_GNUC_PRETTY_FUNCTION ##### --><para>Expands to the GNU C <literal>__PRETTY_FUNCTION__</literal> variable if the compiler is <command>gcc</command>, or "" if it isn't.The GNU C <literal>__PRETTY_FUNCTION__</literal> variable contains the name of the current function. For a C program this is the same as the <literal>__FUNCTION__</literal> variable but for C++ it also includes extra information such as the class and function prototype. See the GNU C documentation for details. </para><!-- ##### MACRO G_GNUC_NO_INSTRUMENT ##### --><para>Expands to the GNU C <literal>no_instrument_function</literal> function attribute if the compiler is <command>gcc</command>. Functions with this attribute will not be instrumented for profiling, when the compiler is called with the<option>-finstrument-functions</option> option.See the GNU C documentation for details. </para><!-- ##### MACRO G_HAVE_GNUC_VISIBILITY ##### --><para>This macro is defined as 1 if the the compiler supports ELF visibility attributes (currently only <command>gcc</command>).</para>Since: 2.6<!-- ##### MACRO G_GNUC_INTERNAL ##### --><para>Expands to the GNU C <literal>visibility(hidden)</literal> attribute if the compiler supports it  (currently only <command>gcc</command>). This attribute can be used for marking library functions as being used internally to the lib only, to not create inefficient PLT entries. Note that static functions do not need to be marked as internal in this way. See the GNU C documentation for details. </para>Since: 2.6<!-- ##### MACRO G_LIKELY ##### --><para>Hints the compiler that the expression is likely to evaluate to a truevalue. The compiler may use this information for optimizations.</para><informalexample><programlisting>if (G_LIKELY (random () != 1))  g_print ("not one");</programlisting></informalexample>@expr: the expression@Since: 2.2<!-- ##### MACRO G_UNLIKELY ##### --><para>Hints the compiler that the expression is unlikely to evaluate to a truevalue. The compiler may use this information for optimizations.</para><informalexample><programlisting>if (G_UNLIKELY (random () == 1))  g_print ("a random one");</programlisting></informalexample>@expr: the expression@Since: 2.2<!-- ##### MACRO G_STRLOC ##### --><para>Expands to a string identifying the current code position. </para><!-- ##### MACRO G_STRFUNC ##### --><para>Expands to a string identifying the current function. </para>@Since: 2.4<!-- ##### MACRO G_GINT16_MODIFIER ##### --><para>The platform dependent length modifier for constructing printf() conversionspecifiers for values of type #gint16 or #guint16. It is a string literal, but doesn't include the percent-sign, such that you can add precision and length modifiers between percent-sign and conversion specifier and append a conversion specifier.</para><para>The following example prints "0x7b";<informalexample><programlisting>gint16 value = 123;g_print ("%#" G_GINT16_MODIFIER "x", value);</programlisting></informalexample></para>@Since: 2.4<!-- ##### MACRO G_GINT16_FORMAT ##### --><para>This is the platform dependent conversion specifier for scanning andprinting values of type #gint16. It is a string literal, but doesn'tinclude the percent-sign, such that you can add precision and lengthmodifiers between percent-sign and conversion specifier.</para><para><informalexample><programlisting>gint16 in;gint32 out;sscanf ("42", "%" G_GINT16_FORMAT, &amp;in)out = in * 1000;g_print ("%" G_GINT32_FORMAT, out);</programlisting></informalexample></para><!-- ##### MACRO G_GUINT16_FORMAT ##### --><para>This is the platform dependent conversion specifier for scanning andprinting values of type #guint16. See also #G_GINT16_FORMAT.</para><!-- ##### MACRO G_GINT32_MODIFIER ##### --><para>The platform dependent length modifier for constructing printf() conversionspecifiers for values of type #gint32 or #guint32. See also #G_GINT16_MODIFIER.</para>@Since: 2.4<!-- ##### MACRO G_GINT32_FORMAT ##### --><para>This is the platform dependent conversion specifier for scanning andprinting values of type #gint32. See also #G_GINT16_FORMAT.</para><!-- ##### MACRO G_GUINT32_FORMAT ##### --><para>This is the platform dependent conversion specifier for scanning andprinting values of type #guint32. See also #G_GINT16_FORMAT.</para><!-- ##### MACRO G_GINT64_MODIFIER ##### --><para>The platform dependent length modifier for constructing printf() conversionspecifiers for values of type #gint64 or #guint64. See also #G_GINT16_MODIFIER.</para><note><para>Some platforms do not support printing 64 bit integers,even though the types are supported. On such platforms #G_GINT64_MODIFIERis not defined.</para></note>@Since: 2.4<!-- ##### MACRO G_GINT64_FORMAT ##### --><para>This is the platform dependent conversion specifier for scanning andprinting values of type #gint64. See also #G_GINT16_FORMAT.</para><note><para>Some platforms do not support scanning and printing 64 bit integers,even though the types are supported. On such platforms #G_GINT64_FORMATis not defined. Note that scanf() may not support 64 bit integers, evenif #G_GINT64_FORMAT is defined. Due to its weak error handling, scanf() is not recommended for parsing anyway; consider using g_strtoull() instead.</para></note><!-- ##### MACRO G_GUINT64_FORMAT ##### --><para>This is the platform dependent conversion specifier for scanning andprinting values of type #guint64. See also #G_GINT16_FORMAT.</para><note><para>Some platforms do not support scanning and printing 64 bit integers,even though the types are supported. On such platforms #G_GUINT64_FORMATis not defined.  Note that scanf() may not support 64 bit integers, evenif #G_GINT64_FORMAT is defined. Due to its weak error handling, scanf() is not recommended for parsing anyway; consider using g_strtoull() instead.</para></note><!-- ##### MACRO G_GSIZE_MODIFIER ##### --><para>The platform dependent length modifier for constructing printf() conversionspecifiers for values of type #gsize or #gssize. See also #G_GINT16_MODIFIER.</para>@Since: 2.6<!-- ##### MACRO G_GSIZE_FORMAT ##### --><para>This is the platform dependent conversion specifier for scanning andprinting values of type #gsize. See also #G_GINT16_FORMAT.</para>@Since: 2.6<!-- ##### MACRO G_GSSIZE_FORMAT ##### --><para>This is the platform dependent conversion specifier for scanning andprinting values of type #gssize. See also #G_GINT16_FORMAT.</para>@Since: 2.6

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -