summaryrefslogtreecommitdiff
path: root/libraries/base/cbits
Commit message (Collapse)AuthorAgeFilesLines
...
* Update to Unicode version 7.0David Feuer2014-10-211-3468/+3817
| | | | | | | | | | | | Summary: Update Unicode data to version 7.0 Reviewers: rwbarton, austin Reviewed By: austin Subscribers: thomie, carter, ezyang, simonmar Differential Revision: https://phabricator.haskell.org/D316
* Refactor to avoid need for `Unicode.hs-boot`Herbert Valerio Riedel2014-10-112-10/+10
| | | | | | | | | | | This avoids the import-cycle caused by the import of `Foreign.C.Types` by using `Int` instead of `CInt` for the Unicode classification functions. This refactoring also allows to remove a couple of `fromIntegral`s. Reviewed By: rwbarton, ekmett Differential Revision: https://phabricator.haskell.org/D328
* Delete all /* ! __GLASGOW_HASKELL__ */ codeThomas Miedema2014-09-231-9/+2
| | | | | | | | | | | | | | | | | Summary: ``` git grep -l '\(#ifdef \|#if defined\)(\?__GLASGOW_HASKELL__)\?' ``` Test Plan: validate Reviewers: rwbarton, hvr, austin Reviewed By: rwbarton, hvr, austin Subscribers: rwbarton, simonmar, ezyang, carter Differential Revision: https://phabricator.haskell.org/D218
* Update a comment in base cbitsReid Barton2014-08-201-1/+1
|
* reading/writing blocking FDs over FD_SETSIZE is broken (Partially Trac #9169)Sergei Trofimovich2014-07-021-1/+5
| | | | | | | | | | | | | | | | | | Summary: libraries/base/cbits/inputReady.c had no limits on file descriptors. Add a limit as non-threaded RTS does. Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org> Test Plan: none Reviewers: austin, simonmar Reviewed By: austin, simonmar Subscribers: simonmar, relrod, carter Differential Revision: https://phabricator.haskell.org/D28
* Add setEnv/unsetEnv to System.Environment; fixes #7427Ian Lynagh2013-06-151-0/+11
| | | | Patch from Simon Hengel.
* Add an __hsbase_ prefix to the MD5 symbols (#7914)Simon Marlow2013-05-211-13/+13
|
* Build fix for iOS; fixes #7759Ian Lynagh2013-04-211-1/+2
| | | | | | | | | Patch from Stephen Blackheath. The issue here is that the #defines EVFILT_READ and EVFILT_WRITE have the values -1 and -2. The original code translates that to filterRead = Filter -1 which is wrong Haskell and fails to compile. The modified code produces the correct code filterRead = Filter (-1)
* md5.c: fix a typo in the size argument of memsetMichal Terepeta2013-04-161-1/+1
|
* Removes the assumption that CLK_TCK is a constant (#7519)Simon Marlow2013-01-231-0/+19
| | | | | | (which is not true on QNXNTO). Submitted by: Stephen Paul Weber <singpolyma@singpolyma.net>
* GHC.Windows: more error support (guards, system error strings)Joey Adams2012-11-171-27/+42
| | | | | | | | | | | | | | | This changes the output of throwGetLastError to include the system error message, rather than the message of our fictitious errno. It also adds several definitions to GHC.Windows, mostly from the Win32 package. The exceptions are: * getErrorMessage: returns a String, unlike in System.Win32.Types, where it returns an LPWSTR. * errCodeToIOError: new * c_maperrno_func: new
* Allow openTempFile to retry when it hits a directory (#4968).Paolo Capriotti2012-06-071-0/+6
| | | | | | Windows returns an EACCES error instead of EEXIST when a call to `open` fails due to an existing directory, so add a special case for this situation.
* Use in-process file locking on Windows (#4363)Paolo Capriotti2012-05-081-0/+17
|
* Use RTS version of getMonotonicNSec on Windows (#6061)Paolo Capriotti2012-05-081-46/+0
|
* Add timer initialization for darwin.Paolo Capriotti2012-04-171-10/+10
|
* Replace getUSecOfDay with monotonic timer (#5865)Paolo Capriotti2012-04-171-10/+43
|
* Define monotonic time function for Darwin.Paolo Capriotti2012-04-171-0/+21
|
* Remove some unused codeIan Lynagh2012-02-261-3/+0
|
* Remove some antiquated C constructsIan Lynagh2011-08-011-10/+10
| | | | | | | | Fixes validate on amd64/Linux with: SRC_CC_OPTS += -Wmissing-parameter-type SRC_CC_OPTS += -Wold-style-declaration SRC_CC_OPTS += -Wold-style-definition
* Fix the behaviour of scaleFloat; part of #3898Ian Lynagh2011-07-311-1/+21
| | | | Patch from Daniel Fischer.
* Typeable overhaul (see #5275)Simon Marlow2011-07-111-0/+238
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instances of Typeable used to call mkTyCon: mkTyCon :: String -> TyCon which internally kept a table mapping Strings to Ints, so that each TyCon could be given a unique Int for fast comparison. This meant the String has to be unique across all types in the program. However, derived instances of typeable used the qualified original name (e.g. "GHC.Types.Int") which is not necessarily unique, is non-portable, and exposes implementation details. The String passed to mkTyCon is returned by tyConString :: TyCon -> String which let the user get at this non-portable representation (also the Show instance returns this String). Now we store three Strings in TyCon. The internal representation is this: data TyCon = TyCon { tyConHash :: {-# UNPACK #-} !Fingerprint, tyConPackage :: String, tyConModule :: String, tyConName :: String } (internal representations are now provided by Data.Typeable.Internal) The fields of TyCon are not exposed via the public API. Together the three fields tyConPackage, tyConModule and tyConName uniquely identify a TyCon, and the Fingerprint is a hash of the concatenation of these three Strings (so no more internal cache to map strings to unique Ids). tyConString now returns the value of tyConName only, so is therefore portable (but the String returned does not uniquely identify the TyCon). I've measured the performance impact of this change, and performance seems to be uniformly better. This should improve things for SYB in particular. Also, the size of the code generated for deriving Typeable is less than half as much as before. == API changes == === mkTyCon is DEPRECATED == mkTyCon is used by some hand-written instances of Typeable. It still works as before, but is deprecated in favour of... === Add mkTyCon3 === mkTyCon3 :: String -> String -> String -> TyCon mkTyCon3 takes the package, module, and name of the TyCon respectively. Most users can just derive Typeable, there's no need to use mkTyCon3. In due course we can rename mkTyCon3 back to mkTyCon. === typeRepKey changed === Previously we had typeRepKey :: TypeRep -> IO Int but since we don't assign unique Ints to TypeReps any more, this is difficult to implement. Instead we provide an abstract key type which is an instance of Eq and Ord, and internally is implemented by the fingerprint: data TypeRepKey -- abstract, instance of Eq, Ord typeRepKey :: TypeRep -> IO TypeRepKey typeRepKey is still in the IO monad, because the Ord instance is implementation-defined.
* FIX #2271Daniel Fischer2010-10-181-9/+260
| | | | | | | | | | Faster rounding functions for Double and float with Int or Integer results. Fixes #2271. Since some glibc's have buggy rintf or rint functions and the behaviour of these functions depends on the setting of the rounding mode, we provide our own implementations which always round ties to even. Also added rewrite rules and removed trailing whitespace.
* Regenerated cbits/WCsubst.c based on Unicode 6.0.0Bas van Dijk2011-02-072-787/+1041
|
* Windows: map ERROR_NO_DATA to EPIPE, rather than EINVALSimon Marlow2010-09-151-1/+4
| | | | | | | | | | | | | | | WriteFile() returns ERROR_NO_DATA when writing to a pipe that is "closing", however by default the write() wrapper in the CRT maps this to EINVAL so we get confusing things like hPutChar: invalid argument (Invalid Argumnet) when piping the output of a Haskell program into something that closes the pipe early. This was happening in the testsuite in a few place. The solution is to map ERROR_NO_DATA to EPIPE correctly, as we explicitly check for EPIPE on stdout (in GHC.TopHandler) so we can exit without an error in this case.
* Fix Windows build; patches frmo ezyangIan Lynagh2010-09-081-2/+2
|
* More accurate isatty test for MinGW.Edward Z. Yang2010-09-071-0/+23
|
* Don't define the C localeEncoding on WindowsIan Lynagh2010-06-201-0/+2
| | | | (it causes warnings, and isn't used)
* Use libcharset instead of nl_langinfo(CODESET) if possible.pho@cielonegro.org2010-05-191-5/+19
| | | | nl_langinfo(CODESET) doesn't always return standardized variations of the encoding names. Use libcharset if possible, which is shipped together with GNU libiconv.
* Updates to follow the RTS tidyupSimon Marlow2009-08-012-1/+261
| | | | C functions like isDoubleNaN moved here (primFloat.c)
* avoid a warningSimon Marlow2009-06-301-1/+3
|
* Add a wrapper for libiconv.Matthias Kilian2009-06-291-0/+23
|
* Move directory-related stuff to the unix packageSimon Marlow2009-06-251-74/+0
| | | | now that it isn't used on Windows any more.
* Call nl_langinfo(CODESET) to get the name of the locale encoding on UnixSimon Marlow2009-06-231-0/+10
|
* ghcconfig.h is __GLASGOW_HASKELL__ onlyMalcolm.Wallace@cs.york.ac.uk2009-03-161-0/+2
|
* FIX #2189: re-enabled cooked mode for Console-connected Handles on WindowsSimon Marlow2009-03-051-5/+2
| | | | Patch from Sigbjorn Finne <sof@galois.com>
* FIX #2189: re-enabled cooked mode for Console-connected Handles on WindowsSimon Marlow2009-03-051-2/+5
| | | | Patch from Sigbjorn Finne <sof@galois.com>
* We should be including Rts.h here, not Stg.hSimon Marlow2008-09-121-1/+1
| | | | | Stg.h is for .hc files only, and it sets up various global register variables.
* Unbreak the GHC build with older versions of gccIan Lynagh2008-09-041-1/+6
| | | | | | | | Patch from kili@outback.escape.de, who says: Stg.h must be included before HsBase.h, because the latter contains function definitions causing older versions of gcc (3.3.5 in my case) to bail out with "error: global register variable follows a function definition" on Regs.h, which is included by Stg.h.
* non-GHC: leave out Belch functionsRoss Paterson2008-08-311-2/+4
|
* Fix warnings in PrelIOUtils.cIan Lynagh2008-08-251-0/+2
|
* remove __hscore_renameFile, it is no longer uesdSimon Marlow2008-08-181-68/+0
| | | | System.Directory implements renameFile using unix/Win32 now.
* remove returns from void functionsRoss Paterson2008-08-141-2/+2
|
* FIX #1198: hWaitForInput on WindowsSimon Marlow2008-07-081-35/+106
| | | | | Now we do the appropriate magic in fdReady() to detect when there is real input available, as opposed to uninteresting console events.
* Update WCsubst.c for Unicode 5.1.0, and add a README.UnicodeIan Lynagh2008-06-132-959/+2012
| | | | README.Unicode describes how to do updates in the future.
* Fix ubconfcIan Lynagh2008-06-131-3/+3
| | | | | | The current code doesn't seem to be what was used to generate WCsubst.c, so I'm not sure if it never worked, or if my tools work slightly differently to those of the previous user.
* Avoid calling varargs functions using the FFISimon Marlow2008-05-091-0/+9
| | | | | | Calling varargs functions is explicitly deprecated according to the FFI specification. It used to work, just about, but it broke with the recent changes to the via-C backend to not use header files.
* Move Word64/Int64/Word32/Int32 primitives into ghc-primIan Lynagh2008-03-251-129/+0
|
* Move file locking into the RTS, fixing #629, #1109Simon Marlow2007-11-201-112/+0
| | | | | | | | | | | | | | | File locking (of the Haskell 98 variety) was previously done using a static table with linear search, which had two problems: the array had a fixed size and was sometimes too small (#1109), and performance of lockFile/unlockFile was suboptimal due to the linear search. Also the algorithm failed to count readers as required by Haskell 98 (#629). Now it's done using a hash table (provided by the RTS). Furthermore I avoided the extra fstat() for every open file by passing the dev_t and ino_t into lockFile. This and the improvements to the locking algorithm result in a healthy 20% or so performance increase for opening/closing files (see openFile008 test).
* clean up duplicate codeSimon Marlow2007-10-171-38/+5
|
* make hWaitForInput/hReady not fail with "invalid argument" on WindowsSimon Marlow2007-08-301-1/+2
| | | | | See #1198. This doesn't fully fix it, because hReady still always returns False on file handles. I'm not really sure how to fix that.