[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r34763 - libmicrohttpd/src/microhttpd
From: |
gnunet |
Subject: |
[GNUnet-SVN] r34763 - libmicrohttpd/src/microhttpd |
Date: |
Mon, 22 Dec 2014 20:42:44 +0100 |
Author: Karlson2k
Date: 2014-12-22 20:42:44 +0100 (Mon, 22 Dec 2014)
New Revision: 34763
Modified:
libmicrohttpd/src/microhttpd/daemon.c
Log:
MHD_get_version: support extraction version number from MHD_VERSION if
PACKAGE_VERSION is not defined
Modified: libmicrohttpd/src/microhttpd/daemon.c
===================================================================
--- libmicrohttpd/src/microhttpd/daemon.c 2014-12-22 19:42:38 UTC (rev
34762)
+++ libmicrohttpd/src/microhttpd/daemon.c 2014-12-22 19:42:44 UTC (rev
34763)
@@ -4421,7 +4421,21 @@
const char *
MHD_get_version (void)
{
+#ifdef PACKAGE_VERSION
return PACKAGE_VERSION;
+#else /* !PACKAGE_VERSION */
+ static char ver[12] = "\0\0\0\0\0\0\0\0\0\0\0";
+ if (0 == ver[0])
+ {
+ int res = MHD_snprintf_(ver, sizeof(ver), "%x.%x.%x",
+ (((int)MHD_VERSION >> 24) & 0xFF),
+ (((int)MHD_VERSION >> 16) & 0xFF),
+ (((int)MHD_VERSION >> 8) & 0xFF));
+ if (0 >= res || sizeof(ver) <= res)
+ return "0.0.0"; /* Can't return real version*/
+ }
+ return ver;
+#endif /* !PACKAGE_VERSION */
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r34763 - libmicrohttpd/src/microhttpd,
gnunet <=