Re: version checking... take II



On Friday, February 13, 2004, at 01:11 AM, muppet wrote:

$Gtk2::VERSION

something that occurred to me in the shower this morning...

we use $VERSION in perl to look for the version of the package.

gtk+ actually uses the macros GTK_MAJOR_VERSION, GTK_MINOR_VERSION, and GTK_MICRO_VERSION to define the API against which you're compiling, and provides GTK_CHECK_VERSION() to check if that's new enough.

the upper-case versions are compile-time, the lower-case versions are runtime.

we could use this same convention in the bindings and avoid needing either new documentation or new perl-only API.


   # tell you what the bindings are compiled for
   $Gtk2::MAJOR_VERSION
   $Gtk2::MINOR_VERSION
   $Gtk2::MICRO_VERSION
   Gtk2->CHECK_VERSION

   # tell you what the current actual runtime versions are
   $Gtk2::major_version
   $Gtk2::minor_version
   $Gtk2::micro_version
# note that this one has completely different semantics than CHECK_VERSION, even in the C API
   Gtk2->check_version


--
muppet <scott at asofyet dot org>




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]