From 7bfc60de2e83b263c35e645d4251bc55eaefec00 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Sun, 27 Jan 2008 23:42:33 +0000 Subject: [PATCH] Deprecate G_GNUC_(PRETTY)_FUNCTION. 2008-01-27 Matthias Clasen * glib/gmacros.h: Deprecate G_GNUC_(PRETTY)_FUNCTION. svn path=/trunk/; revision=6389 --- ChangeLog | 4 ++++ docs/reference/ChangeLog | 5 +++++ docs/reference/glib/tmpl/macros_misc.sgml | 18 +++++++----------- gio/ChangeLog | 7 +++++++ gio/gbufferedinputstream.c | 2 +- gio/ginputstream.c | 10 ++++------ gio/goutputstream.c | 5 ++--- glib/gmacros.h | 2 ++ gthread/ChangeLog | 6 ++++++ gthread/gthread-posix.c | 2 +- gthread/gthread-win32.c | 2 +- 11 files changed, 40 insertions(+), 23 deletions(-) diff --git a/ChangeLog b/ChangeLog index 41bf86f55..cd77c7be3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2008-01-27 Matthias Clasen + + * glib/gmacros.h: Deprecate G_GNUC_(PRETTY)_FUNCTION. + 2008-01-27 Matthias Clasen * m4macros/glib-gettext.m4: Remove AC_CANONICAL_HOST from diff --git a/docs/reference/ChangeLog b/docs/reference/ChangeLog index c830fef10..db7b5a052 100644 --- a/docs/reference/ChangeLog +++ b/docs/reference/ChangeLog @@ -1,3 +1,8 @@ +2008-01-27 Matthias Clasen + + * glib/tmpl/macros_misc.sgml: Document G_GNUC_(PRETTY)_FUNCTION + as deprecated. + 2008-01-24 Matthias Clasen * gio/migration.xml: Some more diff --git a/docs/reference/glib/tmpl/macros_misc.sgml b/docs/reference/glib/tmpl/macros_misc.sgml index 22ab7693b..dc9d7686d 100644 --- a/docs/reference/glib/tmpl/macros_misc.sgml +++ b/docs/reference/glib/tmpl/macros_misc.sgml @@ -264,25 +264,21 @@ is ignored. See the GNU C documentation for details. -Expands to the GNU C __FUNCTION__ variable if the -compiler is gcc, or "" if it isn't. The GNU C -__FUNCTION__ variable contains the name of the -current function. See the GNU C documentation for details. +Expands to "" on all modern compilers, and to __FUNCTION__ +on gcc version 2.x. Don't use it. +@Deprecated: 2.14 -Expands to the GNU C __PRETTY_FUNCTION__ variable -if the compiler is gcc, or "" if it isn't. -The GNU C __PRETTY_FUNCTION__ variable contains the -name of the current function. For a C program this is the same as the -__FUNCTION__ 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 +__PRETTY_FUNCTION__ on gcc version 2.x. +Don't use it. +@Deprecated: 2.14 diff --git a/gio/ChangeLog b/gio/ChangeLog index 54a436394..42d2d7312 100644 --- a/gio/ChangeLog +++ b/gio/ChangeLog @@ -1,3 +1,10 @@ +2008-01-27 Matthias Clasen + + * gbufferedinputstream.c: + * ginputstream.c: + * goutputstream.c: Replace uses of G_GNUC_PRETTY_FUNCTION by + __FUNCTION__. + 2008-01-27 Matthias Clasen * glocalfile.c: Avoid trivial differences in translatable strings. diff --git a/gio/gbufferedinputstream.c b/gio/gbufferedinputstream.c index f011be589..ad00c69f2 100644 --- a/gio/gbufferedinputstream.c +++ b/gio/gbufferedinputstream.c @@ -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; } diff --git a/gio/ginputstream.c b/gio/ginputstream.c index 5c0da3766..3e4d24cb5 100644 --- a/gio/ginputstream.c +++ b/gio/ginputstream.c @@ -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; } diff --git a/gio/goutputstream.c b/gio/goutputstream.c index c1bb8b20b..6f8a95c10 100644 --- a/gio/goutputstream.c +++ b/gio/goutputstream.c @@ -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; } diff --git a/glib/gmacros.h b/glib/gmacros.h index 7c9c87e89..eb6b02c50 100644 --- a/glib/gmacros.h +++ b/glib/gmacros.h @@ -108,6 +108,7 @@ #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 @@ -119,6 +120,7 @@ #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 diff --git a/gthread/ChangeLog b/gthread/ChangeLog index 6bc7d1ca5..2d134f4e0 100644 --- a/gthread/ChangeLog +++ b/gthread/ChangeLog @@ -1,3 +1,9 @@ +2008-01-27 Matthias Clasen + + * gthread-posix.c: + * gthread-win32.c: Replace uses of G_GNUC_PRETTY_FUNCTION + by __FUNCTION__. + 2008-01-21 Matthias Clasen * === Released 2.15.3 === diff --git a/gthread/gthread-posix.c b/gthread/gthread-posix.c index 01121bf4c..0891bf2bd 100644 --- a/gthread/gthread-posix.c +++ b/gthread/gthread-posix.c @@ -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 diff --git a/gthread/gthread-win32.c b/gthread/gthread-win32.c index 657423f44..f566e2858 100644 --- a/gthread/gthread-win32.c +++ b/gthread/gthread-win32.c @@ -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