From a5ee050576c5e912fefa67473dced8a3dd8cca9f Mon Sep 17 00:00:00 2001 From: rrt Date: Fri, 13 Jul 2001 11:11:34 +0000 Subject: [PATCH] [project @ 2001-07-13 11:11:34 by rrt] Explain why errno is imported via a function --- ghc/lib/std/PrelCError.lhs | 5 +++-- ghc/lib/std/cbits/errno.c | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/ghc/lib/std/PrelCError.lhs b/ghc/lib/std/PrelCError.lhs index 0e3ac24..9979a00 100644 --- a/ghc/lib/std/PrelCError.lhs +++ b/ghc/lib/std/PrelCError.lhs @@ -1,5 +1,5 @@ % ----------------------------------------------------------------------------- -% $Id: PrelCError.lhs,v 1.9 2001/05/18 21:45:43 qrczak Exp $ +% $Id: PrelCError.lhs,v 1.10 2001/07/13 11:11:34 rrt Exp $ % % (c) The FFI task force, 2000 % @@ -117,7 +117,8 @@ import IO (IOError, Handle, ioError) -- ------------ -- import of C function that gives address of errno --- +-- This function exists because errno is a variable on some systems, but on +-- Windows it is a macro for a function... foreign import "ghcErrno" unsafe _errno :: Ptr CInt -- Haskell representation for "errno" values diff --git a/ghc/lib/std/cbits/errno.c b/ghc/lib/std/cbits/errno.c index 9f782b0..b5751f6 100644 --- a/ghc/lib/std/cbits/errno.c +++ b/ghc/lib/std/cbits/errno.c @@ -1,7 +1,7 @@ /* * (c) The University of Glasgow, 2000-2001 * - * $Id: errno.c,v 1.5 2001/05/18 16:54:06 simonmar Exp $ + * $Id: errno.c,v 1.6 2001/07/13 11:11:34 rrt Exp $ * * GHC Error Number Conversion */ @@ -9,6 +9,7 @@ #include "HsStd.h" /* Raw errno */ +/* Covers up the fact that on Windows this is a function */ int *ghcErrno(void) { return &errno; -- 1.7.10.4