Page MenuHomeFreeBSD
Paste P157

(An Untitled Masterwork)
ActivePublic

Authored by cem on Jan 10 2018, 12:52 AM.
Tags
None
Referenced Files
F3113358:
Jan 10 2018, 12:52 AM
Subscribers
None
--- freebsd/zstd_kfreebsd.h (revision 327712)
+++ freebsd/zstd_kfreebsd.h (working copy)
@@ -49,6 +49,25 @@
#define calloc(a,b) (malloc)((a)*(b), M_ZSTD, M_WAITOK | M_ZERO)
#endif
+#undef __builtin_ctz
+#undef __builtin_ctzll
+
+static inline int
+__builtin_ctz(int x)
+{
+ if (x == 0)
+ return (sizeof(x) * NBBY);
+ return (ffs(x) - 1);
+}
+
+static inline long long
+__builtin_ctzll(long long x)
+{
+ if (x == 0)
+ return (sizeof(x) * NBBY);
+ return (ffsll(x) - 1);
+}
+
#ifdef __cplusplus
}
#endif

Event Timeline

cem created this object in space S1 Global.