Windows-port: some special code and switches for statical libraries added
git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@73 119443c7-1b9e-41f8-b6fc-b9c35fce742c
This commit is contained in:
parent
736efca5dd
commit
8c21b2c4d9
6
README
6
README
@ -272,6 +272,12 @@ Rename Pre-build.2 to pthreads.
|
||||
Open the provided workspace build\libupnp.dsw with Visual C++ 6.0 and select
|
||||
Build->Build libupnp.dll (F7)
|
||||
|
||||
For building a static library instead of a DLL and for using the static
|
||||
pthreads-w32 library following switches need to be defined additionally:
|
||||
|
||||
UPNP_STATIC_LIB - for creating a statically linkable UPnP-library
|
||||
PTW32_STATIC_LIB - for using the static pthreads32 library
|
||||
|
||||
|
||||
5) Install/Uninstall Instructions
|
||||
-------------------------------------------
|
||||
|
@ -38,11 +38,15 @@
|
||||
#include <assert.h>
|
||||
|
||||
#ifdef WIN32
|
||||
#ifdef LIBUPNP_EXPORTS
|
||||
// set up declspec for dll export to make functions visible to library users
|
||||
#define EXPORT_SPEC __declspec(dllexport)
|
||||
#ifndef UPNP_STATIC_LIB
|
||||
#ifdef LIBUPNP_EXPORTS
|
||||
// set up declspec for dll export to make functions visible to library users
|
||||
#define EXPORT_SPEC __declspec(dllexport)
|
||||
#else
|
||||
#define EXPORT_SPEC __declspec(dllimport)
|
||||
#endif
|
||||
#else
|
||||
#define EXPORT_SPEC __declspec(dllimport)
|
||||
#define EXPORT_SPEC
|
||||
#endif
|
||||
#else
|
||||
#define EXPORT_SPEC
|
||||
|
@ -527,11 +527,15 @@ extern "C" {
|
||||
#define imillisleep(x) usleep(1000*x)
|
||||
|
||||
#ifdef WIN32
|
||||
#ifdef LIBUPNP_EXPORTS
|
||||
// set up declspec for dll export to make functions visible to library users
|
||||
#define EXPORT_SPEC __declspec(dllexport)
|
||||
#ifndef UPNP_STATIC_LIB
|
||||
#ifdef LIBUPNP_EXPORTS
|
||||
// set up declspec for dll export to make functions visible to library users
|
||||
#define EXPORT_SPEC __declspec(dllexport)
|
||||
#else
|
||||
#define EXPORT_SPEC __declspec(dllimport)
|
||||
#endif
|
||||
#else
|
||||
#define EXPORT_SPEC __declspec(dllimport)
|
||||
#define EXPORT_SPEC
|
||||
#endif
|
||||
#else
|
||||
#define EXPORT_SPEC
|
||||
|
@ -382,6 +382,12 @@ tp->stats.totalJobsLQ++; tp->stats.totalTimeLQ += diff; break; default:
|
||||
int retCode = 0;
|
||||
int persistent = -1;
|
||||
ThreadPool *tp = ( ThreadPool * ) arg;
|
||||
//leuk_he allow static linking
|
||||
#ifdef WIN32
|
||||
#ifdef PTW32_STATIC_LIB
|
||||
pthread_win32_thread_attach_np();
|
||||
#endif
|
||||
#endif
|
||||
|
||||
assert( tp != NULL );
|
||||
|
||||
@ -449,7 +455,12 @@ tp->stats.totalJobsLQ++; tp->stats.totalTimeLQ += diff; break; default:
|
||||
tp->totalThreads--;
|
||||
ithread_cond_broadcast( &tp->start_and_shutdown );
|
||||
ithread_mutex_unlock( &tp->mutex );
|
||||
|
||||
//leuk_he
|
||||
#ifdef WIN32
|
||||
#ifdef PTW32_STATIC_LIB
|
||||
pthread_win32_thread_detach_np ();
|
||||
#endif
|
||||
#endif
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@ -478,6 +489,12 @@ tp->stats.totalJobsLQ++; tp->stats.totalTimeLQ += diff; break; default:
|
||||
ithread_cond_broadcast( &tp->start_and_shutdown );
|
||||
|
||||
ithread_mutex_unlock( &tp->mutex );
|
||||
//leuk_he
|
||||
#ifdef WIN32
|
||||
#ifdef PTW32_STATIC_LIB
|
||||
pthread_win32_thread_detach_np ();
|
||||
#endif
|
||||
#endif
|
||||
|
||||
return NULL;
|
||||
} else {
|
||||
@ -705,6 +722,12 @@ tp->stats.totalJobsLQ++; tp->stats.totalTimeLQ += diff; break; default:
|
||||
if( tp == NULL ) {
|
||||
return EINVAL;
|
||||
}
|
||||
//leuk_he
|
||||
#ifdef WIN32
|
||||
#ifdef PTW32_STATIC_LIB
|
||||
pthread_win32_process_attach_np();
|
||||
#endif
|
||||
#endif
|
||||
|
||||
retCode += ithread_mutex_init( &tp->mutex, NULL );
|
||||
assert( retCode == 0 );
|
||||
|
@ -47,11 +47,15 @@
|
||||
#endif
|
||||
|
||||
#ifdef WIN32
|
||||
#ifdef LIBUPNP_EXPORTS
|
||||
// set up declspec for dll export to make functions visible to library users
|
||||
#define EXPORT_SPEC __declspec(dllexport)
|
||||
#ifndef UPNP_STATIC_LIB
|
||||
#ifdef LIBUPNP_EXPORTS
|
||||
// set up declspec for dll export to make functions visible to library users
|
||||
#define EXPORT_SPEC __declspec(dllexport)
|
||||
#else
|
||||
#define EXPORT_SPEC __declspec(dllimport)
|
||||
#endif
|
||||
#else
|
||||
#define EXPORT_SPEC __declspec(dllimport)
|
||||
#define EXPORT_SPEC
|
||||
#endif
|
||||
#else
|
||||
#define EXPORT_SPEC
|
||||
|
@ -415,6 +415,13 @@ UpnpFinish( )
|
||||
|
||||
// remove all virtual dirs
|
||||
UpnpRemoveAllVirtualDirs( );
|
||||
//leuk_he allow static linking:
|
||||
#ifdef WIN32
|
||||
#ifdef PTW32_STATIC_LIB
|
||||
pthread_win32_thread_detach_np ();
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
UpnpSdkInit = 0;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user