From e375e4a482ec9bb197c013bb015bff810e06ec4b Mon Sep 17 00:00:00 2001 From: panne Date: Sat, 11 May 2002 10:02:22 +0000 Subject: [PATCH] [project @ 2002-05-11 10:02:21 by panne] Include hschooks.h via a global option to get ghc_strlen's prototype. It's too omnipresent for per-file OPTIONS. --- ghc/compiler/Makefile | 6 +++++- ghc/compiler/main/DriverFlags.hs | 4 +--- ghc/compiler/utils/Pretty.lhs | 2 -- ghc/compiler/utils/PrimPacked.lhs | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/ghc/compiler/Makefile b/ghc/compiler/Makefile index 5d800ca..5104714 100644 --- a/ghc/compiler/Makefile +++ b/ghc/compiler/Makefile @@ -1,5 +1,5 @@ # ----------------------------------------------------------------------------- -# $Id: Makefile,v 1.216 2002/04/22 14:54:09 simonmar Exp $ +# $Id: Makefile,v 1.217 2002/05/11 10:02:21 panne Exp $ TOP = .. @@ -269,6 +269,10 @@ ifeq "$(HOSTPLATFORM)" "i386-unknown-mingw32" main/SysTools_HC_OPTS += '-\#include ' '-\#include ' endif +# ghc_strlen percolates through so many modules that it is easier to get its +# prototype via a global option instead of a myriad of per-file OPTIONS +SRC_HC_OPTS += '-\#include "hschooks.h"' + # ---------------------------------------------------------------------------- # Generate supporting stuff for prelude/PrimOp.lhs # from prelude/primops.txt diff --git a/ghc/compiler/main/DriverFlags.hs b/ghc/compiler/main/DriverFlags.hs index 2ebd51d..8a6f1a5 100644 --- a/ghc/compiler/main/DriverFlags.hs +++ b/ghc/compiler/main/DriverFlags.hs @@ -1,7 +1,5 @@ -{-# OPTIONS -#include "hschooks.h" #-} - ----------------------------------------------------------------------------- --- $Id: DriverFlags.hs,v 1.92 2002/04/22 16:06:36 simonpj Exp $ +-- $Id: DriverFlags.hs,v 1.93 2002/05/11 10:02:22 panne Exp $ -- -- Driver flags -- diff --git a/ghc/compiler/utils/Pretty.lhs b/ghc/compiler/utils/Pretty.lhs index 71f4825..d3fe50a 100644 --- a/ghc/compiler/utils/Pretty.lhs +++ b/ghc/compiler/utils/Pretty.lhs @@ -195,8 +195,6 @@ import PrelBase ( unpackCString# ) import GHC.Base ( unpackCString# ) #endif -import PrimPacked ( strLength ) - #if __GLASGOW_HASKELL__ < 411 import PrelAddr ( Addr(..) ) #else diff --git a/ghc/compiler/utils/PrimPacked.lhs b/ghc/compiler/utils/PrimPacked.lhs index db6ac9a..9fa1807 100644 --- a/ghc/compiler/utils/PrimPacked.lhs +++ b/ghc/compiler/utils/PrimPacked.lhs @@ -8,7 +8,7 @@ of bytes (character strings). Used by the interface lexer input subsystem, mostly. \begin{code} -{-# OPTIONS -monly-3-regs -optc-DNON_POSIX_SOURCE -#include "hschooks.h" #-} +{-# OPTIONS -monly-3-regs -optc-DNON_POSIX_SOURCE #-} module PrimPacked ( strLength, -- :: _Addr -> Int -- 1.7.10.4