[zeromq-dev] zmq_version

Martin Sustrik sustrik at 250bpm.com
Wed Jan 27 18:35:54 CET 2010

Peter, Steven,

My preference would be to use a function rather than global variable, 
the rationale being that there are already other functions in 0MQ ABI 
but no global variable yet. That way we'll avoid any troubles that 
global variables may possibly introduce on different platforms etc.

Another question whether to expose the version as string or as tuple of 
integers. The string makes it impossible to compare two versions. Tuple 
of integers on the other hand freezes the versioning system forever. 
Currently there is major version, minor version, stability (alpha/beta 
etc.) and release ordinal, i.e. 2.0-beta3.


Peter Busser wrote:
> 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
> _______________________________________________
> zeromq-dev mailing list
> zeromq-dev at lists.zeromq.org
> http://lists.zeromq.org/mailman/listinfo/zeromq-dev

More information about the zeromq-dev mailing list