diff options
author | Jeremy Huddleston <jeremyhu@apple.com> | 2012-05-07 17:07:27 -0700 |
---|---|---|
committer | Jeremy Huddleston <jeremyhu@apple.com> | 2012-05-17 16:00:05 -0700 |
commit | f5fc5334116ad2b0c8930ac68c52bf0f7a2f1417 (patch) | |
tree | 2d7d9a518209732cdb514628f0c8b2efb3adc5b4 /hw | |
parent | e0097ce9719f9b0aeccf7102630c0299f8acdf93 (diff) |
XQuartz: Provide fls implementation for Tiger
Regression-from: 30623d6ff7bca223f9e1a825e86bd317eef8bf16
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
Diffstat (limited to 'hw')
-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) { |