]> wimlib.net Git - wimlib/blobdiff - include/wimlib/compiler.h
Place headers that could be useful in unrelated projects in public domain
[wimlib] / include / wimlib / compiler.h
index 78a7bef5b6a33adddce01fb336170ca39cdda8bd..c6e22e98d649d5cb42937eabdaf52472fb8af408 100644 (file)
@@ -1,3 +1,10 @@
+/*
+ * compiler.h
+ *
+ * The author dedicates this file to the public domain.
+ * You can do whatever you want with this file.
+ */
+
 #ifndef _WIMLIB_COMPILER_H
 #define _WIMLIB_COMPILER_H
 
@@ -21,6 +28,8 @@
 #      define _aligned_attribute(size) __attribute__((aligned(size)))
 #      define likely(x) __builtin_expect(!!(x), 1)
 #      define unlikely(x) __builtin_expect(!!(x), 0)
+#      define inline inline __attribute__((always_inline))
+#      define prefetch(x) __builtin_prefetch(x)
 #else
 #      define WIMLIBAPI
 #      define _always_inline_attribute inline
@@ -32,6 +41,7 @@
 #      define _aligned_attribute(size)
 #      define likely(x) (x)
 #      define unlikely(x) (x)
+#      define prefetch(x)
 #endif /* __GNUC__ */
 
 #endif /* _WIMLIB_COMPILER_H */