[project @ 2002-12-17 12:29:48 by simonmar]
authorsimonmar <unknown>
Tue, 17 Dec 2002 12:29:48 +0000 (12:29 +0000)
committersimonmar <unknown>
Tue, 17 Dec 2002 12:29:48 +0000 (12:29 +0000)
On second thoughts, use memcmp instead.

ghc/compiler/utils/FastString.lhs

index ed81d79..494648f 100644 (file)
@@ -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