[project @ 2001-08-14 13:40:07 by sewardj]
authorsewardj <unknown>
Tue, 14 Aug 2001 13:40:11 +0000 (13:40 +0000)
committersewardj <unknown>
Tue, 14 Aug 2001 13:40:11 +0000 (13:40 +0000)
commitbc5c802181b513216bc88f0d1ec9574157ee05fe
tree05a8e956456ba134ad7552dc6b3ed01045a7f997
parentb19d97709b3a5f8a6be04f113525f868cc48ad53
[project @ 2001-08-14 13:40:07 by sewardj]
Change the story about POSIX headers in C compilation.

Until now, all C code in the RTS and library cbits has by default been
compiled with settings for POSIXness enabled, that is:
   #define _POSIX_SOURCE   1
   #define _POSIX_C_SOURCE 199309L
   #define _ISOC9X_SOURCE
If you wanted to negate this, you'd have to define NON_POSIX_SOURCE
before including headers.

This scheme has some bad effects:

* It means that ccall-unfoldings exported via interfaces from a
  module compiled with -DNON_POSIX_SOURCE may not compile when
  imported into a module which does not -DNON_POSIX_SOURCE.

* It overlaps with the feature tests we do with autoconf.

* It seems to have caused borkage in the Solaris builds for some
  considerable period of time.

The New Way is:

* The default changes to not-being-in-Posix mode.

* If you want to force a C file into Posix mode, #include as
  the **first** include the new file ghc/includes/PosixSource.h.
  Most of the RTS C sources have this include now.

* NON_POSIX_SOURCE is almost totally expunged.  Unfortunately
  we have to retain some vestiges of it in ghc/compiler so that
  modules compiled via C on Solaris using older compilers don't
  break.
58 files changed:
configure.in
ghc/compiler/ghci/ByteCodeItbls.lhs
ghc/compiler/ghci/ByteCodeLink.lhs
ghc/compiler/main/DriverState.hs
ghc/compiler/main/Main.hs
ghc/compiler/prelude/PrelRules.lhs
ghc/compiler/utils/PrimPacked.lhs
ghc/compiler/utils/StringBuffer.lhs
ghc/includes/PosixSource.h [new file with mode: 0644]
ghc/includes/Stg.h
ghc/lib/std/PrelPosix.hsc
ghc/lib/std/Time.hsc
ghc/lib/std/cbits/inputReady.c
ghc/lib/std/cbits/system.c
ghc/rts/Adjustor.c
ghc/rts/BlockAlloc.c
ghc/rts/ClosureFlags.c
ghc/rts/Disassembler.c
ghc/rts/FrontPanel.c
ghc/rts/GC.c
ghc/rts/GCCompact.c
ghc/rts/Hash.c
ghc/rts/Interpreter.c
ghc/rts/Itimer.c
ghc/rts/Linker.c
ghc/rts/LinkerBasic.c
ghc/rts/MBlock.c
ghc/rts/Main.c
ghc/rts/Printer.c
ghc/rts/ProfHeap.c
ghc/rts/Profiling.c
ghc/rts/Proftimer.c
ghc/rts/RtsAPI.c
ghc/rts/RtsAPIDeprec.c
ghc/rts/RtsDllMain.c
ghc/rts/RtsFlags.c
ghc/rts/RtsStartup.c
ghc/rts/RtsUtils.c
ghc/rts/Sanity.c
ghc/rts/Schedule.c
ghc/rts/Select.c
ghc/rts/Signals.c
ghc/rts/Sparks.c
ghc/rts/Stable.c
ghc/rts/Stats.c
ghc/rts/StgCRun.c
ghc/rts/StgPrimFloat.c
ghc/rts/Storage.c
ghc/rts/StrHash.c
ghc/rts/Ticky.c
ghc/rts/VisCallbacks.c
ghc/rts/Weak.c
ghc/rts/parallel/HLComms.c
ghc/rts/parallel/LLComms.c
ghc/rts/parallel/ParInit.c
ghc/rts/parallel/SysMan.c
ghc/tests/codeGen/should_run/cg035.hs
mk/config.h.in