]> wimlib.net Git - wimlib/blobdiff - src/util.h
Fix sequential extraction, and include progress info
[wimlib] / src / util.h
index 3dfd6030be08574686a3cbb6b1d8c790775746dc..dd564f5d6af1809d36f2f4e9df41e6f35fb67e56 100644 (file)
 #      define HOT
 #endif /* __GNUC__ */
 
+
+#if 0
 #ifdef WITH_FUSE
-/* 
- * Compare-and-swap.  Equivalent to the folliwng, but executed
- * atomically:
- *
- * Q tmp = *ptr;
- * if (tmp == oval)
- *     *ptr = nval;
- * return tmp;
- */
 #define atomic_inc(ptr) \
        __sync_fetch_and_add(ptr, 1)
 
 #define atomic_dec(ptr) \
        __sync_sub_and_fetch(ptr, 1)
-
-#define cas(ptr, oval, nval) \
-       __sync_val_compare_and_swap(ptr, oval, nval);
-
-#define cas_bool(ptr, oval, nval) \
-       __sync_bool_compare_and_swap(ptr, oval, nval);
+#endif
 #endif
 
 #ifndef _NTFS_TYPES_H
@@ -88,6 +76,12 @@ typedef unsigned uint;
        (type *)( (char *)__mptr - offsetof(type,member) );})
 #endif
 
+#define DIV_ROUND_UP(numerator, denominator) \
+       (((numerator) + (denominator) - 1) / (denominator))
+
+#define MODULO_NONZERO(numerator, denominator) \
+       (((numerator) % (denominator)) ? ((numerator) % (denominator)) : (denominator))
+
 #define ARRAY_LEN(array) (sizeof(array) / sizeof((array)[0]))
 
 #define ZERO_ARRAY(array) memset(array, 0, sizeof(array))