| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
| |
Are we nearly there yet?
|
|
|
|
|
| |
e.g. -- // ensures that _no_ preprocessor will try to tokenise the
rest of the line.
|
|
|
|
|
|
|
|
|
|
| |
These two headers are only ever used for pre-processing Haskell code,
and are never seen by any C tools except cpp. Using the Haskell comment
convention means that cpphs no longer needs to be given the --strip
option to remove C comments from open code. This is a Good Thing,
because all of /* */ and // are valid Haskell operator names, and there
is no compelling reason to forbid using them in files which also happen
to have C-preprocessor directives.
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
Merge to stable, checking for interface changes.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
| |
* made the wrapround of the underlying O/S occur before the wrapround
of the delayed threads by making threads delay in microseconds since
O/S epoch (1970 - Unix, 1601 - Windows) stored in Word64.
* removed redundant calls reading O/S realtime clock
* removed rounding to 1/50th of sec for timers
* Only for Unix version of scheduler.
|
|
|
|
|
|
| |
I understand this is more portable, and it also fixes warnings when
C things we are wrapping are themselves static inlines (which FD_ISSET
is on ppc OS X).
|
|
|
|
|
|
| |
Fixes #637. The test program in that report now works for me with
-threaded, but it doesn't work without -threaded (I don't know if
that's new behaviour or not, though).
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
| |
The only remaining use is in cbits/dirUtils.h, which tests solaris2_HOST_OS
(Also System.Info uses ghcplatform.h and several modules import MachDeps.h
to get SIZEOF_* and ALIGNMENT_* from ghcautoconf.h)
|
| |
|
|
|
|
|
|
|
|
|
| |
This patch imports the Data.ByteString.Lazy module, and its helpers,
providing a ByteString implemented as a lazy list of strict cache-sized
chunks. This type allows the usual lazy operations to be written on
bytestrings, including lazy IO, with much improved space and time over
the [Char] equivalents.
|
| |
|
|
|
|
|
| |
Part 2 of the fix for threaded RTS problems on Solaris and possibly
*BSD (Part 1 was the same change in ghc/includes/Rts.h).
|
|
|
|
| |
plus much tweaking of imports to avoid cycles
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch brings Data.ByteString into sync with the FPS head.
The most significant of which is the new Haskell counting sort.
Changes:
Sun Apr 30 18:16:29 EST 2006 sjanssen@cse.unl.edu
* Fix foldr1 in Data.ByteString and Data.ByteString.Char8
Mon May 1 11:51:16 EST 2006 Don Stewart <dons@cse.unsw.edu.au>
* Add group and groupBy. Suggested by conversation between sjanssen and petekaz on #haskell
Mon May 1 16:42:04 EST 2006 sjanssen@cse.unl.edu
* Fix groupBy to match Data.List.groupBy.
Wed May 3 15:01:07 EST 2006 sjanssen@cse.unl.edu
* Migrate to counting sort.
Data.ByteString.sort used C's qsort(), which is O(n log n). The new algorithm
is O(n), and is faster for strings larger than approximately thirty bytes. We
also reduce our dependency on cbits!
|
| |
|
|
|
|
|
| |
Fast, packed byte vectors, providing a better PackedString.
|
|
|
|
|
|
|
|
|
|
| |
- move forkIO into GHC.Conc, so that the I/O manager can use proper forkIO
with an exception handler. This required TopHandler.lhs-boot. It's the
right thing, though, since the forkIO implementation is GHC-specific.
- check for out-of-range file descriptors in the I/O manager, rather than
just exploding. The I/O manager will exit ungracefully, but at least
there will be an error message.
|
|
|
|
| |
For compilers other than MSVC and GCC, assume inline has the C99 semantics.
|
|
|
|
| |
PrelHandle functions are only needed by GHC
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
[mingw only]
Work around bug in win32 Console API which showed up in the GHCi UI:
if the user typed in characters prior to the appearance of the prompt,
the first of these characters always came out as a 'g'. The GHCi UI does
for good reasons one-character reads from 'stdin', which causes the
underlying APIs to become confused. A simple repro case is the following
piece of C code:
/*----------------------*/
#include <stdio.h>
#include <windows.h>
int main()
{
char ch1,ch2;
HANDLE hStdIn = GetStdHandle(STD_INPUT_HANDLE);
DWORD dw;
/* Type in some characters before the prompt appears and be amused.. */
sleep(1000); printf("? ");
ReadConsoleA(hStdIn,&ch1,1,&dw,NULL);
ReadConsoleA(hStdIn,&ch2,1,&dw,NULL);
/* or, if you want to use libc:
read(0,&ch1,1); read(0,&ch2,1); */
printf("%c%c\n", ch1,ch2);
return 0;
}
/*----------------------*/
This happens across win32 OSes, and I can't see anything untoward as far
as API usage goes (the GHC IO implementation uses read(), but that
reduces to ReadConsoleA() calls.) People inside the Behemoth might want
to have a closer look at this..
Not much we can do about this except work around the problem by flushing
the input buffer prior to reading from stdin. Not ideal, as type-ahead
is a useful feature. Flushing is handled by GHC.ConsoleHandler.flushConsole
Merge to STABLE.
|
|
|
|
|
| |
Determine the location of CMD.EXE (or COMMAND.COM) using the same
algorithm as system() from msvcrt.
|
|
|
|
|
|
|
|
|
|
| |
* Some preprocessors don't like the C99/C++ '//' comments after a
directive, so use '/* */' instead. For consistency, a lot of '//' in
the include files were converted, too.
* UnDOSified libraries/base/cbits/runProcess.c.
* My favourite sport: Killed $Id$s.
|
|
|
|
|
|
|
|
|
|
|
|
| |
[Windows only]
for System.Directory / Compat.Directory functionality that probes the OS
for local details re: misc user directories, perform late binding of
SHGetFolderPath() from shell32.dll, as it may not be present.
(cf. ghc-6.4's failure to operate on Win9x / NT boxes.) If the API isn't
there, fail with UnsupportedOperation.
Packages.readPackageConfigs: gracefully handle excns from getAppUserDataDirectory.
Merge to STABLE.
|
|
|
|
|
|
|
| |
Add Dimitry Golubovsky <dimitry@golubovsky.org>'s Unicode character
class implementation. This will remove the dependency on libc's
locale code and give us much more consistent support for Unicode
across platforms.
|
|
|
|
| |
*Config.h files are in include/ (MERGE to STABLE)
|
|
|
|
| |
more regex test down to libraries/base
|
|
|
|
|
|
|
|
|
|
| |
Some improvements to System.Cmd.{system,rawSystem} on Un*x systems:
these commands now do the appropriate signal handling, namely ignoring
SIGINT/SIGQUIT in the parent but allowing these signals in the child.
This behaviour matches the Un*x system().
What this means is that when System.Cmd.system is executing, ^C only
kills the child process, the parent will see an exception.
|
|
|
|
|
|
|
|
| |
- The output from uncaught exceptions handler is redirected to RTS's errorBelch.
- The output from Debug.Trace is redirected to RTS's debugBelch
- Usually errorBelch and debugBelch messages go to stderr except for
Windows GUI applications. For GUI applications the Debug.Trace output is
redirected to debug console and the exceptions message is displayed in message box.
|
|
|
|
|
|
|
| |
Catch up with updates to platform #defines.
Generally: use _HOST_ rather than _TARGET_ (except in Cabal where we
have to retain compatibility with previous GHC versions).
|
|
|
|
|
|
| |
Added implementation for hSetFileSize. The configure script checks
for _chsize (usially Windows) and ftruncate (Linux) C functions
and the package uses one of them to implement hSetFileSize.
|
|
|
|
|
|
|
|
| |
According to the documentation, the Haskell implementation of Handle
should implement single writer/multiple readers locking but the current
implementation doesn't work under Windows. This commit fixes this using
'_sopen' function instead of 'open'. The former allows to implement system
level locking on Windows. The changes doesn't affect other platforms.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
'd->d_name' (where d is of type 'struct dirent*') should always return a pointer
to the directory entry's name, regardless if dirent is defined as
struct dirent { ... ; char d_name[...]; }
or
struct dirent { ... ; char* d_name; }
No need for autoconf trickery here.
|
|
|
|
|
|
|
|
|
|
|
| |
* Changed some '#include "ghcconfig.h"' to '#include "HsBaseConfig.h"' (or added
the latter), tracking the recent autoconf-related changes.
* Continued my crusade against CVS keywords.
* Made CTypes.h self-contained.
* Protected headers against multiple inclusions.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Threaded RTS improvements:
- Unix only: implement waitRead#, waitWrite# and delay# in Haskell,
by having a single Haskell thread (the IO manager) performing a blocking
select() operation. Threads communicate with the IO manager
via channels. This is faster than doing the select() in the RTS,
because we only restart the select() when a new request arrives,
rather than each time around the scheduler.
On Windows we just make blocking IO calls, we don't have a fancy IO
manager (yet).
- Simplify the scheduler for the threaded RTS, now that we don't have
to wait for IO in the scheduler loop.
- Remove detectBlackHoles(), which isn't used now (not sure how long
this has been unused for... perhaps it was needed back when main threads
used to be GC roots, so we had to check for blackholes manually rather
than relying on the GC.)
Signals aren't quite right in the threaded RTS. In fact, they're
slightly worse than before, because the thread receiving signals might
be blocked in a C call - previously there always be another thread
stuck in awaitEvent() that would notice the signal, but that's not
true now. I can't see an easy fix yet.
|
|
|
|
| |
revert previous change, so now these includes don't define PACKAGE_*
|
|
|
|
| |
Fix order of PACKAGE_* #undefs. They must appear before HsBaseConfig.h
|
|
|
|
|
| |
Add getEnvironment from hslibs/lang/SystemExts. This differs from the
System.Posix.Env version in not failing if an entry lacks an '=' sign.
|
|
|
|
| |
make the evil PACKAGE_* hacks consistent
|
|
|
|
| |
Nonexistent file stopped entire install for libraries.
|
|
|
|
|
|
| |
Undef PACKAGE_NAME PACKAGE_STRING PACKAGE_BUGREPORT PACKAGE_TARNAME
coming in from ghcconfig.h, so that we can use HsBaseConfig.h versions
without screenfulls of cpp warnings.
|