]> mj.ucw.cz Git - libucw.git/commitdiff
Introduced COMPARE macro for use in sorter callbacks.
authorMartin Mares <mj@ucw.cz>
Sun, 15 Feb 2004 18:25:25 +0000 (18:25 +0000)
committerMartin Mares <mj@ucw.cz>
Sun, 15 Feb 2004 18:25:25 +0000 (18:25 +0000)
lib/lib.h

index 923afca5622d349a258f82b08b359e6c0a3171b6..b737c67749c012ffd15b89f97926eba67902f49e 100644 (file)
--- a/lib/lib.h
+++ b/lib/lib.h
@@ -39,6 +39,7 @@
 #define STRINGIFY(x) #x
 #define GLUE(x,y) x##y
 #define GLUE_(x,y) x##_##y
+#define COMPARE(x,y) do { if ((x)<(y)) return -1; if ((x)>(y)) return 1; } while(0)
 
 /* Logging */