From Mathias Froechlich, "Attached the collected fixes I needed to compile with all of them.

Most notable the __hpux define stuff. The __hpux__ variant seems to be not
defined which resulted in a compile error at this time. Consequently I have
replaced all occurances of __hpux__ with __hpux. And huge surprise: now osg
plugins are found and loaded correctly ...
The next notable one is the MSVC_IDE fix which makes the nmake Makefiles cmake
generator target behave like the ide one. Showed up because I started to do
scripted builds with nmake instead of devenv...
The rest is the usual bunch of stuff that just happens during normal
coding ..."
This commit is contained in:
Robert Osfield
2009-11-18 12:15:29 +00:00
parent 259daac9a9
commit b7cabac990
13 changed files with 29 additions and 32 deletions

View File

@@ -27,7 +27,7 @@
#include <mach-o/dyld.h>
#else // all other unix
#include <unistd.h>
#ifdef __hpux__
#ifdef __hpux
// Although HP-UX has dlopen() it is broken! We therefore need to stick
// to shl_load()/shl_unload()/shl_findsym()
#include <dl.h>
@@ -63,7 +63,7 @@ DynamicLibrary::~DynamicLibrary()
FreeLibrary((HMODULE)_handle);
#elif defined(__APPLE__) && defined(APPLE_PRE_10_3)
NSUnLinkModule(static_cast<NSModule>(_handle), FALSE);
#elif defined(__hpux__)
#elif defined(__hpux)
// fortunately, shl_t is a pointer
shl_unload (static_cast<shl_t>(_handle));
#else // other unix
@@ -103,7 +103,7 @@ DynamicLibrary::HANDLE DynamicLibrary::getLibraryHandle( const std::string& libr
handle = NSLinkModule(image, libraryName.c_str(), TRUE);
NSDestroyObjectFileImage(image);
}
#elif defined(__hpux__)
#elif defined(__hpux)
// BIND_FIRST is neccessary for some reason
handle = shl_load ( libraryName.c_str(), BIND_DEFERRED|BIND_FIRST|BIND_VERBOSE, 0);
return handle;
@@ -146,7 +146,7 @@ DynamicLibrary::PROC_ADDRESS DynamicLibrary::getProcAddress(const std::string& p
temp += procName; // Mac OS X prepends an underscore on function names
symbol = NSLookupSymbolInModule(static_cast<NSModule>(_handle), temp.c_str());
return NSAddressOfSymbol(symbol);
#elif defined(__hpux__)
#elif defined(__hpux)
void* result = NULL;
if (shl_findsym (reinterpret_cast<shl_t*>(&_handle), procName.c_str(), TYPE_PROCEDURE, result) == 0)
{

View File

@@ -718,14 +718,11 @@ std::string Registry::createLibraryNameForExtension(const std::string& ext)
#else
return prepend+"osgdb_"+lowercase_ext;
#endif
#elif defined(__hpux__)
// why don't we use PLUGIN_EXT from the makefiles here?
return prepend+"osgdb_"+lowercase_ext+".sl";
#else
#ifdef _DEBUG
return prepend+"osgdb_"+lowercase_ext+ OSG_DEBUG_POSTFIX_WITH_QUOTES + ".so";
return prepend+"osgdb_"+lowercase_ext+ OSG_DEBUG_POSTFIX_WITH_QUOTES + ADDQUOTES(OSG_PLUGIN_EXTENSION);
#else
return prepend+"osgdb_"+lowercase_ext+".so";
return prepend+"osgdb_"+lowercase_ext+ADDQUOTES(OSG_PLUGIN_EXTENSION);
#endif
#endif
@@ -749,14 +746,11 @@ std::string Registry::createLibraryNameForNodeKit(const std::string& name)
#else
return name;
#endif
#elif defined(__hpux__)
// why don't we use PLUGIN_EXT from the makefiles here?
return "lib"+name+".sl";
#else
#ifdef _DEBUG
return "lib"+name+OSG_DEBUG_POSTFIX_WITH_QUOTES +".so";
return "lib"+name+OSG_DEBUG_POSTFIX_WITH_QUOTES + ADDQUOTES(OSG_PLUGIN_EXTENSION);
#else
return "lib"+name+".so";
return "lib"+name+ADDQUOTES(OSG_PLUGIN_EXTENSION);
#endif
#endif
}

View File

@@ -78,7 +78,7 @@ public:
int findColor(unsigned int rgb)
{
int aci = 255;
itr = _indexColors.find(rgb);
ColorMap::const_iterator itr = _indexColors.find(rgb);
if (itr != _indexColors.end() ) {
aci = itr->second;
} else {
@@ -156,11 +156,9 @@ protected:
protected:
std::map<const unsigned int, unsigned char> _indexColors; // maps RGB to autocad index colour
std::map<const unsigned int, unsigned char> _hueColors; // maps hue angle to autocad index colour
typedef std::pair <const unsigned int, unsigned char> ColorPair;
std::map<const unsigned int, unsigned char>::iterator itr;
typedef std::map<unsigned int, unsigned char> ColorMap;
ColorMap _indexColors; // maps RGB to autocad index colour
ColorMap _hueColors; // maps hue angle to autocad index colour
};
class DXFWriterNodeVisitor: public osg::NodeVisitor {

View File

@@ -204,7 +204,7 @@ void LightPointNode::traverse(osg::NodeVisitor& nv)
// as this will be our special light point drawable.
osgUtil::StateGraph::LeafList::iterator litr;
for(litr = rg->_leaves.begin();
litr != rg->_leaves.end() && (*litr)->_drawable!=drawable;
litr != rg->_leaves.end() && (*litr)->_drawable.get()!=drawable;
++litr)
{}

View File

@@ -104,7 +104,7 @@ osg::StateSet *ShaderGenCache::getOrCreateStateSet(unsigned int stateMask)
if (it == _stateSetMap.end())
{
osg::StateSet *stateSet = createStateSet(stateMask);
_stateSetMap.insert(it, std::make_pair(stateMask, stateSet));
_stateSetMap.insert(it, StateSetMap::value_type(stateMask, stateSet));
return stateSet;
}
return it->second.get();