summaryrefslogtreecommitdiff
path: root/libraries/base/Text
diff options
context:
space:
mode:
authorross <unknown>2004-07-23 15:32:00 +0000
committerross <unknown>2004-07-23 15:32:00 +0000
commit02a07c4c84b12e6c03d9dce564a41b2990bfb203 (patch)
tree24499cf429c2ff03e7f5ca496809e353f13a71c5 /libraries/base/Text
parent803fb54f51cc4954c6763c3c44a464cb7c4a37c0 (diff)
downloadhaskell-02a07c4c84b12e6c03d9dce564a41b2990bfb203.tar.gz
[project @ 2004-07-23 15:31:59 by ross]
To make Text.Regex.Posix work with Hugs, move cbits/regex/regex.h under include, where Hugs can find it.
Diffstat (limited to 'libraries/base/Text')
-rw-r--r--libraries/base/Text/Regex/Posix.hsc16
1 files changed, 9 insertions, 7 deletions
diff --git a/libraries/base/Text/Regex/Posix.hsc b/libraries/base/Text/Regex/Posix.hsc
index 56544e15b8..8cda01060f 100644
--- a/libraries/base/Text/Regex/Posix.hsc
+++ b/libraries/base/Text/Regex/Posix.hsc
@@ -19,7 +19,6 @@ module Text.Regex.Posix (
-- * The @Regex@ type
Regex, -- abstract
-#if !defined(__HUGS__) || defined(HAVE_REGEX_H)
-- * Compiling a regular expression
regcomp, -- :: String -> Int -> IO Regex
@@ -36,12 +35,19 @@ module Text.Regex.Posix (
-- String, -- everything after match
-- [String])) -- subexpression matches
-#endif
) where
-#if !defined(__HUGS__) || defined(HAVE_REGEX_H)
#include <sys/types.h>
+
+#if HAVE_REGEX_H && HAVE_REGCOMP
#include "regex.h"
+#else
+#include "regex/regex.h"
+{-# CBITS regex/reallocf.c #-}
+{-# CBITS regex/regcomp.c #-}
+{-# CBITS regex/regerror.c #-}
+{-# CBITS regex/regexec.c #-}
+{-# CBITS regex/regfree.c #-}
#endif
import Prelude
@@ -54,8 +60,6 @@ type CRegex = ()
-- | A compiled regular expression
newtype Regex = Regex (ForeignPtr CRegex)
-#if !defined(__HUGS__) || defined(HAVE_REGEX_H)
--- to the end
-- -----------------------------------------------------------------------------
-- regcomp
@@ -174,5 +178,3 @@ foreign import ccall unsafe "&regfree"
foreign import ccall unsafe "regexec"
c_regexec :: Ptr CRegex -> CString -> CSize
-> Ptr CRegMatch -> CInt -> IO CInt
-
-#endif /* HAVE_REGEX_H */