silcdefs.h only during compilation time.
)
fi
+# Use our configuration in compilation
+CFLAGS="-DHAVE_SILCDEFS_H $CFLAGS"
+
AC_OUTPUT
s_bindir=`eval echo $bindir`;s_bindir=`eval echo $s_bindir`
silcbeos.h \
silcos2.h \
silcversion.h \
- version_internal.h \
- silcdefs.h
+ version_internal.h
endif
EXTRA_DIST = \
#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
#error assert.h not found in the system
#endif
-#ifndef SILC_WIN32
+#if !defined(SILC_WIN32)
#include <unistd.h>
#include <sys/time.h>
#include "silcvcard.h"
#include "silcapputil.h"
-#ifdef SILC_SIM
+#if defined(SILC_SIM)
/* SILC Module library includes */
#include "silcsim.h"
#include "silcsimutil.h"
have compiled the Toolkit with --enable-debug option so that run-time
debugging is enabled.
+<br /> <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 /> <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.
#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 */
+}
#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 */
+}