[zeromq-dev] zmq_version
Peter Busser
busserpeter at gmail.com
Wed Jan 27 16:45:35 CET 2010
Steven,
Such an interface looks good to me. I am not sure, but I think that
CFFI can access foreign variables. Of course the check version
function is a great idea.
Groetjes,
Peter.
2010/1/27 Steven McCoy <steven.mccoy at miru.hk>:
> 2010/1/27 Peter Busser <busserpeter at gmail.com>
>>
>> Hi,
>>
>> I appreciate that there are libraries which provide a version as a C
>> macro. But as I have described on the dev mailing list, the Common
>> Lisp CFFI foreign function interface doesn't use header files. The
>> whole interface is specified in Lisp. In other words, not a single
>> line of C code is compiled. Therefore macros aren't very effective for
>> as far as the CL interface is concerned.
>>
>> Don't forget that a macro provides information about the version at
>> compile time, not at run-time.
>
>
> I believe Lisp not using the header files means it avoids the problems that
> the macros have been written to solve. However for your issue, both GLib
> and Protobuf provide numbers as global variables, apparently to resolve
> another problem with shared libraries,
>
> /* Glib version.
> * we prefix variable declarations so they can
> * properly get exported in windows dlls.
> */
> GLIB_VAR const guint glib_major_version;
> GLIB_VAR const guint glib_minor_version;
> GLIB_VAR const guint glib_micro_version;
> GLIB_VAR const guint glib_interface_age;
> GLIB_VAR const guint glib_binary_age;
>
> const gchar * glib_check_version (guint required_major,
> guint required_minor,
> guint required_micro);
>
> --
> Steve-o
>
More information about the zeromq-dev
mailing list