Re: check_version

2005-07-18 Thread Simon Josefsson
Bruno Haible <[EMAIL PROTECTED]> writes: > Simon Josefsson wrote: >> having a AC_DEFINE seem somewhat hackish. > > No, why is this odd? Here's what I use in gettext to avoid collisions of > the "lock in libintl" with "lock outside libintl". Perhaps it is OK. I had another reason for disliking th

Re: check_version

2005-07-18 Thread Bruno Haible
Simon Josefsson wrote: > having a AC_DEFINE seem somewhat hackish. No, why is this odd? Here's what I use in gettext to avoid collisions of the "lock in libintl" with "lock outside libintl". dnl Rename some macros and functions used for locking. AH_BOTTOM([ #define glthread_lock_init libi

Re: check_version

2005-07-16 Thread Simon Josefsson
Bruno Haible <[EMAIL PROTECTED]> writes: >> The gnulib module could set >> something like that up, to avoid manual config.h additions. > > The name of the xxx_check_version function is something that each package > will want to define explicitly. I don't think deducing its name through a > rule is

Re: check_version

2005-07-14 Thread Simon Josefsson
Bruno Haible <[EMAIL PROTECTED]> writes: >> The gnulib module could set >> something like that up, to avoid manual config.h additions. > > The name of the xxx_check_version function is something that each package > will want to define explicitly. I don't think deducing its name through a > rule is

Re: check_version

2005-07-14 Thread Bruno Haible
Simon Josefsson wrote: > > #define stringprep_check_version check_version > > instead of a function that calls check_version. > > I assume you meant: > > #define check_version stringprep_check_version Yes, it's backwards. (I was thinking about changing check_version into a macro.) > Perhaps che

Re: check_version

2005-07-14 Thread Simon Josefsson
Bruno Haible <[EMAIL PROTECTED]> writes: > Simon Josefsson wrote: >> +const char * >> +check_version (const char *req_version) >> +{ >> + if (!req_version || strverscmp (req_version, VERSION) < 0) >> +return VERSION; >> + >> + return NULL; >> +} >> ... >> You will typically wrap the call to

Re: [bug-gnulib] Re: check_version

2005-07-11 Thread Bruno Haible
Simon Josefsson wrote: > +const char * > +check_version (const char *req_version) > +{ > + if (!req_version || strverscmp (req_version, VERSION) < 0) > +return VERSION; > + > + return NULL; > +} > ... > You will typically wrap the call to the > `check_version' function through a library API,

Re: check_version

2005-06-28 Thread Simon Josefsson
Derek Price <[EMAIL PROTECTED]> writes: > Simon Josefsson wrote: > >>+ if (!req_version || strverscmp (req_version, VERSION) < 0) >>+return VERSION; >> >> > > Why did you choose to call the version string "VERSION" rather than > using the "PACKAGE_VERSION" string automatically defined by AC

Re: check_version

2005-06-28 Thread Derek Price
Simon Josefsson wrote: >No particular reason. VERSION is defined automatically by AC_INIT >too, is it not? Is there a difference between PACKAGE_VERSION and >VERSION? I'd be happy to change, it doesn't matter for me. > > The CVS config.h is only showing `PACKAGE_VERSION'. Regards, Derek

Re: check_version

2005-06-28 Thread Derek Price
Simon Josefsson wrote: >Ok, unless someone suggests otherwise, I'll change it to >PACKAGE_VERSION later tonight. Perhaps it is Automake that define >VERSION. > > The CVS project uses Automake 1.9.5 and Autoconf 2.59 and VERSION does not get defined. We might not be using a macro that defines

Re: check_version

2005-06-28 Thread Simon Josefsson
Derek Price <[EMAIL PROTECTED]> writes: > Simon Josefsson wrote: > >>No particular reason. VERSION is defined automatically by AC_INIT >>too, is it not? Is there a difference between PACKAGE_VERSION and >>VERSION? I'd be happy to change, it doesn't matter for me. >> >> > > The CVS config.h is

Re: check_version

2005-06-28 Thread Derek Price
Simon Josefsson wrote: >+ if (!req_version || strverscmp (req_version, VERSION) < 0) >+return VERSION; > > Why did you choose to call the version string "VERSION" rather than using the "PACKAGE_VERSION" string automatically defined by AC_INIT? Regards, Derek __

