From fba983958728c11a05fe125ff5d337c663076a24 Mon Sep 17 00:00:00 2001 From: Sebastien Helleu Date: Mon, 18 Nov 2013 14:31:26 +0100 Subject: [PATCH] core: use #ifdef to check if versions are defined in signal "debug_libs" --- src/core/wee-debug.c | 28 ++++++++++++++++++++++++++++ src/gui/curses/gui-curses-main.c | 4 ++++ 2 files changed, 32 insertions(+) diff --git a/src/core/wee-debug.c b/src/core/wee-debug.c index 3ef60b81a..4b2cb0a2b 100644 --- a/src/core/wee-debug.c +++ b/src/core/wee-debug.c @@ -522,19 +522,47 @@ debug_libs_cb (void *data, const char *signal, const char *type_data, (void) signal_data; gui_chat_printf (NULL, " core:"); + + /* display ncurses version */ gui_main_debug_libs (); + + /* display gcrypt version */ +#ifdef GCRYPT_VERSION gui_chat_printf (NULL, " gcrypt: %s%s", GCRYPT_VERSION, (weechat_no_gcrypt) ? " (not initialized)" : ""); +#else + gui_chat_printf (NULL, " gcrypt: (?)%s", + (weechat_no_gcrypt) ? " (not initialized)" : ""); +#endif + + /* display gnutls version */ #ifdef HAVE_GNUTLS +#ifdef GNUTLS_VERSION gui_chat_printf (NULL, " gnutls: %s%s", GNUTLS_VERSION, (weechat_no_gnutls) ? " (not initialized)" : ""); +#else + gui_chat_printf (NULL, " gnutls: (?)%s", + (weechat_no_gnutls) ? " (not initialized)" : ""); +#endif #else gui_chat_printf (NULL, " gnutls: (not available)"); #endif + + /* display curl version */ +#ifdef LIBCURL_VERSION gui_chat_printf (NULL, " curl: %s", LIBCURL_VERSION); +#else + gui_chat_printf (NULL, " curl: (?)"); +#endif + + /* display zlib version */ +#ifdef ZLIB_VERSION gui_chat_printf (NULL, " zlib: %s", ZLIB_VERSION); +#else + gui_chat_printf (NULL, " zlib: (?)"); +#endif return WEECHAT_RC_OK; } diff --git a/src/gui/curses/gui-curses-main.c b/src/gui/curses/gui-curses-main.c index 4cea3e326..e097855db 100644 --- a/src/gui/curses/gui-curses-main.c +++ b/src/gui/curses/gui-curses-main.c @@ -304,8 +304,12 @@ gui_main_signal_sigwinch () void gui_main_debug_libs () { +#if defined(NCURSES_VERSION) && defined(NCURSES_VERSION_PATCH) gui_chat_printf (NULL, " ncurses: %s (patch %d)", NCURSES_VERSION, NCURSES_VERSION_PATCH); +#else + gui_chat_printf (NULL, " ncurses: (?)"); +#endif } /*