Skip to content

Commit

Permalink
Fix build with pupnp >= 1.14.13
Browse files Browse the repository at this point in the history
Rename EXPORT_SPEC to UPNP_EXPORT_SPEC to avoid the following build
failure with pupnp >= 1.14.13 and
pupnp/pupnp@2f99af2:

In file included from src/threadutil/FreeList.h:43,
                 from src/threadutil/TimerThread.h:39,
                 from src/gatedevice.h:32,
                 from src/gatedevice.c:38:
src/threadutil/ithread.h:917:12: error: expected ';' before 'int'
  917 | EXPORT_SPEC int pthread_mutexattr_setkind_np(
      |            ^~~~
      |            ;

Fixes:
 - http://autobuild.buildroot.org/results/2eebf8264327bd492ee8cadc0c539d42c4f2e252

Signed-off-by: Fabrice Fontaine <fabrice.fontaine@orange.com>
  • Loading branch information
ffontaine committed Oct 15, 2022
1 parent 9c8b4f2 commit 3544a88
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
6 changes: 3 additions & 3 deletions linuxigd2/src/threadutil/ThreadPool.h
Expand Up @@ -41,7 +41,7 @@
#include "ithread.h"
#include "LinkedList.h"
#include "UpnpInet.h"
#include "UpnpGlobal.h" /* for UPNP_INLINE, EXPORT_SPEC */
#include "UpnpGlobal.h" /* for UPNP_INLINE, UPNP_EXPORT_SPEC */

#include <errno.h>

Expand Down Expand Up @@ -505,7 +505,7 @@ int TPAttrSetMaxJobsTotal(
* \return Always returns 0.
*/
#ifdef STATS
EXPORT_SPEC int ThreadPoolGetStats(
UPNP_EXPORT_SPEC int ThreadPoolGetStats(
/*! Valid initialized threadpool. */
ThreadPool *tp,
/*! Valid stats, out parameter. */
Expand All @@ -522,7 +522,7 @@ int TPAttrSetMaxJobsTotal(
* \brief
*/
#ifdef STATS
EXPORT_SPEC void ThreadPoolPrintStats(
UPNP_EXPORT_SPEC void ThreadPoolPrintStats(
/*! . */
ThreadPoolStats *stats);
#else
Expand Down
12 changes: 6 additions & 6 deletions linuxigd2/src/threadutil/UpnpGlobal.h
Expand Up @@ -17,22 +17,22 @@

#ifdef _WIN32
/*
* EXPORT_SPEC
* UPNP_EXPORT_SPEC
*/
#if defined _MSC_VER || defined __BORLANDC__
#ifdef UPNP_STATIC_LIB
#define EXPORT_SPEC
#define UPNP_EXPORT_SPEC
#else /* UPNP_STATIC_LIB */
#ifdef LIBUPNP_EXPORTS
/*! set up declspec for dll export to make functions
* visible to library users */
#define EXPORT_SPEC __declspec(dllexport)
#define UPNP_EXPORT_SPEC __declspec(dllexport)
#else /* LIBUPNP_EXPORTS */
#define EXPORT_SPEC __declspec(dllimport)
#define UPNP_EXPORT_SPEC __declspec(dllimport)
#endif /* LIBUPNP_EXPORTS */
#endif /* UPNP_STATIC_LIB */
#else /* _MSC_VER || __BORLANDC__ */
#define EXPORT_SPEC
#define UPNP_EXPORT_SPEC
#endif /* _MSC_VER || __BORLANDC__ */

/*
Expand Down Expand Up @@ -88,7 +88,7 @@
* definition upon declaration or it will not be exported on WIN32
* DLLs.
*/
#define EXPORT_SPEC
#define UPNP_EXPORT_SPEC

/*!
* \brief Declares an inline function.
Expand Down
4 changes: 2 additions & 2 deletions linuxigd2/src/threadutil/ithread.h
Expand Up @@ -41,7 +41,7 @@
#include <sys/param.h>
#endif

#include "UpnpGlobal.h" /* For UPNP_INLINE, EXPORT_SPEC */
#include "UpnpGlobal.h" /* For UPNP_INLINE, UPNP_EXPORT_SPEC */
#include "UpnpUniStd.h" /* for close() */

#ifdef __cplusplus
Expand Down Expand Up @@ -914,7 +914,7 @@ static UPNP_INLINE int ithread_cleanup_thread(void)
/* !defined(UPNP_USE_MSVCPP) should probably also have pthreads version check -
* but it's not clear if that is possible */
/* NK: Added for satisfying the gcc compiler */
EXPORT_SPEC int pthread_mutexattr_setkind_np(
UPNP_EXPORT_SPEC int pthread_mutexattr_setkind_np(
pthread_mutexattr_t *attr, int kind);
#endif

Expand Down

0 comments on commit 3544a88

Please sign in to comment.