[gnutls-dev] gnutls 0.3.0

Neil Spring nspring at cs.washington.edu
Tue Dec 18 01:28:01 CET 2001


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.




More information about the Gnutls-devel mailing list