<div>If I change </div>
<div> </div>
<div> data Sigval = SivalInt Int | SivalPtr (Ptr Char) <br></div>
<div>to ...</div>
<div> </div>
<div> newtype Sigval = Sivalint Int | SivalPtr (Ptr Char) </div>
<div> </div>
<div>then my test case builds and links. ??</div>
<div> </div>
<div> </div>
<div>Regards, Vasili</div>
<div> </div>
<div><br><br> </div>
<div class="gmail_quote">On Mon, Jun 9, 2008 at 11:01 PM, Galchin, Vasili <<a href="mailto:vigalchin@gmail.com">vigalchin@gmail.com</a>> wrote:<br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">I have tried various things to no avail ....
<div class="Ih2E3d"><br><br>vigalchin@ubuntu:~/FTP/Haskell/unix-2.2.0.0/tests/timer$ runhaskell Setup.lhs build<br>Preprocessing executables for Test-1.0...<br>Building Test-1.0...<br>[1 of 1] Compiling Main ( ./timer.hs, dist/build/timer/timer-tmp/Main.o )<br>
<br></div>./timer.hs:22:0:<br> Unacceptable argument type in foreign declaration: Sigval<br> When checking declaration:<br> foreign import ccall safe "wrapper" mkNotify<br> :: Notify -> IO (FunPtr Notify)<br>
<br>=> here is my Sigval def<br><br>data Sigval = SivalInt Int | SivalPtr (Ptr Char) <br><br>I did a find/grep for "Unacceptable argument" in the ghc compiler source and assuming no typo I didn't find. ??<br>
<br>Thanks.<br><br>Kind regards, Vasili<br><br><br><br><br>
<div class="gmail_quote">
<div class="Ih2E3d">On Mon, Jun 9, 2008 at 11:25 PM, Judah Jacobson <<a href="mailto:judah.jacobson@gmail.com" target="_blank">judah.jacobson@gmail.com</a>> wrote:<br></div>
<div>
<div></div>
<div class="Wj3C7c">
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0pt 0pt 0pt 0.8ex; BORDER-LEFT: rgb(204,204,204) 1px solid">2008/6/9 Galchin, Vasili <<a href="mailto:vigalchin@gmail.com" target="_blank">vigalchin@gmail.com</a>>:<br>
<div>> Ryan,<br>><br>> I tried but the compiler didn't seem to like the keyword "import":<br>><br>> vigalchin@ubuntu:~/FTP/Haskell/unix-2.2.0.0/tests/timer$ runhaskell<br>> Setup.lhs build<br>
> Preprocessing executables for Test-1.0...<br>> Building Test-1.0...<br>> [1 of 1] Compiling Main ( ./timer.hs,<br>> dist/build/timer/timer-tmp/Main.o )<br>><br>> ./timer.hs:29:8: parse error on input `import'<br>
><br><br></div>Hi Vasili,<br><br>To fix that error, you probably just need to add the line "Extensions:<br>ForeignFunctionInterface" to the .cabal file. (That is the<br>equivalent of calling ghc by itself with the command-line arguments<br>
-fffi or -XForeignFunctionInterface.)<br><br>Hope that helps,<br><font color="#888888">-Judah<br></font></blockquote></div></div></div><br></blockquote></div><br>