Now, we are developing a binding of MagickWand for programming language Vala (live.gnome.org/Vala/) a relative promised language. Vala-compiler compiles Vala code into C code and we can further use C code. For the compilation from C code to object file, it need a memory size of any struct for memory allocation. However the type MagickWand does not have any structure to give the size of memory allocation. Hence, an error occurs by using MagickWand without pointer. E.g., Vala generates C-code like :
MagickWand _tmp2_;
To solve this problem, it is really simple and works out of the box. We edit MagickWand.h from :
typedef struct _MagickWand
MagickWand;
to :
typedef struct _MagickWand{}
MagickWand;
and everything is done.
Now, we are using this code for our internal patch. And it would be very nice, if the patch is added to the trunk of ImageMagick.
Patch for Vala Binding
-
- Posts: 1
- Joined: 2013-01-12T04:17:02-07:00
- Authentication code: 6789
Re: Patch for Vala Binding
When we add your patch, we get:
- make[2]: Entering directory `/home/cristy/ImageMagick-6.8.1-9'
CC MagickWand/MagickWand_libMagickWand_Q16_la-deprecate.lo
In file included from MagickWand/deprecate.c:45:0:
./MagickWand/magick-wand-private.h:32:8: error: redefinition of 'struct _MagickWand'
In file included from ./MagickWand/studio.h:204:0,
from MagickWand/deprecate.c:43:
./MagickWand/MagickWand.h:144:16: note: originally defined here
In file included from MagickWand/deprecate.c:45:0:
./MagickWand/magick-wand-private.h:33:1: error: expected identifier or '(' before '{' token
make[2]: *** [MagickWand/MagickWand_libMagickWand_Q16_la-deprecate.lo] Error 1
Re: Patch for Vala Binding
I signed up just to comment on how awesome ImageMagick bindings for Vala would be. Hope you'll get this to work, looking very much forward to it.
Re: Patch for Vala Binding
Not much we can do here. The suggested patch causes a compile error when building ImageMagick. Instead any bug report should go to the Vala developers. It should bind with any proper C syntax.