+do { \
+ (cp)[0] = (SilcUInt8)(l); \
+ (cp)[1] = (SilcUInt8)((l) >> 8); \
+ (cp)[2] = (SilcUInt8)((l) >> 16); \
+ (cp)[3] = (SilcUInt8)((l) >> 24); \
+} while(0)
+#endif /* SILC_I486 && __GNUC__ */
+/***/
+
+/****d* silcutil/SILCTypes/SILC_SWAB_16
+ *
+ * NAME
+ *
+ * #define SILC_SWAB_16 ...
+ *
+ * DESCRIPTION
+ *
+ * Swabs 16-bit unsigned integer byte order.
+ *
+ * SOURCE
+ */
+#define SILC_SWAB_16(l) \
+ ((SilcUInt16)(((SilcUInt16)(l) & (SilcUInt16)0x00FFU) << 8) | \
+ (((SilcUInt16)(l) & (SilcUInt16)0xFF00U) >> 8))
+/***/
+
+/****d* silcutil/SILCTypes/SILC_SWAB_32
+ *
+ * NAME
+ *
+ * #define SILC_SWAB_32 ...
+ *
+ * DESCRIPTION
+ *
+ * Swabs 32-bit unsigned integer byte order.
+ *
+ * SOURCE
+ */
+#define SILC_SWAB_32(l) \
+ ((SilcUInt32)(((SilcUInt32)(l) & (SilcUInt32)0x000000FFUL) << 24) | \
+ (((SilcUInt32)(l) & (SilcUInt32)0x0000FF00UL) << 8) | \
+ (((SilcUInt32)(l) & (SilcUInt32)0x00FF0000UL) >> 8) | \
+ (((SilcUInt32)(l) & (SilcUInt32)0xFF000000UL) >> 24))
+/***/
+
+/****d* silcutil/SILCTypes/SILC_PTR_TO_32
+ *
+ * NAME
+ *
+ * #define SILC_PTR_TO_32 ...
+ *
+ * DESCRIPTION
+ *
+ * Type casts a pointer's value into a 32-bit integer. Use this to
+ * avoid compiler warnings when type casting pointers to integers
+ * of different size.
+ *
+ * SOURCE
+ */
+#if SILC_SIZEOF_VOID_P < 8
+#define SILC_PTR_TO_32(_ptr__) ((SilcUInt32)(_ptr__))
+#else
+#define SILC_PTR_TO_32(_ptr__) \
+ ((SilcUInt32)((SilcUInt64)(_ptr__) & (SilcUInt32)0xFFFFFFFFUL))
+#endif
+/***/
+
+/****d* silcutil/SILCTypes/SILC_PTR_TO_64
+ *
+ * NAME
+ *
+ * #define SILC_PTR_TO_64 ...
+ *
+ * DESCRIPTION
+ *
+ * Type casts a pointer's value into a 64-bit integer. Use this to
+ * avoid compiler warnings when type casting pointers to integers
+ * of different size.
+ *
+ * SOURCE
+ */
+#if SILC_SIZEOF_VOID_P < 8
+#define SILC_PTR_TO_64(_ptr__) ((SilcUInt64)((SilcUInt32)(_ptr__)))
+#else
+#define SILC_PTR_TO_64(_ptr__) ((SilcUInt64)((SilcUInt64)(_ptr__)))
+#endif
+/***/
+
+/****d* silcutil/SILCTypes/SILC_32_TO_PTR
+ *
+ * NAME
+ *
+ * #define SILC_32_TO_PTR ...
+ *
+ * DESCRIPTION
+ *
+ * Type casts a 32-bit integer value into a pointer. Use this to
+ * avoid compiler warnings when type casting integers to pointers of
+ * different size.
+ *
+ * SOURCE
+ */
+#if SILC_SIZEOF_VOID_P < 8
+#define SILC_32_TO_PTR(_ival__) ((void *)((SilcUInt32)(_ival__)))
+#else
+#define SILC_32_TO_PTR(_ival__) ((void *)((SilcUInt64)(_ival__)))
+#endif
+/***/
+
+/****d* silcutil/SILCTypes/SILC_64_TO_PTR
+ *
+ * NAME
+ *
+ * #define SILC_64_TO_PTR ...
+ *
+ * DESCRIPTION
+ *
+ * Type casts a 64-bit integer value into a pointer. Use this to
+ * avoid compiler warnings when type casting integers to pointers of
+ * different size.
+ *
+ * SOURCE
+ */
+#if SILC_SIZEOF_VOID_P < 8
+#define SILC_64_TO_PTR(_ival__) \
+ ((void *)((SilcUInt32)((SilcUInt64)(_ival__) & (SilcUInt32)0xFFFFFFFFUL)))
+#else
+#define SILC_64_TO_PTR(_ival__) ((void *)((SilcUInt64)(_ival__)))
+#endif