UPNP_VERSION_MAJOR / UPNP_VERSION_MINOR macros defined in config.h

This commit is contained in:
Thomas Bernard 2015-09-21 22:39:30 +02:00
parent 50c68a9f03
commit 7ae5783d85
3 changed files with 24 additions and 5 deletions

View File

@ -87,8 +87,26 @@ echo "" >> ${CONFIGFILE}
echo "#include <inttypes.h>" >> ${CONFIGFILE} echo "#include <inttypes.h>" >> ${CONFIGFILE}
echo "" >> ${CONFIGFILE} echo "" >> ${CONFIGFILE}
echo "#define MINIUPNPD_VERSION \"`cat VERSION`\"" >> ${CONFIGFILE} echo "#define MINIUPNPD_VERSION \"`cat VERSION`\"" >> ${CONFIGFILE}
echo "" >> ${CONFIGFILE}
echo "#define MINIUPNPD_DATE \"$MINIUPNPD_DATE\"" >> ${CONFIGFILE} echo "#define MINIUPNPD_DATE \"$MINIUPNPD_DATE\"" >> ${CONFIGFILE}
echo "" >> ${CONFIGFILE}
cat >> ${CONFIGFILE} <<EOF
#ifndef XSTR
#define XSTR(s) STR(s)
#define STR(s) #s
#endif /* XSTR */
EOF
echo "" >> ${CONFIGFILE}
cat >> ${CONFIGFILE} <<EOF
/* UPnP version reported in XML descriptions
* 1.0 / 1.1 / 2.0 depending on which UDA (UPnP Device Architecture) Version */
#define UPNP_VERSION_MAJOR 2
#define UPNP_VERSION_MINOR 0
#define UPNP_VERSION_MAJOR_STR XSTR(UPNP_VERSION_MAJOR)
#define UPNP_VERSION_MINOR_STR XSTR(UPNP_VERSION_MINOR)
EOF
echo "" >> ${CONFIGFILE}
# OS Specific stuff # OS Specific stuff
case $OS_NAME in case $OS_NAME in

View File

@ -140,8 +140,8 @@ static const struct XMLElt rootDesc[] =
#else #else
{"device", INITHELPER(5,12)}, {"device", INITHELPER(5,12)},
#endif #endif
{"/major", "2"}, {"/major", UPNP_VERSION_MAJOR_STR},
{"/minor", "0"}, {"/minor", UPNP_VERSION_MINOR_STR},
/* 5 */ /* 5 */
{"/deviceType", DEVICE_TYPE_IGD}, {"/deviceType", DEVICE_TYPE_IGD},
/* urn:schemas-upnp-org:device:InternetGatewayDevice:1 or 2 */ /* urn:schemas-upnp-org:device:InternetGatewayDevice:1 or 2 */
@ -976,7 +976,8 @@ genServiceDesc(int * len, const struct serviceDesc * s)
str = strcat_char(str, len, &tmplen, '>'); str = strcat_char(str, len, &tmplen, '>');
str = strcat_str(str, len, &tmplen, str = strcat_str(str, len, &tmplen,
"<specVersion><major>2</major><minor>0</minor></specVersion>"); "<specVersion><major>" UPNP_VERSION_MAJOR_STR "</major>"
"<minor>" UPNP_VERSION_MINOR_STR "</minor></specVersion>");
i = 0; i = 0;
str = strcat_str(str, len, &tmplen, "<actionList>"); str = strcat_str(str, len, &tmplen, "<actionList>");

View File

@ -22,10 +22,10 @@
#define UPNP_VERSION_STRING "UPnP/1.0" #define UPNP_VERSION_STRING "UPnP/1.0"
/* according to "UPnP Device Architecture 1.1" */ /* according to "UPnP Device Architecture 1.1" */
#define UPNP_VERSION_STRING "UPnP/1.1" #define UPNP_VERSION_STRING "UPnP/1.1"
#else
/* according to "UPnP Device Architecture 2.0" */ /* according to "UPnP Device Architecture 2.0" */
#define UPNP_VERSION_STRING "UPnP/2.0" #define UPNP_VERSION_STRING "UPnP/2.0"
#endif #endif
#define UPNP_VERSION_STRING "UPnP/" UPNP_VERSION_MAJOR_STR "." UPNP_VERSION_MINOR_STR
/* server: HTTP header returned in all HTTP responses : */ /* server: HTTP header returned in all HTTP responses : */
#define MINIUPNPD_SERVER_STRING OS_VERSION " " UPNP_VERSION_STRING " MiniUPnPd/" MINIUPNPD_VERSION #define MINIUPNPD_SERVER_STRING OS_VERSION " " UPNP_VERSION_STRING " MiniUPnPd/" MINIUPNPD_VERSION