On 25 February 2015 at 21:42, Richard Hughes <hughsi...@gmail.com> wrote:
> On 25 February 2015 at 21:09, Elle Stone <ellest...@ninedegreesbelow.com> 
> wrote:
>> It would be nice to have a function that returns the library version at
>> runtime (not just a header define). The reason is to prevent certain dll
>> problems with Windows, by checking that the actually used library is the
>> right one.
>
> Yes, this would be awesome for colord too; I'm happy to help with a
> patch if required.

Another "yes" from me.

Some libraries have a nice feature: the libfoo_init() function is
actually a macro, defined something like this:

#define libfoo_init () ( \
  (LIBFOO_API_VERSION < libfoo_get_api_version ()) ? ( \
    fprintf (stderr, "library / header mismatch\n"), \
    -1 \
  ) : \
    libfoo_real_init () \
)

ie. on startup it checks that the library that the program is linked
with is compatible with the headers that the calling program was built
against.

John

------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Lcms-user mailing list
Lcms-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/lcms-user

Reply via email to