summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Huddleston <jeremyhu@apple.com>2012-05-07 17:07:27 -0700
committerJeremy Huddleston <jeremyhu@apple.com>2012-05-17 16:00:05 -0700
commitf5fc5334116ad2b0c8930ac68c52bf0f7a2f1417 (patch)
tree2d7d9a518209732cdb514628f0c8b2efb3adc5b4
parente0097ce9719f9b0aeccf7102630c0299f8acdf93 (diff)
XQuartz: Provide fls implementation for Tiger
Regression-from: 30623d6ff7bca223f9e1a825e86bd317eef8bf16 Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
-rw-r--r--hw/xquartz/console_redirect.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/hw/xquartz/console_redirect.c b/hw/xquartz/console_redirect.c
index 1e0e56bad..91d693b67 100644
--- a/hw/xquartz/console_redirect.c
+++ b/hw/xquartz/console_redirect.c
@@ -310,6 +310,20 @@ xq_asl_init(void)
atexit(redirect_atexit);
}
+#if MAC_OS_X_VERSION_MIN_REQUIRED < 1050
+#define fls(v) xq_fls(v)
+
+static inline int fls(int value) {
+ unsigned int b, v;
+
+ v = *((unsigned int *)&value);
+
+ for(b=0 ; v ; v >>= 1 , b++);
+
+ return b;
+}
+#endif
+
int
xq_asl_log_fd(aslclient asl, aslmsg msg, int level, int fd)
{