| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Re-instate the checking for the values of errno constants at configure
time. The problem with doing it using foreign calls is simply that
this tickles a bad case in the code gen machinery, which in this case
results in an extra 10-20k of goop ending up in pretty much every
binary, and it impacts GC performance too.
This has some portability implications, but the situation is no worse
than before. To reliably cross-compile for a new platform you need to
build a set of .hc files for the libraries using a config.h generated on
the *target* machine. (at some point we'll formalise the
cross-compilation story, but that's another thing on the todo list...)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Partial rewrite of the POSIX library.
The main purpose of this sweep is to remove the last dependencies of
the compiler on hslibs. When I've committed the associated compiler
changes, only the 'base' package will be required to bootstrap the
compiler. Additionally to build GHCi, the 'readline' and 'unix'
packages will be required.
The new POSIX library lives mostly in libraries/unix, with a few bits
required for compiler bootstrapping in libraries/base. The 'base'
package is mostly free of hsc2hs code to make bootstrapping from HC
files easier, but the 'unix' package will use hsc2hs liberally.
The old POSIX library continues to provide more-or-less the same
interface as before, although some of the types are more correct now
(previously lots of POSIX types were just mapped to Int). The new
interface is largely the same as the old, except that some new
functionality from the latest POSIX spec has been added (eg. symbolic
links).
So far, the new POSIX library has signal support, directory/file
operations and lots of stuff from unistd.h. The module names are:
System.Posix
The main dude, exports everything
System.Posix.Types
All the POSIX types, using the same naming scheme as
Foreign.C.Types, Eg. CUid, COff, etc. Many of these types
were previously exported by GHC.Posix.
Additionally exports the "nicer" names used by the old POSIX
library for compatibility (eg. ProcessID == CPid, FileMode ==
CMode, etc.)
All reasonable instances are derived for these types.
System.Posix.Signals
Signal support, contains most of which was in PosixProcPrim before.
The RTS interface to the signal handling support has been
rationalised slightly.
System.Posix.Directory
Directory support, most were in PosixFiles before.
System.Posix.Files
File operations, most were in PosixFiles before.
System.Posix.Unistd
(for want of a better name) Miscellaneous bits that mostly come
from the unistd.h header file. PosixProcEnv before.
The rest of the library should pan out like so:
System.Posix.IO
System.Posix.Error (maybe)
System.Posix.Process
System.Posix.Terminal
(I've no doubt broken Win32 support, but I'm checking the build at the moment).
|
|
|
|
| |
Fix typo.
|
|
|
|
|
|
|
|
|
|
| |
GHC can derive arbitrary instances for newtypes, so derive Storable
for the types in Foreign.C.Types, rather than using CPP trickery to
define the instances.
This moves the Storable instances for the C Types from
Foreign.Storable into Foreign.C.Types, and hence a few imports have
changed around.
|
|
|
|
| |
Move defn of hs_fileno inside ifdef
|
|
|
|
|
|
|
|
|
|
| |
Make the readline binding into a hierarchical library and put it in
its own package (for licensing reasons).
As part of this, I moved fdToHandle from PosixIO into GHC.Handle (and
updated the code to avoid using _casm_) since Readline requires it.
I've also updated Readline to use the latest FFI syntax.
|
|
|
|
|
| |
The Typeable instances were missing in the __GLASGOW_HASKELL__ case;
add them.
|
|
|
|
|
|
|
|
|
|
|
|
| |
Changes to make libs work with Hugs/FFI.
Highlights:
Moved most of the body of base/GHC/Storable.lhs
into base/Foreign/Storable.lhs since it is mostly portable.
base/include/CTypes.h and base/Foreign/C/Types.hs both generated
Typeable instances for CChar and friends until I fixed them.
|
|
|
|
| |
helper functions for mucking about with Win32 consoles
|
|
|
|
| |
Need to #include <math.h> now that Stg.h doesn't.
|
|
|
|
|
|
|
|
|
|
|
|
| |
Sigh, enabling _POSIX_PTHREAD_SEMANTICS causes the Solaris header
files to drop several silly little C functions into the source code.
We don't want these duplicated in every Haskell-compiled object.
So plan B: just define _POSIX_PTHREAD_SEMANTICS in dirUtils.c where it
is needed to make readdir_r work. I've checked, and readdir_r is the
only function we use that is affected by _POSIX_PTHREAD_SEMANTICS. If
we ever use any more of these functions, then we'll have to be careful
to give them a C wrapper.
|
|
|
|
|
|
|
|
| |
We have to define _POSIX_PTHREAD_SEMANTICS on Solaris in order to get
the right versions of the _r functions. Otherwise we get
Solaris-specific versions of these, which puts a spanner in the works.
Fixes problems with getDirectoryContents on Solaris in the HEAD.
|
|
|
|
| |
use $(includedir) and INSTALL_INCLUDES rather than overriding $(datadir)
|
|
|
|
| |
don't bother defining __hscore_sigaddset() on mingw
|
|
|
|
| |
To make cygwin/mingw interworking a little bit simpler, use the __MINGW32__ define rather than config.h's mingw32_TARGET_OS
|
|
|
|
|
|
| |
sigaddset() can be a macro, so add an wrapper around it (inlined in
via-C mode). I didn't bother with the #ifdef darwin_TARGET_OS around
this change since it doesn't hurt on other architectures.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Fix 64-bit shift operations.
- Move the declarations of the 64-bit "primops" from PrimOps.h to
HsBase.h where they more properly belong.
- change the names of the 64-bit shift ops to include the "unchecked"
prefix
- add checked versions of these primops to GHC.Int and GHC.Word, and
use them.
- update the FFI declarations in GHC.Int and GHC.Word while I'm there.
|
|
|
|
|
|
|
| |
Fixes to 'make install' in fptools/libraries. We have to maintain the
directory structure when installing the .hi files, rather than just
dumping them in a single directory as we do for packages in
fptools/hslibs.
|
|
|
|
| |
hook in timeUtils.h
|
|
|
|
| |
Time stubs (for mingw)
|
|
|
|
| |
include <limits.h> to get PATH_MAX
|
|
|
|
|
|
|
|
|
|
| |
Various updates after rearranging the directory structure in the
repository (there wasn't any history worth keeping, and it's better to
do this now before we go 'live').
Packages under 'compat' are backwards-compatibility packages which
should provide an interface equivalent to the current hslibs setup.
There are a few packages still missing.
|
|
|
|
| |
#include <stdlib.h>
|
|
|
|
|
|
| |
- Merging from ghc/lib/std
- Add System.IO.Error
- Now builds without --make, so we can do -split-objs
|
|
|
|
| |
Make this compile again, and update with latest changes from hslibs/lang.
|
|
|
|
|
| |
Merge up to the ghc/lib/std on the HEAD (tagged as
new-libraries-last-merged).
|
|
|
|
|
| |
Remove inline functions from GHC.Handle and GHC.IO, and declare them as
'extern inline' in HsCore.h.
|
|
|
|
| |
remove get_prog_arg{c,v} prototypes
|
|
|
|
| |
Track updates to ghc/lib/std and hslibs.
|
|
|
|
| |
Add a Makefile (for installing the includes)
|
|
First cut of the Haskell Core Libraries
=======================================
NOTE: it's not meant to be a working snapshot. The code is just here
to look at and so the NHC/Hugs guys can start playing around with it.
There is no build system. For GHC, the libraries tree is intended to
be grafted onto an existing fptools/ tree, and the Makefile in
libraries/core is a quick hack for that setup. This won't work at the
moment without the other changes needed in fptools/ghc, which I
haven't committed because they'll cause breakage. However, with the
changes required these sources build a working Prelude and libraries.
The layout mostly follows the one we agreed on, with one or two minor
changes; in particular the Data/Array layout probably isn't final
(there are several choices here).
The document is in libraries/core/doc as promised.
The cbits stuff is just a copy of ghc/lib/std/cbits and has
GHC-specific stuff in it. We should really separate the
compiler-specific C support from any compiler-independent C support
there might be.
Don't pay too much attention to the portability or stability status
indicated in the header of each source file at the moment - I haven't
gone through to make sure they're all consistent and make sense.
I'm using non-literate source outside of GHC/. Hope that's ok with
everyone.
We need to discuss how the build system is going to work...
|