From 31cdfafba28cbf5cc0d96caa8310cf31a59633c8 Mon Sep 17 00:00:00 2001 From: Pekka Riikonen Date: Fri, 1 Nov 2002 11:39:52 +0000 Subject: [PATCH] Added SILC_ENABLE_DEBUG macro. --- lib/silcutil/silclog.h | 29 ++++++++++++++++++++++++++++- lib/silcutil/silcmutex.h | 12 ------------ lib/silcutil/silcnet.h | 12 ++++++++---- 3 files changed, 36 insertions(+), 17 deletions(-) diff --git a/lib/silcutil/silclog.h b/lib/silcutil/silclog.h index 97d4d393..be923c4a 100644 --- a/lib/silcutil/silclog.h +++ b/lib/silcutil/silclog.h @@ -236,12 +236,39 @@ extern DLLAPI bool silc_debug_hexdump; /* Macros */ -#if defined(SILC_WIN32) +#if defined(WIN32) #ifndef __FUNCTION__ #define __FUNCTION__ "" #endif #endif +/****d* silcutil/SilcLogAPI/SILC_ENABLE_DEBUG + * + * NAME + * + * #define SILC_ENABLE_DEBUG + * + * DESCRIPTION + * + * Use this macro to enable the debugging in your application. If + * SILC was compiled with debugging enabled, this macro enables it. + * Use this macro in your application's main header, or in place where + * you need to enable the debugging. + * + * NOTES + * + * You still can control the debugging with silc_debug variable, on + * whether to actually print the debugging or not. This macro is + * used to enable debugging, not to say it is printed or not. + * + * SOURCE + */ +#define SILC_ENABLE_DEBUG \ + #ifndef SILC_DEBUG \ + #define SILC_DEBUG 1 \ + #endif SILC_DEBUG \ +/***/ + /****d* silcutil/SilcLogAPI/SILC_LOG_INFO * * NAME diff --git a/lib/silcutil/silcmutex.h b/lib/silcutil/silcmutex.h index 27b229fa..ca5e8066 100644 --- a/lib/silcutil/silcmutex.h +++ b/lib/silcutil/silcmutex.h @@ -31,8 +31,6 @@ #ifndef SILCMUTEX_H #define SILCMUTEX_H -#if defined(SILC_THREADS) - /****s* silcutil/SilcMutexAPI/SilcMutex * * NAME @@ -135,14 +133,4 @@ void silc_mutex_lock(SilcMutex mutex); ***/ void silc_mutex_unlock(SilcMutex mutex); -#else - -#define SILC_MUTEX_DEFINE(name) -#define silc_mutex_alloc(mutex) (void)0 -#define silc_mutex_free(mutex) (void)0 -#define silc_mutex_lock(mutex) (void)0 -#define silc_mutex_unlock(mutex) (void)0 - -#endif /* SILC_THREADS */ - #endif diff --git a/lib/silcutil/silcnet.h b/lib/silcutil/silcnet.h index 429d7cee..9dd5acd2 100644 --- a/lib/silcutil/silcnet.h +++ b/lib/silcutil/silcnet.h @@ -419,8 +419,6 @@ char *silc_net_localhost(void); ***/ char *silc_net_localip(void); -#if defined(SILC_WIN32) - /****f* silcutil/SilcNetAPI/silc_net_win32_init * * SYNOPSIS @@ -437,6 +435,10 @@ char *silc_net_localip(void); * FALSE on error. The network will not work if this function returns * FALSE. * + * NOTES + * + * This routines is available only on Win32 platform. + * ***/ bool silc_net_win32_init(void); @@ -453,9 +455,11 @@ bool silc_net_win32_init(void); * is usually called when the application is exiting. After calling * this function the SILC Net API routines will not work anymore. * + * NOTES + * + * This routines is available only on Win32 platform. + * ***/ void silc_net_win32_uninit(void); #endif - -#endif -- 2.24.0