Do not include silcdefs.h in installed headers anymore. Include
authorPekka Riikonen <priikone@silcnet.org>
Fri, 1 Nov 2002 12:07:51 +0000 (12:07 +0000)
committerPekka Riikonen <priikone@silcnet.org>
Fri, 1 Nov 2002 12:07:51 +0000 (12:07 +0000)
silcdefs.h only during compilation time.

configure.in.pre
includes/Makefile.am
includes/silcincludes.h
lib/doc/silcclient_using.html
lib/silcutil/unix/silcunixmutex.c
lib/silcutil/win32/silcwin32mutex.c

index 6bc96a41697578768ac36cd3ab118f9c2c25b91a..ab88a677afb0929e227edaf2a2c43f115a82fc1d 100644 (file)
@@ -1002,6 +1002,9 @@ win32/libsilcclient/Makefile
 )
 fi
 
+# Use our configuration in compilation
+CFLAGS="-DHAVE_SILCDEFS_H $CFLAGS"
+
 AC_OUTPUT
 
 s_bindir=`eval echo $bindir`;s_bindir=`eval echo $s_bindir`
index a23b73d9b4e4215b94e0249f052d895d6b6e51b9..bf47b28ea3ccfe52f902aca8dd292edec774ba39 100644 (file)
@@ -26,8 +26,7 @@ include_HEADERS = \
        silcbeos.h \
        silcos2.h \
        silcversion.h \
-       version_internal.h \
-       silcdefs.h
+       version_internal.h
 endif
 
 EXTRA_DIST = \
index 060a357e95619f88c57f5bc90be39fb6a6a92808..2580ea0906997c828e4981387123b56f307a2be6 100644 (file)
@@ -64,24 +64,26 @@ extern "C" {
 #endif
 #endif
 
+#if defined(HAVE_SILCDEFS_H)
 /* Automatically generated configuration header */
 #include "silcdefs.h"
+#endif /* HAVE_SILCDEFS_H */
 
 /* Platform specific includes */
 
-#ifdef SILC_WIN32
+#if defined(SILC_WIN32)
 #include "silcwin32.h"
 #endif
 
-#ifdef SILC_EPOC
+#if defined(SILC_EPOC)
 #include "silcepoc.h"
 #endif
 
-#ifdef SILC_BEOS
+#if defined(SILC_BEOS)
 #include "silcbeos.h"
 #endif
 
-#ifdef SILC_OS2
+#if defined(SILC_OS2)
 #include "silcos2.h"
 #endif
 
@@ -122,7 +124,7 @@ extern "C" {
 #error assert.h not found in the system
 #endif
 
-#ifndef SILC_WIN32
+#if !defined(SILC_WIN32)
 
 #include <unistd.h>
 #include <sys/time.h>
@@ -270,7 +272,7 @@ extern "C" {
 #include "silcvcard.h"
 #include "silcapputil.h"
 
-#ifdef SILC_SIM
+#if defined(SILC_SIM)
 /* SILC Module library includes */
 #include "silcsim.h"
 #include "silcsimutil.h"
index 3dd3acf00ac752bda5362da7f8f36a8e9ce78016..780c7f312245d9893499502be4a8d4fd51a692fb 100644 (file)
@@ -313,6 +313,14 @@ capabilities which are also available for client library user.  You should
 have compiled the Toolkit with --enable-debug option so that run-time
 debugging is enabled.
 
+<br />&nbsp;<br />
+Then, to say in your application you would like to use the debugging use
+the SILC_ENABLE_DEBUG macro.  Put this macro to your main header file, or
+some other file that needs the debugging enabled.  After using this macro
+you are able to use the debugging routines provided by the SILC Toolkit.  
+Note that, the Toolkit library must be compiled with --enable-debug for
+this macro to have any effect.
+
 <br />&nbsp;<br />
 To turn on the run-time debugging set the global variable "silc_debug" to
 TRUE.  To see packet hexdumps you can set also "silc_debug_hexdump" to TRUE.
index 1b531b0a481300a2384224413209a60f9be228fc..6b92ee3286d7a6c56cc79cee37607639e7f61aa4 100644 (file)
 
 #include "silcincludes.h"
 
-#ifdef SILC_THREADS
-
 /* SILC Mutex structure */
 struct SilcMutexStruct {
+#ifdef SILC_THREADS
   pthread_mutex_t mutex;
+#else
+  void *tmp;
+#endif /* SILC_THREADS */
 };
 
 bool silc_mutex_alloc(SilcMutex *mutex)
 {
+#ifdef SILC_THREADS
   *mutex = silc_calloc(1, sizeof(**mutex));
   if (*mutex == NULL)
     return FALSE;
 
   pthread_mutex_init(&(*mutex)->mutex, NULL);
+#endif /* SILC_THREADS */
   return TRUE;
 }
 
 void silc_mutex_free(SilcMutex mutex)
 {
+#ifdef SILC_THREADS
   pthread_mutex_destroy(&mutex->mutex);
   silc_free(mutex);
+#endif /* SILC_THREADS */
 }
 
 void silc_mutex_lock(SilcMutex mutex)
 {
+#ifdef SILC_THREADS
   if (pthread_mutex_lock(&mutex->mutex))
     assert(FALSE);
+#endif /* SILC_THREADS */
 }
 
 void silc_mutex_unlock(SilcMutex mutex)
 {
+#ifdef SILC_THREADS
   if (pthread_mutex_unlock(&mutex->mutex))
     assert(FALSE);
-}
-
 #endif /* SILC_THREADS */
+}
index 0a186f59610ce0774139a976e5c59247b12be2b1..95a6e2651262ee7d203cd98dd0fa27b032f71649 100644 (file)
 
 #include "silcincludes.h"
 
-#ifdef SILC_THREADS
-
 /* SILC Mutex structure */
 struct SilcMutexStruct {
+#ifdef SILC_THREADS
   HANDLE mutex;
+#else
+  void *tmp;
+#endif /* SILC_THREADS */
 };
 
 bool silc_mutex_alloc(SilcMutex *mutex)
 {
+#ifdef SILC_THREADS
   *mutex = silc_calloc(1, sizeof(**mutex));
   (*mutex)->mutex = CreateMutex(NULL, FALSE, NULL);
   if (!(*mutex)->mutex) {
     silc_free(*mutex);
     return FALSE;
   }
+#endif /* SILC_THREADS */
   return TRUE;
 }
 
 void silc_mutex_free(SilcMutex mutex)
 {
+#ifdef SILC_THREADS
   CloseHandle(mutex->mutex);
   silc_free(mutex);
+#endif /* SILC_THREADS */
 }
 
 void silc_mutex_lock(SilcMutex mutex)
 {
+#ifdef SILC_THREADS
   WaitForSingleObject(mutex->mutex, INFINITE);
+#endif /* SILC_THREADS */
 }
 
 void silc_mutex_unlock(SilcMutex mutex)
 {
+#ifdef SILC_THREADS
   ReleaseMutex(mutex->mutex);
-}
-
 #endif /* SILC_THREADS */
+}