Added SILC_MAX and SILC_MIN macros
[runtime.git] / lib / silcutil / silctypes.h
index 63412c3eaf05bdef72a2225cd8623150378fc6e1..fd2da8f8df8ba71734fbc9fb11d22ee857117bbf 100644 (file)
@@ -262,7 +262,7 @@ typedef float SilcFloat32;
  *    64-bit floating point number.
  *
  ***/
-typedef double SilcFloat64
+typedef double SilcFloat64;
 
 #if SILC_SIZEOF_VOID_P < 4
 typedef SilcUInt32 * void *;
@@ -358,6 +358,32 @@ typedef SilcUInt32 SilcParam;
                    | ((SilcUInt32)(SilcUInt8)(cp)[3])
 #endif /* (SILC_I486 || SILC_X86_64) && __GNUC__ */
 
+/****d* silcutil/SILC_MAX
+ *
+ * NAME
+ *
+ *    #define SILC_MAX(a, b)
+ *
+ * DESCRIPTION
+ *
+ *    Return `a' if it is bigger than `b', otherwise return `b'.
+ *
+ ***/
+#define SILC_MAX(a, b) ((a) > (b) ? (a) : (b))
+
+/****d* silcutil/SILC_MIN
+ *
+ * NAME
+ *
+ *    #define SILC_MIN(a, b)
+ *
+ * DESCRIPTION
+ *
+ *    Return `a' if it is smaller than `b', otherwise return `b'.
+ *
+ ***/
+#define SILC_MIN(a, b) ((a) < (b) ? (a) : (b))
+
 /****d* silcutil/SILC_GET16_MSB
  *
  * NAME