• chak's avatar
    [project @ 2002-02-04 03:40:31 by chak] · 0299e1a1
    chak authored
    Foreign import/export declarations now conform to FFI Addendum Version 1.0
    * The old form of foreign declarations is still supported, but generates
      deprecation warnings.
    * There are some rather exotic old-style declarations which have become
      invalid as they are interpreted differently under the new scheme and there
      is no (easy) way to determine which style the programmer had in mind (eg,
      importing a C function with the name `wrapper' where the external name is
      explicitly given will not work in some situations - depends on whether an
      `unsafe' was specified and similar things).
    * Some "new" old-style forms have been introduced to make parsing a little bit
      easier (ie, avoid shift/reduce conflicts between new-style and old-style
      grammar rules), but they are few, arcane, and don't really hurt (and I won't
      tell what they are, you need to find that out by yourself ;-)
    * The FFI Addendum doesn't specify whether a header file that is requested for
      inclusion by multiple foreign declarations should be included only once or
      multiple times.  GHC at the moment includes an header as often as it appears
      in a foreign declaration.  For properly written headers, it doesn't make a
      difference anyway...
    * Library object specifications are currently silently ignored.  The feature
      was mainly requested for external calls in .NET (ie, calls which invoke C
      routines when Haskell is compiled to ILX), but those don't seem to be
      supported yet.
    * Foreign label declarations are currently broken, but they were already
      broken before I started messing with the stuff.
    The code is moderately tested.  All modules in lib/std/ and hslibs/lang/
    (using old-style declarations) still compile fine and I have run a couple of
    tests on the different forms of new-style declarations.