From: simonmar Date: Tue, 17 Dec 2002 12:29:48 +0000 (+0000) Subject: [project @ 2002-12-17 12:29:48 by simonmar] X-Git-Tag: Approx_11550_changesets_converted~1341 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=840871d4a024e16b206d4487ee5ccd7e77f88fda;p=ghc-hetmet.git [project @ 2002-12-17 12:29:48 by simonmar] On second thoughts, use memcmp instead. --- diff --git a/ghc/compiler/utils/FastString.lhs b/ghc/compiler/utils/FastString.lhs index ed81d79..494648f 100644 --- a/ghc/compiler/utils/FastString.lhs +++ b/ghc/compiler/utils/FastString.lhs @@ -422,7 +422,7 @@ cmpFS (FastString u1# l1# b1#) (FastString u2# l2# b2#) = if u1# ==# u2# then EQ else let l# = if l1# <=# l2# then l1# else l2# in unsafePerformIO ( - strncmp b1# b2# l# >>= \ (I# res) -> + memcmp b1# b2# l# >>= \ (I# res) -> return ( if res <# 0# then LT else if res ==# 0# then @@ -431,8 +431,8 @@ cmpFS (FastString u1# l1# b1#) (FastString u2# l2# b2#) = else GT )) -foreign import ccall "strncmp" unsafe - strncmp :: ByteArray# -> ByteArray# -> Int# -> IO Int +foreign import ccall "ghc_memcmp" unsafe + memcmp :: ByteArray# -> ByteArray# -> Int# -> IO Int -- ----------------------------------------------------------------------------- -- Outputting 'FastString's