Commit a7775815 authored by Sebastian Eichelbaum's avatar Sebastian Eichelbaum

[MERGE]

parents 420ac620 eab16343
......@@ -12,7 +12,10 @@ TARGET_LINK_LIBRARIES( OWcommon ${Boost_LIBRARIES} ${CMAKE_DL_LIBS} )
# Set the prefix and suffix of dynamically loadable modules to match
# CMAKEs naming of them. The quotes are necessary so the shell doesn't mess
# with these defines.
# with these defines. Unfortunately, the Visual Studio has problems handling
# the quotes on the command line. WSharedLib::getSystemPrefix and
# getSystemSuffix hard codes the right strings for VC.
# Maybe you have to spend another 500 bucks to have your VC support quotes.
IF( NOT CMAKE_GENERATOR MATCHES "Visual Studio" )
add_definitions( '-DW_LIB_PREFIX="${CMAKE_SHARED_LIBRARY_PREFIX}"' )
add_definitions( '-DW_LIB_SUFFIX="${CMAKE_SHARED_LIBRARY_SUFFIX}"' )
......
......@@ -269,7 +269,8 @@ void* WSharedLib::findVariable( const std::string& name ) const
}
#ifdef _MSC_VER
// easier this way because VC has problems with quote in command line
// easier this way because VC has problems with quote in command line. So we can not get this information by #define from CMake.
// Maybe you have to spend another 500 bucks to have your VC support nearly trivial stuff.
std::string WSharedLib::getSystemPrefix()
{
return "";
......@@ -279,7 +280,6 @@ std::string WSharedLib::getSystemSuffix()
{
return ".dll";
}
#else
std::string WSharedLib::getSystemPrefix()
{
......
......@@ -32,7 +32,7 @@ WGEShaderAnimationCallback::WGEShaderAnimationCallback( int ticksPerSecond ):
osg::Uniform::Callback(),
m_ticksPerSec( ticksPerSecond )
{
// TODO(ebaum): make this stuff compatible to windows
// TODO(ledig): gettimeofday should be available on windows too in sys/time.h
#ifndef _MSC_VER
timeval tv;
gettimeofday( &tv, 0L );
......@@ -50,7 +50,6 @@ WGEShaderAnimationCallback::~WGEShaderAnimationCallback()
void WGEShaderAnimationCallback::operator() ( osg::Uniform* uniform, osg::NodeVisitor* /*nv*/ )
{
// TODO(ebaum): make this stuff compatible to windows
#ifndef _MSC_VER
timeval tv;
gettimeofday( &tv, 0L );
......@@ -58,6 +57,7 @@ void WGEShaderAnimationCallback::operator() ( osg::Uniform* uniform, osg::NodeVi
int64_t currentUSecs = tv.tv_sec * 1000000 + tv.tv_usec;
int milli = static_cast< int >( ( currentUSecs - m_startUsec ) / ( 1000000 / m_ticksPerSec ) );
#else
// boost::timer measures seconds ... :-(
int milli = static_cast< int >( m_timer.elapsed() * 1000 );
#endif
uniform->set( milli );
......
......@@ -66,8 +66,8 @@ class WModuleOutputConnector;
* \ingroup kernel
*/
class OWKERNEL_EXPORT WModule: public WThreadedRunner,
public WPrototyped,
public boost::enable_shared_from_this< WModule >
public WPrototyped,
public boost::enable_shared_from_this< WModule >
{
friend class WModuleConnector; // requires access to notify members
friend class WModuleFactory; // for proper creation of module instaces, the factory needs access to protected functions.
......@@ -601,10 +601,9 @@ private:
#ifdef _MSC_VER
#define W_LOADABLE_MODULE( MODULECLASS ) \
extern "C" __declspec(dllexport) void WLoadModule( boost::shared_ptr< WModule > &m ) { m = boost::shared_ptr< WModule >( new MODULECLASS ); } // NOLINT
// extern "C" __declspec(dllexport) boost::shared_ptr< WModule > WLoadModule() { return boost::shared_ptr< WModule >( new MODULECLASS ); } // NOLINT
#else
#define W_LOADABLE_MODULE( MODULECLASS ) \
extern "C" boost::shared_ptr< WModule > WLoadModule() { return boost::shared_ptr< WModule >( new MODULECLASS ); } // NOLINT
extern "C" void WLoadModule( boost::shared_ptr< WModule > &m ) { m = boost::shared_ptr< WModule >( new MODULECLASS ); } // NOLINT
#endif
/**
......
......@@ -64,13 +64,11 @@ void WModuleLoader::load( WSharedAssociativeContainer< std::set< boost::shared_p
WSharedLib l( i->path() );
// get instantiation function
// typedef boost::shared_ptr< WModule > ( *createInstanceFunc )( void );
typedef void ( *createInstanceFunc )( boost::shared_ptr< WModule > & );
createInstanceFunc f;
l.fetchFunction< createInstanceFunc >( W_LOADABLE_MODULE_SYMBOL, f );
// get the first prototype
// boost::shared_ptr< WModule > m = f();
boost::shared_ptr< WModule > m;
f( m );
......
......@@ -30,9 +30,7 @@
#include "fiberTransform.xpm"
// This line is needed by the module loader to actually find your module.
//#ifndef _MSC_VER // don't export it on visual studio because it doesn't compile there
W_LOADABLE_MODULE( WMFiberTransform )
//#endif
WMFiberTransform::WMFiberTransform()
: WModule(),
......
......@@ -31,8 +31,6 @@
#include "../../kernel/WModuleInputData.h"
#include "../../kernel/WModuleOutputData.h"
/**
* Transforms a fiber dataset
* \ingroup modules
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment