Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Paste
P156
(An Untitled Masterwork)
Active
Public
Actions
Authored by
cem
on Jan 10 2018, 12:40 AM.
Edit Paste
Archive Paste
View Raw File
Subscribe
Mute Notifications
Flag For Later
Award Token
Tags
None
Referenced Files
F3113342:
Jan 10 2018, 12:40 AM
2018-01-10 00:40:44 (UTC+0)
Subscribers
None
--- freebsd/zstd_kfreebsd.h (revision 327712)
+++ freebsd/zstd_kfreebsd.h (working copy)
@@ -49,6 +49,27 @@
#define calloc(a,b) (malloc)((a)*(b), M_ZSTD, M_WAITOK | M_ZERO)
#endif
+#if defined(__mips__) || defined(__riscv)
+#undef __ctzsi2
+#undef __ctzdi2
+
+static inline unsigned
+__ctzsi2(unsigned x)
+{
+ if (x == 0)
+ return (sizeof(x) * NBBY);
+ return (ffsl(x) - 1);
+}
+
+static inline unsigned long long
+__ctzdi2(unsigned long long x)
+{
+ if (x == 0)
+ return (sizeof(x) * NBBY);
+ return (ffsll(x) - 1);
+}
+#endif /* __mips__ || __riscv */
+
#ifdef __cplusplus
}
#endif
Event Timeline
cem
created this paste.
Jan 10 2018, 12:40 AM
2018-01-10 00:40:44 (UTC+0)
cem
created this object in space
S1 Global
.
cem
created this object with edit policy "
cem (Conrad Meyer)
".
Log In to Comment