[project @ 2001-07-23 23:08:04 by ken]
authorken <unknown>
Mon, 23 Jul 2001 23:08:04 +0000 (23:08 +0000)
committerken <unknown>
Mon, 23 Jul 2001 23:08:04 +0000 (23:08 +0000)
commitfb40b8b17e29bf1933ac27eb64ae95c0833b3727
tree7b3aa84760eed8e97bc1e7f3fec8016350bb922b
parent1a6d581fae865daa6372c7f3735781df1bda7d28
[project @ 2001-07-23 23:08:04 by ken]
Rearranged the usage help message to move --no-compile to the bottom.

More importantly-- Fixed: hsc2hs was translating

    #def inline ... function(...) { ... }

into (assuming defined(__GNUC__))

    [in the _hsc.h file:]  extern inline ... function(...)
    [in the _hsc.c file:]  inline ... function(...)

while it should really be translated into

    [in the _hsc.h file:]  extern inline ... function(...)
    [in the _hsc.c file:]  ... function(...)

(without the "inline" in the _hsc.c file).  Quoting the gcc documentation
for "inline":

>    If you specify both `inline' and `extern' in the function
> definition, then the definition is used only for inlining.  In no case
> is the function compiled on its own, not even if you refer to its
> address explicitly.  Such an address becomes an external reference, as
> if you had only declared the function, and had not defined it.
>
>    This combination of `inline' and `extern' has almost the effect of a
> macro.  The way to use it is to put a function definition in a header
> file with these keywords, and put another copy of the definition
> (lacking `inline' and `extern') in a library file.  The definition in
> the header file will cause most calls to the function to be inlined.
> If any uses of the function remain, they will refer to the single copy
> in the library.
ghc/utils/hsc2hs/Main.hs