diff options
author | Jeremy Huddleston <jeremyhu@apple.com> | 2012-05-07 17:07:27 -0700 |
---|---|---|
committer | Jeremy Huddleston <jeremyhu@apple.com> | 2012-05-29 13:17:03 -0700 |
commit | 198a876e34b880be5f7da683ec3ff21a53edcec5 (patch) | |
tree | b7c2ce9cd0148d597203b036b0ba413e8f6c4b3c | |
parent | 300970f8f80ef15614fef78215476a8011895000 (diff) |
XQuartz: Provide fls implementation for Tiger
Regression-from: 30623d6ff7bca223f9e1a825e86bd317eef8bf16
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
(cherry picked from commit f5fc5334116ad2b0c8930ac68c52bf0f7a2f1417)
-rw-r--r-- | hw/xquartz/console_redirect.c | 14 |
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) { |