summaryrefslogtreecommitdiffstats
path: root/common/logging.h
diff options
context:
space:
mode:
authorWerner Koch <wk@gnupg.org>2015-07-26 12:50:16 +0200
committerWerner Koch <wk@gnupg.org>2015-07-26 12:50:24 +0200
commitd382242fb6789973ce8d246ec154a4a1468c24c0 (patch)
tree3809b220992ea4e49942a3dec3d7a2f5e96738f6 /common/logging.h
parentscd: support any curves defined by libgcrypt. (diff)
downloadgnupg2-d382242fb6789973ce8d246ec154a4a1468c24c0.tar.xz
gnupg2-d382242fb6789973ce8d246ec154a4a1468c24c0.zip
Replace GNUPG_GCC_A_ macros by GPGRT_ATTR_ macros.
* common/util.h: Provide replacement for GPGRT_ATTR_ macros when using libgpg-error < 1.20. * common/mischelp.h: Ditto. * common/types.h: Ditto. -- Given that libgpg-error is a dependency of all GnuPG related libraries it is better to define such macros at only one place instead of having similar macros at a lot of places. For now we need repalcement macros, though.
Diffstat (limited to 'common/logging.h')
-rw-r--r--common/logging.h19
1 files changed, 10 insertions, 9 deletions
diff --git a/common/logging.h b/common/logging.h
index 0bd1a6c7f..dbfc8bae6 100644
--- a/common/logging.h
+++ b/common/logging.h
@@ -48,8 +48,9 @@ int log_test_fd (int fd);
int log_get_fd(void);
estream_t log_get_stream (void);
-#ifdef GPGRT_GCC_M_FUNCTION
- void bug_at( const char *file, int line, const char *func ) GPGRT_GCC_A_NR;
+#ifdef GPGRT_HAVE_MACRO_FUNCTION
+ void bug_at (const char *file, int line, const char *func)
+ GPGRT_ATTR_NORETURN;
# define BUG() bug_at( __FILE__ , __LINE__, __FUNCTION__ )
#else
void bug_at( const char *file, int line );
@@ -74,17 +75,17 @@ enum jnlib_log_levels {
GPGRT_LOG_BUG,
GPGRT_LOG_DEBUG
};
-void log_log (int level, const char *fmt, ...) GPGRT_GCC_A_PRINTF(2,3);
+void log_log (int level, const char *fmt, ...) GPGRT_ATTR_PRINTF(2,3);
void log_logv (int level, const char *fmt, va_list arg_ptr);
void log_string (int level, const char *string);
-void log_bug( const char *fmt, ... ) GPGRT_GCC_A_NR_PRINTF(1,2);
-void log_fatal( const char *fmt, ... ) GPGRT_GCC_A_NR_PRINTF(1,2);
-void log_error( const char *fmt, ... ) GPGRT_GCC_A_PRINTF(1,2);
-void log_info( const char *fmt, ... ) GPGRT_GCC_A_PRINTF(1,2);
-void log_debug( const char *fmt, ... ) GPGRT_GCC_A_PRINTF(1,2);
-void log_printf( const char *fmt, ... ) GPGRT_GCC_A_PRINTF(1,2);
+void log_bug (const char *fmt, ...) GPGRT_ATTR_NR_PRINTF(1,2);
+void log_fatal (const char *fmt, ...) GPGRT_ATTR_NR_PRINTF(1,2);
+void log_error (const char *fmt, ...) GPGRT_ATTR_PRINTF(1,2);
+void log_info (const char *fmt, ...) GPGRT_ATTR_PRINTF(1,2);
+void log_debug (const char *fmt, ...) GPGRT_ATTR_PRINTF(1,2);
+void log_printf (const char *fmt, ...) GPGRT_ATTR_PRINTF(1,2);
void log_flush (void);
/* Print a hexdump of BUFFER. With TEXT passes as NULL print just the