Dear Chris,
thank you for your detailed response and sorry for my late reply (I
am often offline these days, hopefully that changes soon..).
On Feb 29, 2008, at 9:22 PM, Chris Double wrote:
glad to hear it's potentially useful!
Making it more easy to create C library bindings for Mozart is most
useful for the Mozart community!!
BTW: Did you consider adding your contribution to Collozeum?
http://gforge.info.ucl.ac.be/projects/collozeum/
All you need is getting an account here:
http://gforge.info.ucl.ac.be/account/login.php?return_to=%2Fproject%
2Frequest.php%3Fgroup_id%3D31
-------
I can confirm that your suggestion worked: I meanwhile could
successfully run your examples in ffitest.oz on MacOS.
To summarise the necessary changes I did:
1) In ozffi.cpp I changed
#include <malloc.h>
into
#include <malloc/malloc.h>
2) Again in ozffi.cpp I changed I changed
typedef void (*fn_t)();
into
typedef void (*fn_t)(...);
I am very much looking forward to see your OpenAL demo you announced
earlier :)
Best
Torsten
On Feb 29, 2008, at 9:22 PM, Chris Double wrote:
Hi Torsten, great, glad to hear it's potentially useful!
Are you using Macports? That's what I normally use on the Mac for
installing things like libffi. Otherwise if installing from source you
might be able to set the LD_LIBRARY_PATH environment variable in the
shell to /usr/local/lib for it to pick up the shared libraries without
having to link them to /usr/local/include.
ozffi.cpp:316: error: invalid conversion from 'void (*)()' to 'void
(*)(...)'
ozffi.cpp:316: error: initializing argument 2 of 'void ffi_call
(ffi_cif*, void (*)(...), void*, void**)'
This is from my cast to the ffilib function pointer to type. The code
looks something like:
typedef void (*fn_t)();
fn_t fn = (fn_t)OZ_getForeignPointer(Pointer);
ffi_call(&cif, fn, &rc, values);
Change the definition of 'fn_t' to match what the 2nd argument of
ffi_call expects from the function prototype in the ffi.h header file.
It might be different on the Mac OS X version. Maybe something like
this works:
replace:
typedef void (*fn_t)();
with
typedef void (*fn_t)(...);
I have a Macbook that I can try this in a day or so if you encounter
more problems.
Cheers,
Chris.
--
http://www.bluishcoder.co.nz
______________________________________________________________________
___________
mozart-users mailing list mozart-
[EMAIL PROTECTED]
http://www.mozart-oz.org/mailman/listinfo/mozart-users
--
Torsten Anders
Interdisciplinary Centre for Computer Music Research
University of Plymouth
Office: +44-1752-233667
Private: +44-1752-558917
http://strasheela.sourceforge.net
http://www.torsten-anders.de
_________________________________________________________________________________
mozart-users mailing list
[email protected]
http://www.mozart-oz.org/mailman/listinfo/mozart-users