+Tue Apr 3 21:52:42 EEST 2001 Pekka Riikonen <priikone@poseidon.pspt.fi>
+
+ * Defined uint8, int8, uint16, int16, uint32, int32, uint64 and
+ int64 of at least the xintXX size. If void * is less that 4
+ bytes uint32 * will be used. Defined bool as boolean.
+
Tue Apr 3 16:39:19 EEST 2001 Pekka Riikonen <priikone@poseidon.pspt.fi>
* Implemented the sending of the SERVER_SIGNOFF notify in the
-TODO General
-============
-
- o We should replace all short, int, long, unsigned short, unsigned int,
- unsigned long with some pre-defined datatypes that really are what
- we want on all platforms. int16, uint16, int32, uint32 etc. are
- what we could use or maybe SilcInt16, SilcUInt16 etc. Also, boolean
- datatype should be defined.
-
-
TODO/bugs In SILC Client Library
================================
#undef HAVE_RTLD_NOW
#undef HAVE_RTLD_LAZY
+/* Types */
+#undef SILC_SIZEOF_LONG_LONG
+#undef SILC_SIZEOF_LONG
+#undef SILC_SIZEOF_INT
+#undef SILC_SIZEOF_SHORT
+#undef SILC_SIZEOF_CHAR
+#undef SILC_SIZEOF_VOID_P
+
/* Redefs for SOCKS5 library */
#undef SOCKS
#undef SOCKS5
SilcClientConfigParse *return_config)
{
int i, begin;
- unsigned int linenum;
+ int linenum;
char line[1024], *cp;
SilcClientConfigSection *cptr = NULL;
SilcClientConfigParse parse = *return_config, first = NULL;
AC_TYPE_UID_T
AC_TYPE_PID_T
+AC_CHECK_SIZEOF(long long, 0)
+AC_DEFINE_UNQUOTED(SILC_SIZEOF_LONG_LONG, $ac_cv_sizeof_long_long)
+AC_CHECK_SIZEOF(long, 0)
+AC_DEFINE_UNQUOTED(SILC_SIZEOF_LONG, $ac_cv_sizeof_long)
+AC_CHECK_SIZEOF(int, 0)
+AC_DEFINE_UNQUOTED(SILC_SIZEOF_INT, $ac_cv_sizeof_int)
+AC_CHECK_SIZEOF(short, 0)
+AC_DEFINE_UNQUOTED(SILC_SIZEOF_SHORT, $ac_cv_sizeof_short)
+AC_CHECK_SIZEOF(char, 0)
+AC_DEFINE_UNQUOTED(SILC_SIZEOF_CHAR, $ac_cv_sizeof_char)
+AC_CHECK_SIZEOF(void *, 0)
+AC_DEFINE_UNQUOTED(SILC_SIZEOF_VOID_P, $ac_cv_sizeof_void_p)
+
# Function checking
AC_CHECK_FUNCS(chmod stat fstat getenv putenv strerror ctime gettimeofday)
AC_CHECK_FUNCS(getpid getgid getsid getpgid getpgrp getuid)
#define FALSE 0
#endif
+/* Define types. The types must be at least of the specified size */
+#undef uint8
+#undef uint16
+#undef uint32
+#undef uin64
+#undef int8
+#undef int16
+#undef int32
+#undef int64
+
+typedef unsigned char uint8;
+typedef signed char int8;
+
+#if SILC_SIZEOF_SHORT > 2
+#error "size of the short must be 2 bytes"
+#endif
+
+typedef unsigned short uint16;
+typedef signed short int16;
+
+#if SILC_SIZEOF_LONG == 4
+typedef unsigned long uint32;
+typedef signed long int32;
+#else
+#if SILC_SIZEOF_INT == 4
+typedef unsigned long uint32;
+typedef signed long int32;
+#else
+#if SILC_SIZEOF_LONG_LONG >= 4
+typedef unsigned long long uint32;
+typedef signed long long int32;
+#endif
+#endif
+#endif
+
+#if SILC_SIZEOF_LONG >= 8
+typedef unsigned long uint64;
+typedef signed long int64;
+#else
+#if SILC_SIZEOF_LONG_LONG >= 8
+typedef unsigned long long uint64;
+typedef signed long long int64;
+#else
+typedef uint32 uint64;
+typedef int32 int64;
+#endif
+#endif
+
+#if SILC_SIZEOF_VOID_P < 4
+typedef uint32 * void *;
+#endif
+
+#ifndef bool
+#define bool unsigned char
+#endif
+
/* Generic global SILC includes */
#include "bitmove.h"