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

📄 macros_misc.sgml

📁 This GLib version 2.16.1. GLib is the low-level core library that forms the basis for projects such
💻 SGML
📖 第 1 页 / 共 2 页
字号:
<!-- ##### MACRO G_GNUC_PRETTY_FUNCTION ##### --><para>Expands to "" on all modern compilers, and to <literal>__PRETTY_FUNCTION__</literal> on <command>gcc</command> version 2.x. Don't use it.</para>@Deprecated: 2.16<!-- ##### 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>This attribute can be used for marking library functions as being used internally to the library only, which may allow the compiler to handlefunction 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. </para><para>When using a compiler that supports the GNU C hidden visibility attribute, this macro expands to <literal>__attribute__((visibility("hidden")))</literal>.When using the Sun Studio compiler, it expands to <literal>__hidden</literal>.</para><para>Note that for portability, the attribute should be placed before thefunction declaration. While GCC allows the macro after the declaration, Sun Studio does not.</para><informalexample><programlisting>G_GNUC_INTERNALvoid _g_log_fallback_handler (const gchar    *log_domain,                              GLogLevelFlags  log_level,                              const gchar    *message,                              gpointer        unused_data);</programlisting></informalexample>Since: 2.6<!-- ##### MACRO G_GNUC_MAY_ALIAS ##### --><para></para><!-- ##### FUNCTION 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>@Returns: the value of @expr@Since: 2.2<!-- # Unused Parameters # -->@expr: the expression<!-- ##### 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@Returns: the value of @expr@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 + -