summaryrefslogtreecommitdiff
path: root/libraries/base/cbits
Commit message (Collapse)AuthorAgeFilesLines
* Rts flags cleanupSimon Marlow2016-06-101-42/+0
| | | | | | | | * Remove unused/old flags from the structs * Update old comments * Add missing flags to GHC.RTS * Simplify GHC.RTS, remove C code and use hsc2hs instead * Make ParFlags unconditional, and add support to GHC.RTS
* Typos in comments [skip ci]Gabor Greif2015-08-031-1/+1
|
* Delete _MSC_VER when not necessary, fix #10511Bernard Desmyter2015-06-123-4/+4
| | | | | | | Simplify some preprocessor expressions involving `_MSC_VER` because `_WIN32` is always defined when `_MSC_VER` is. Differential Revision: https://phabricator.haskell.org/D981
* Removes all occurrences of __MINGW32__ (#10485)Thomas Miedema2015-06-114-6/+6
| | | | | | | | | | In Haskell files, replace `__MINGW32__` by `mingw32_HOST_OS`. In .c and .h files, delete `__MINGW32__` when `_WIN32` is also tested because `_WIN32` is always defined when `__MINGW32__` is. Also replace `__MINGW32__` by `_WIN32` when used standalone for consistency. Differential Revision: https://phabricator.haskell.org/D971
* accessors to RTS flag values -- #5364Ömer Sinan Ağacan2014-11-241-0/+42
| | | | | | | | | | | | | | | | | | | | | | | | Summary: Implementation of #5364. Mostly boilerplate, reading FILE fields is missing. Test Plan: - Get some feedback on missing parts. (FILE fields) - Get some feedback on module name. - Get some feedback on other things. - Get code reviewed. - Make sure test suite is passing. (I haven't run it myself) Reviewers: hvr, austin, ezyang Reviewed By: ezyang Subscribers: ekmett, simonmar, ezyang, carter, thomie Differential Revision: https://phabricator.haskell.org/D306 GHC Trac Issues: #5364 Conflicts: includes/rts/Flags.h
* base: Mark WCsubst.c as generated for PhabricatorAustin Seipp2014-10-212-0/+2
| | | | Signed-off-by: Austin Seipp <austin@well-typed.com>
* 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.