gnutls-devel
[Top][All Lists]
Advanced

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

Re: [gnutls-dev] gnutls 0.3.0


From: Neil Spring
Subject: Re: [gnutls-dev] gnutls 0.3.0
Date: Tue Dec 18 01:28:01 2001
User-agent: Mutt/1.3.24i

Would it be useful to add numeric #defines of the gnutls
library version number?  This would make it easier to write
source code that supports multiple versions of gnutls at
compile time.  gnutls currently has a string representation
"0.3.0", but I can't use that to express the differences
between versions, like:

#if LIBGNUTLS_VERSION_MINOR >= 3
  gnutls_read(state...)
#else
  gnutls_read(sd, state...)
#endif

As an example, ALSA has a numeric version defined in
/usr/include/alsa/version.h:

  /*
   *  version.h
   */
  
  #define SND_LIB_MAJOR           0 /**< major number of library version */
  #define SND_LIB_MINOR           9 /**< minor number of library version */
  #define SND_LIB_SUBMINOR        0 /**< subminor number of library version */
  /** library version */
  #define SND_LIB_VERSION         ((SND_LIB_MAJOR<<16)|\
                                   (SND_LIB_MINOR<<8)|\
                                    SND_LIB_SUBMINOR)
  /** library version (string) */
  #define SND_LIB_VERSION_STR     "0.9.0beta9"

alternately, linux-style versions would be ok too:

/usr/src/linux/include/linux/version.h:
  #define UTS_RELEASE "2.4.9"
  #define LINUX_VERSION_CODE 132105
  #define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))

thanks, 
-neil
btw, the 0.3.0 interface looks cleaner.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]