Added SILC_ENABLE_DEBUG macro.
authorPekka Riikonen <priikone@silcnet.org>
Fri, 1 Nov 2002 11:39:52 +0000 (11:39 +0000)
committerPekka Riikonen <priikone@silcnet.org>
Fri, 1 Nov 2002 11:39:52 +0000 (11:39 +0000)
lib/silcutil/silclog.h
lib/silcutil/silcmutex.h
lib/silcutil/silcnet.h

index 97d4d393b0c890e2626b5835fcc75bb15c800df4..be923c4abc9883caf55c8201c2300629c7eea0c8 100644 (file)
@@ -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
index 27b229fa099a2dd23675e19681f57d833c63a7bc..ca5e806682d90d49b3cae46011f540efb0a67ad5 100644 (file)
@@ -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
index 429d7cee7287cfb64e0746269d5e4094ee1ff61a..9dd5acd26bd454c5adbdcffe7f88755bae43bca8 100644 (file)
@@ -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