Re: check_version

2005-06-28 Thread Simon Josefsson
Jim Meyering <[EMAIL PROTECTED]> writes: > Simon Josefsson <[EMAIL PROTECTED]> wrote: >> Ah, right. I accidentally installed the m4 file. Ok to install the >> rest too? > > Sure. It looks fine to me. Done. ___ bug-gnulib mailing list bug-gnulib@gnu

Re: check_version

2005-06-28 Thread Simon Josefsson
Jim Meyering <[EMAIL PROTECTED]> writes: > Simon Josefsson <[EMAIL PROTECTED]> wrote: >> Paul Eggert <[EMAIL PROTECTED]> writes: >> >>> Simon Josefsson <[EMAIL PROTECTED]> writes: >>> /* Check version of libgcrypt. */ if (!gcry_check_version (GCRYPT_VERSION))

Re: check_version

2005-06-28 Thread Jim Meyering
Simon Josefsson <[EMAIL PROTECTED]> wrote: > Ah, right. I accidentally installed the m4 file. Ok to install the > rest too? Sure. It looks fine to me. Thanks. ___ bug-gnulib mailing list bug-gnulib@gnu.org http://lists.gnu.org/mailman/listinfo/bug-g

Re: check_version

2005-06-28 Thread Jim Meyering
Simon Josefsson <[EMAIL PROTECTED]> wrote: > Paul Eggert <[EMAIL PROTECTED]> writes: > >> Simon Josefsson <[EMAIL PROTECTED]> writes: >> >>>/* Check version of libgcrypt. */ >>>if (!gcry_check_version (GCRYPT_VERSION)) >>> die ("version mismatch\n"); >> >> Can't you use str

Re: check_version

2005-06-27 Thread Simon Josefsson
Jim Meyering <[EMAIL PROTECTED]> writes: > Simon Josefsson <[EMAIL PROTECTED]> wrote: >> Not sure I follow the higher-level language part... Perhaps I should >> explain more what I use this for. >> >> I use it in my libraries, which are all written in C. The source code > > Thanks for explaining.

Re: check_version

2005-06-27 Thread Simon Josefsson
Paul Eggert <[EMAIL PROTECTED]> writes: > Simon Josefsson <[EMAIL PROTECTED]> writes: > >>/* Check version of libgcrypt. */ >>if (!gcry_check_version (GCRYPT_VERSION)) >> die ("version mismatch\n"); > > Can't you use strverscmp for this? E.g.: > > if (strverscmp (GCRY

Re: check_version

2005-06-26 Thread Paul Eggert
Simon Josefsson <[EMAIL PROTECTED]> writes: >/* Check version of libgcrypt. */ >if (!gcry_check_version (GCRYPT_VERSION)) > die ("version mismatch\n"); Can't you use strverscmp for this? E.g.: if (strverscmp (GCRYPT_VERSION, VERSION) < 0) die ("version mismatc

Re: check_version

2005-06-25 Thread Jim Meyering
Simon Josefsson <[EMAIL PROTECTED]> wrote: > Not sure I follow the higher-level language part... Perhaps I should > explain more what I use this for. > > I use it in my libraries, which are all written in C. The source code Thanks for explaining. That's what I suspected. What do you think about

Re: check_version

2005-06-25 Thread Simon Josefsson
Jim Meyering <[EMAIL PROTECTED]> writes: > Simon Josefsson <[EMAIL PROTECTED]> wrote: >> I'm using this module in all of my GNU packages. One complication >> might be that it depends on VERSION being defined. Feedback >> appreciated. > > Looks useful, but sounds like a job better implemented > i

Re: check_version

2005-06-25 Thread Jim Meyering
Simon Josefsson <[EMAIL PROTECTED]> wrote: > I'm using this module in all of my GNU packages. One complication > might be that it depends on VERSION being defined. Feedback > appreciated. Looks useful, but sounds like a job better implemented in a higher level language. But maybe you have const

Re: check_version

2005-06-25 Thread Simon Josefsson
Simon Josefsson <[EMAIL PROTECTED]> writes: > Index: lib/check_version.c Just realized: it should #include check_version.h. Other than that, I have now built and tested the module in one project. ___ bug-gnulib mailing list bug-gnulib@gnu.org http://