Deprecate G_GNUC_(PRETTY)_FUNCTION.
authorMatthias Clasen <mclasen@redhat.com>
Sun, 27 Jan 2008 23:42:33 +0000 (23:42 +0000)
committerMatthias Clasen <matthiasc@src.gnome.org>
Sun, 27 Jan 2008 23:42:33 +0000 (23:42 +0000)
2008-01-27  Matthias Clasen  <mclasen@redhat.com>

        * glib/gmacros.h: Deprecate G_GNUC_(PRETTY)_FUNCTION.

svn path=/trunk/; revision=6389

ChangeLog
docs/reference/ChangeLog
docs/reference/glib/tmpl/macros_misc.sgml
gio/ChangeLog
gio/gbufferedinputstream.c
gio/ginputstream.c
gio/goutputstream.c
glib/gmacros.h
gthread/ChangeLog
gthread/gthread-posix.c
gthread/gthread-win32.c

index 41bf86f..cd77c7b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2008-01-27  Matthias Clasen  <mclasen@redhat.com>
 
+       * glib/gmacros.h: Deprecate G_GNUC_(PRETTY)_FUNCTION.
+
+2008-01-27  Matthias Clasen  <mclasen@redhat.com>
+
        * m4macros/glib-gettext.m4: Remove AC_CANONICAL_HOST from
        GLIB_WITH_NLS again.  (#385132)
 
index c830fef..db7b5a0 100644 (file)
@@ -1,3 +1,8 @@
+2008-01-27  Matthias Clasen  <mclasen@redhat.com>
+
+       * glib/tmpl/macros_misc.sgml: Document G_GNUC_(PRETTY)_FUNCTION
+       as deprecated.
+
 2008-01-24  Matthias Clasen  <mclasen@redhat.com>
 
        * gio/migration.xml: Some more
index 22ab769..dc9d768 100644 (file)
@@ -264,25 +264,21 @@ is ignored. See the GNU C documentation for details.
 
 <!-- ##### 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. 
+Expands to "" on all modern compilers, and to <literal>__FUNCTION__</literal>
+on <command>gcc</command> version 2.x. Don't use it.
 </para>
 
+@Deprecated: 2.14
 
 
 <!-- ##### 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. 
+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.14
 
 
 <!-- ##### MACRO G_GNUC_NO_INSTRUMENT ##### -->
index 54a4363..42d2d73 100644 (file)
@@ -1,5 +1,12 @@
 2008-01-27  Matthias Clasen  <mclasen@redhat.com>
 
+       * gbufferedinputstream.c:
+       * ginputstream.c:
+       * goutputstream.c: Replace uses of G_GNUC_PRETTY_FUNCTION by
+       __FUNCTION__.
+       
+2008-01-27  Matthias Clasen  <mclasen@redhat.com>
+
        * glocalfile.c: Avoid trivial differences in translatable strings.
 
 2008-01-25  Matthias Clasen  <mclasen@redhat.com>
index f011be5..ad00c69 100644 (file)
@@ -481,7 +481,7 @@ g_buffered_input_stream_fill_async (GBufferedInputStream *stream,
                                           user_data,
                                           G_IO_ERROR, G_IO_ERROR_INVALID_ARGUMENT,
                                           _("Too large count value passed to %s"),
-                                          G_GNUC_PRETTY_FUNCTION);
+                                          __FUNCTION__);
       return;
     }
   
index 5c0da37..3e4d24c 100644 (file)
@@ -183,8 +183,7 @@ g_input_stream_read  (GInputStream  *stream,
   if (((gssize) count) < 0)
     {
       g_set_error (error, G_IO_ERROR, G_IO_ERROR_INVALID_ARGUMENT,
-                  _("Too large count value passed to %s"), 
-                   G_GNUC_PRETTY_FUNCTION);
+                  _("Too large count value passed to %s"), __FUNCTION__);
       return -1;
     }
 
