libUPnP 1.14.19
API changes after 1.10

This is a list of API changes after libUPnP version 1.10. This page contains explanation of these changes and what users need to do to migrate.

Version 1.12

list.h header changed

The list.h header was replace by a different version, now all symbols are properly namespaced with a Upnp prefix. This header was never intended to be used directly by libUPnP users, so not many should be affected.

As a side-effect of the header change, libUPnP no longer defines the true and bool macros. Users that need those should define their own or use <stdbool.h>. Additionally the following macros are no longer defined:

  • prefetch
  • container_of
  • READ_ONCE
  • WRITE_ONCE

And various list-specific macros are gone. For details see the discussion at the Github PRs #128 and #129.

Removal of TRUE, FALSE macros and BOOL type

Previously ixml.h used to define TRUE and FALSE and declared a BOOL typedef. Those macros and the typedef were removed in 10.12 in favor of just using int and 1 and 0 for true and false.

If your code relied on these being available, the cleanets fix would be to use <stdbool.h> instead. Alternatively if you can't use that or it would require too many changes to your existing source code, you can define the macros and typedef in your headers:

#ifndef __OBJC__
typedef int BOOL;
#else
/* When using Objective-C, include objc.h which defines BOOL */
#include <objc/objc.h>
#endif
#define TRUE 1
#define FALSE 0

Version 1.14

UpnpInit() has been dropped

UpnpInit() has long been deprecated and has now been dropped. Please use UpnpInit2().

Some include files have been renamed

When the template code was removed, a few files were renamed for consistency. The function calls remain the same, so the only necessary changes are in the include file names. The affected files are:

Original Name New Name
upnp/inc/ActionComplete.h upnp/inc/UpnpActionComplete.h
upnp/inc/ActionRequest.h upnp/inc/UpnpActionRequest.h
upnp/inc/Discovery.h upnp/inc/UpnpDiscovery.h
upnp/inc/Event.h upnp/inc/UpnpEvent.h
upnp/inc/EventSubscribe.h upnp/inc/UpnpEventSubscribe.h
upnp/inc/ExtraHeaders.h upnp/inc/UpnpExtraHeaders.h
upnp/inc/FileInfo.h upnp/inc/UpnpFileInfo.h
upnp/inc/StateVarComplete.h upnp/inc/UpnpStateVarComplete.h
upnp/inc/StateVarRequest.h upnp/inc/UpnpStateVarRequest.h
upnp/inc/SubscriptionRequest.h upnp/inc/UpnpSubscriptionRequest.h