Thanks for the bug report. I've checked in a fix for 1), but
for 2), I suggest instead of doing

  void pj_set_finder( const char *(*)(const char *) );

you express this as

  typedef [string]char* (*StringTrans) ([in,string]char* arg1);
  void pj_set_finder([in]StringTrans arg);

as HDirect doesn't currently handle 'const' qualifiers as well as it
could.

--sigbjorn

----- Original Message -----
From: "Mike Thomas" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Cc: "Sigbjorn Finne" <[EMAIL PROTECTED]>
Sent: Wednesday, November 07, 2001 15:42
Subject: HDirect (CVS version) - some bugs


> Hi there.
>
> Attached is a small zip file containing some idl and header files which
are
> meant to define an interface to Frank Warmerdam's map projection library.
>
> The problems can be reproduced by unzipping, going to the top level
> directory and running "make".  I am using Windows NT GHC 5.02 and CVS
> version of HDirect.
>
> 1. The C stub code ("Proj.c") generated for structures defined in the idl
> with lower-case leading characters has upper case leading characters eg:
> projXY in the IDL is converted to ProjXY.  I have worked around this by
> including a header file ("nameconvert.h") with macros which change the
names
> back to those used in the library headers, but this is messy.
>
> 2. The Haskell code ("Proj.hs") contains some strange definitions to do
with
> a datatype "IHC_TAG_0", which causes the errors below when compiled.   The
> datatype is associated with a function which takes another function as an
> argument:
>
>     void pj_set_finder( const char *(*)(const char *) );
>
> Cheers
>
> Mike Thomas
>
> --------------- IHC_TAG_0 error messages ----------------
>
> ghc -c -package lang -package com -fglasgow-exts -fvia-C Proj.hs -o
> proj_hs.o
>
> Proj.hs:338:
>     Couldn't match
>         `PrelMaybe.Maybe (PrelBase.Char -> PrelIOBase.IO PrelBase.Char)'
>         against
>         `IHC_TAG_0'
>         Expected type: PrelMaybe.Maybe
>                            (PrelBase.Char -> PrelIOBase.IO PrelBase.Char)
>         Inferred type: IHC_TAG_0
>     In the third argument of `HDirect.marshallref', namely `arg10'
>     In a 'do' expression pattern binding:
>         arg10 <- HDirect.marshallref (HDirect.allocBytes (PrelReal.toInt
> sizeofI
> HC_TAG_0))
>                                      (HDirect.writeunique
> (HDirect.allocBytes (P
> relReal.toInt sizeofIHC_TAG_0))
>                                                           writeIHC_TAG_0)
>                                      arg10
> make: *** [proj_hs.o] Error 1
>


_______________________________________________
Glasgow-haskell-bugs mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to