@@ -316,8 +315,7 @@ g_input_stream_skip (GInputStream  *stream,
   if (((gssize) count) < 0)
     {
       g_set_error (error, G_IO_ERROR, G_IO_ERROR_INVALID_ARGUMENT,
-                  _("Too large count value passed to %s"),
-                  G_GNUC_PRETTY_FUNCTION);
+                  _("Too large count value passed to %s"), __FUNCTION__);
       return -1;
     }
   
@@ -559,7 +557,7 @@ g_input_stream_read_async (GInputStream        *stream,
                                           user_data,
                                           G_IO_ERROR, G_IO_ERROR_INVALID_ARGUMENT,
                                           _("Too large count value passed to %s"),
-                                          G_GNUC_PRETTY_FUNCTION);
+                                          __FUNCTION__);
       return;
     }
 
@@ -684,7 +682,7 @@ g_input_stream_skip_async (GInputStream        *stream,
                                           user_data,
                                           G_IO_ERROR, G_IO_ERROR_INVALID_ARGUMENT,
                                           _("Too large count value passed to %s"),
-                                          G_GNUC_PRETTY_FUNCTION);
+                                          __FUNCTION__);
       return;
     }
 
index c1bb8b2..6f8a95c 100644 (file)
@@ -190,8 +190,7 @@ g_output_stream_write (GOutputStream  *stream,
   if (((gssize) count) < 0)
     {
       g_set_error (error, G_IO_ERROR, G_IO_ERROR_INVALID_ARGUMENT,
-                  _("Too large count value passed to %s"),
-                  G_GNUC_PRETTY_FUNCTION);
+                  _("Too large count value passed to %s"), __FUNCTION__);
       return -1;
     }
 
@@ -646,7 +645,7 @@ g_output_stream_write_async (GOutputStream       *stream,
                                           user_data,
                                           G_IO_ERROR, G_IO_ERROR_INVALID_ARGUMENT,
                                           _("Too large count value passed to %s"),
-                                          G_GNUC_PRETTY_FUNCTION);
+                                          __FUNCTION__);
       return;
     }
 
index 7c9c87e..eb6b02c 100644 (file)
 #define G_GNUC_WARN_UNUSED_RESULT
 #endif /* __GNUC__ */
 
+#ifndef G_DISABLE_DEPRECATED
 /* Wrap the gcc __PRETTY_FUNCTION__ and __FUNCTION__ variables with
  * macros, so we can refer to them as strings unconditionally.
  * usage not-recommended since gcc-3.0
 #define G_GNUC_FUNCTION         ""
 #define G_GNUC_PRETTY_FUNCTION  ""
 #endif  /* !__GNUC__ */
+#endif  /* !G_DISABLE_DEPRECATED */
 
 #define G_STRINGIFY(macro_or_string)   G_STRINGIFY_ARG (macro_or_string)
 #define        G_STRINGIFY_ARG(contents)       #contents
index 6bc7d1c..2d134f4 100644 (file)
@@ -1,3 +1,9 @@
+2008-01-27  Matthias Clasen  <mclasen@redhat.com>
+
+       * gthread-posix.c:
+       * gthread-win32.c: Replace uses of G_GNUC_PRETTY_FUNCTION
+       by __FUNCTION__.
+
 2008-01-21  Matthias Clasen  <mclasen@redhat.com>
 
        * === Released 2.15.3 ===
index 01121bf..0891bf2 100644 (file)
@@ -51,7 +51,7 @@
   int error = (err);                                                   \
   if (error)                                                           \
     g_error ("file %s: line %d (%s): error '%s' during '%s'",          \
-           __FILE__, __LINE__, G_GNUC_PRETTY_FUNCTION,                 \
+           __FILE__, __LINE__, __FUNCTION__,                           \
            g_strerror (error), name);                                  \
   }G_STMT_END
 
index 657423f..f566e28 100644 (file)
@@ -48,7 +48,7 @@
 #define win32_check_for_error(what) G_STMT_START{                      \
   if (!(what))                                                         \
     g_error ("file %s: line %d (%s): error %s during %s",              \
-            __FILE__, __LINE__, G_GNUC_PRETTY_FUNCTION,                \
+            __FILE__, __LINE__, __FUNCTION__,                          \
             g_win32_error_message (GetLastError ()), #what);           \
   }G_STMT_END