applied Edgar's patch (#20)
parent
22a8a654ad
commit
cff0d96f09
93
SConstruct
93
SConstruct
|
@ -22,6 +22,7 @@ vars.Add('CXXFLAGS', 'C++ flags')
|
|||
vars.Add('CCFLAGS', 'C compiler flags')
|
||||
vars.Add('STRIP', 'Program for stripping away unused symbols')
|
||||
vars.Add('SHCXXFLAGS', 'C++ flags (for shared libraries)')
|
||||
vars.Add('LINK', 'Linker')
|
||||
vars.Add('LINKFLAGS', 'Linker flags')
|
||||
vars.Add('SHLINKFLAGS', 'Linker flags (dynamic libraries)')
|
||||
vars.Add('BASEINCLUDE', 'Base include path')
|
||||
|
@ -71,11 +72,11 @@ env.Append(CPPFLAGS=[])
|
|||
env.Append(LIBPATH=[])
|
||||
env.Append(LIBS=env['BASELIB'])
|
||||
if env.has_key('BOOSTINCLUDE'):
|
||||
env.Append(CPPPATH=env['BOOSTINCLUDE'])
|
||||
env.Prepend(CPPPATH=env['BOOSTINCLUDE'])
|
||||
if env.has_key('BOOSTLIBDIR'):
|
||||
env.Append(LIBPATH=env['BOOSTLIBDIR'])
|
||||
env.Prepend(LIBPATH=env['BOOSTLIBDIR'])
|
||||
if env.has_key('BOOSTLIB'):
|
||||
env.Append(LIBS=env['BOOSTLIB'])
|
||||
env.Prepend(LIBS=env['BOOSTLIB'])
|
||||
if env.has_key('BASELIBDIR'):
|
||||
env.Append(LIBPATH=env['BASELIBDIR'])
|
||||
|
||||
|
@ -117,31 +118,31 @@ cppFlagsPrevious = SCons.Util.semi_deepcopy(env['CPPFLAGS'])
|
|||
cxxFlagsPrevious = SCons.Util.semi_deepcopy(env['CXXFLAGS'])
|
||||
|
||||
if env.has_key('PNGINCLUDE'):
|
||||
env.Append(CPPPATH=env['PNGINCLUDE'])
|
||||
env.Prepend(CPPPATH=env['PNGINCLUDE'])
|
||||
if env.has_key('PNGLIBDIR'):
|
||||
env.Append(LIBPATH=env['PNGLIBDIR'])
|
||||
env.Prepend(LIBPATH=env['PNGLIBDIR'])
|
||||
if env.has_key('JPEGINCLUDE'):
|
||||
env.Append(CPPPATH=env['JPEGINCLUDE'])
|
||||
env.Prepend(CPPPATH=env['JPEGINCLUDE'])
|
||||
if env.has_key('JPEGLIBDIR'):
|
||||
env.Append(LIBPATH=env['JPEGLIBDIR'])
|
||||
env.Prepend(LIBPATH=env['JPEGLIBDIR'])
|
||||
if env.has_key('OEXRFLAGS'):
|
||||
env.Append(CPPFLAGS=env['OEXRFLAGS'])
|
||||
env.Prepend(CPPFLAGS=env['OEXRFLAGS'])
|
||||
if env.has_key('OEXRINCLUDE'):
|
||||
env.Append(CPPPATH=env['OEXRINCLUDE'])
|
||||
env.Prepend(CPPPATH=env['OEXRINCLUDE'])
|
||||
if env.has_key('OEXRLIBDIR'):
|
||||
env.Append(LIBPATH=env['OEXRLIBDIR'])
|
||||
env.Prepend(LIBPATH=env['OEXRLIBDIR'])
|
||||
if env.has_key('XERCESINCLUDE'):
|
||||
env.Append(CPPPATH=env['XERCESINCLUDE'])
|
||||
env.Prepend(CPPPATH=env['XERCESINCLUDE'])
|
||||
if env.has_key('XERCESLIBDIR'):
|
||||
env.Append(LIBPATH=env['XERCESLIBDIR'])
|
||||
env.Prepend(LIBPATH=env['XERCESLIBDIR'])
|
||||
if env.has_key('GLINCLUDE'):
|
||||
env.Append(CPPPATH=env['GLINCLUDE'])
|
||||
env.Prepend(CPPPATH=env['GLINCLUDE'])
|
||||
if env.has_key('GLFLAGS'):
|
||||
env.Append(CPPFLAGS=env['GLFLAGS'])
|
||||
env.Prepend(CPPFLAGS=env['GLFLAGS'])
|
||||
if env.has_key('COLLADAINCLUDE'):
|
||||
env.Append(CPPPATH=env['COLLADAINCLUDE'])
|
||||
env.Prepend(CPPPATH=env['COLLADAINCLUDE'])
|
||||
if env.has_key('COLLADALIBDIR'):
|
||||
env.Append(LIBPATH=env['COLLADALIBDIR'])
|
||||
env.Prepend(LIBPATH=env['COLLADALIBDIR'])
|
||||
|
||||
if not conf.CheckCXX():
|
||||
print 'Could not compile a simple C++ fragment, verify that ' + env['CXX'] + ' is installed!'
|
||||
|
@ -245,27 +246,27 @@ except:
|
|||
# Core library
|
||||
coreEnv = env.Clone()
|
||||
if coreEnv.has_key('OEXRLIBDIR'):
|
||||
coreEnv.Append(LIBPATH=env['OEXRLIBDIR'])
|
||||
coreEnv.Prepend(LIBPATH=env['OEXRLIBDIR'])
|
||||
if coreEnv.has_key('OEXRINCLUDE'):
|
||||
coreEnv.Append(CPPPATH=env['OEXRINCLUDE'])
|
||||
coreEnv.Prepend(CPPPATH=env['OEXRINCLUDE'])
|
||||
if coreEnv.has_key('OEXRFLAGS'):
|
||||
coreEnv.Append(CPPFLAGS=env['OEXRFLAGS'])
|
||||
coreEnv.Prepend(CPPFLAGS=env['OEXRFLAGS'])
|
||||
if coreEnv.has_key('OEXRLIB'):
|
||||
coreEnv.Append(LIBS=env['OEXRLIB'])
|
||||
coreEnv.Prepend(LIBS=env['OEXRLIB'])
|
||||
if coreEnv.has_key('PNGLIBDIR'):
|
||||
coreEnv.Append(LIBPATH=env['PNGLIBDIR'])
|
||||
coreEnv.Prepend(LIBPATH=env['PNGLIBDIR'])
|
||||
if coreEnv.has_key('PNGINCLUDE'):
|
||||
coreEnv.Append(CPPPATH=env['PNGINCLUDE'])
|
||||
coreEnv.Prepend(CPPPATH=env['PNGINCLUDE'])
|
||||
if coreEnv.has_key('PNGLIB'):
|
||||
coreEnv.Append(LIBS=env['PNGLIB'])
|
||||
coreEnv.Prepend(LIBS=env['PNGLIB'])
|
||||
if coreEnv.has_key('JPEGLIBDIR'):
|
||||
coreEnv.Append(LIBPATH=env['JPEGLIBDIR'])
|
||||
coreEnv.Prepend(LIBPATH=env['JPEGLIBDIR'])
|
||||
if coreEnv.has_key('JPEGINCLUDE'):
|
||||
coreEnv.Append(CPPPATH=env['JPEGINCLUDE'])
|
||||
coreEnv.Prepend(CPPPATH=env['JPEGINCLUDE'])
|
||||
if coreEnv.has_key('JPEGLIB'):
|
||||
coreEnv.Append(LIBS=env['JPEGLIB'])
|
||||
coreEnv.Prepend(LIBS=env['JPEGLIB'])
|
||||
|
||||
coreEnv.Append(CPPDEFINES = [['MTS_BUILD_MODULE', 'MTS_MODULE_CORE']])
|
||||
coreEnv.Prepend(CPPDEFINES = [['MTS_BUILD_MODULE', 'MTS_MODULE_CORE']])
|
||||
libcore_objects = [
|
||||
'src/libcore/class.cpp', 'src/libcore/object.cpp',
|
||||
'src/libcore/statistics.cpp', 'src/libcore/thread.cpp',
|
||||
|
@ -308,11 +309,11 @@ env.Append(LIBPATH=['src/libcore'])
|
|||
renderEnv = env.Clone()
|
||||
renderEnv.Append(CPPDEFINES = [['MTS_BUILD_MODULE', 'MTS_MODULE_RENDER']] )
|
||||
if renderEnv.has_key('XERCESINCLUDE'):
|
||||
renderEnv.Append(CPPPATH=renderEnv['XERCESINCLUDE'])
|
||||
renderEnv.Prepend(CPPPATH=renderEnv['XERCESINCLUDE'])
|
||||
if renderEnv.has_key('XERCESLIBDIR'):
|
||||
renderEnv.Append(LIBPATH=renderEnv['XERCESLIBDIR'])
|
||||
renderEnv.Prepend(LIBPATH=renderEnv['XERCESLIBDIR'])
|
||||
if renderEnv.has_key('XERCESLIB'):
|
||||
renderEnv.Append(LIBS=renderEnv['XERCESLIB'])
|
||||
renderEnv.Prepend(LIBS=renderEnv['XERCESLIB'])
|
||||
librender = renderEnv.SharedLibrary('src/librender/mitsuba-render', [
|
||||
'src/librender/bsdf.cpp', 'src/librender/camera.cpp',
|
||||
'src/librender/film.cpp', 'src/librender/integrator.cpp',
|
||||
|
@ -362,13 +363,13 @@ elif sys.platform == 'linux2':
|
|||
glEnv = env.Clone()
|
||||
glEnv.Append(CPPDEFINES = [['MTS_BUILD_MODULE', 'MTS_MODULE_HW']] )
|
||||
if glEnv.has_key('GLLIB'):
|
||||
glEnv.Append(LIBS=glEnv['GLLIB'])
|
||||
glEnv.Prepend(LIBS=glEnv['GLLIB'])
|
||||
if glEnv.has_key('GLLIBDIR'):
|
||||
glEnv.Append(LIBPATH=glEnv['GLLIBDIR'])
|
||||
glEnv.Prepend(LIBPATH=glEnv['GLLIBDIR'])
|
||||
if glEnv.has_key('GLFLAGS'):
|
||||
glEnv.Append(CPPFLAGS=glEnv['GLFLAGS'])
|
||||
glEnv.Prepend(CPPFLAGS=glEnv['GLFLAGS'])
|
||||
if glEnv.has_key('GLINCLUDE'):
|
||||
glEnv.Append(CPPPATH=glEnv['GLINCLUDE'])
|
||||
glEnv.Prepend(CPPPATH=glEnv['GLINCLUDE'])
|
||||
|
||||
if sys.platform == 'darwin':
|
||||
glEnv_osx = glEnv.Clone();
|
||||
|
@ -391,19 +392,19 @@ env['SHLIBPREFIX']=''
|
|||
# Environment with Xerces + wxWidgets
|
||||
mainEnv = env.Clone()
|
||||
if mainEnv.has_key('XERCESINCLUDE'):
|
||||
mainEnv.Append(CPPPATH=mainEnv['XERCESINCLUDE'])
|
||||
mainEnv.Prepend(CPPPATH=mainEnv['XERCESINCLUDE'])
|
||||
if mainEnv.has_key('XERCESLIBDIR'):
|
||||
mainEnv.Append(LIBPATH=mainEnv['XERCESLIBDIR'])
|
||||
mainEnv.Prepend(LIBPATH=mainEnv['XERCESLIBDIR'])
|
||||
if mainEnv.has_key('XERCESLIB'):
|
||||
mainEnv.Append(LIBS=mainEnv['XERCESLIB'])
|
||||
mainEnv.Prepend(LIBS=mainEnv['XERCESLIB'])
|
||||
if mainEnv.has_key('GLLIB'):
|
||||
mainEnv.Append(LIBS=mainEnv['GLLIB'])
|
||||
mainEnv.Prepend(LIBS=mainEnv['GLLIB'])
|
||||
if mainEnv.has_key('GLLIBDIR'):
|
||||
mainEnv.Append(LIBPATH=mainEnv['GLLIBDIR'])
|
||||
mainEnv.Prepend(LIBPATH=mainEnv['GLLIBDIR'])
|
||||
if mainEnv.has_key('GLFLAGS'):
|
||||
mainEnv.Append(CXXFLAGS=mainEnv['GLFLAGS'])
|
||||
mainEnv.Prepend(CXXFLAGS=mainEnv['GLFLAGS'])
|
||||
if mainEnv.has_key('GLINCLUDE'):
|
||||
mainEnv.Append(CPPPATH=mainEnv['GLINCLUDE'])
|
||||
mainEnv.Prepend(CPPPATH=mainEnv['GLINCLUDE'])
|
||||
|
||||
resources = []
|
||||
darwinStub = []
|
||||
|
@ -436,11 +437,11 @@ if hasCollada:
|
|||
colladaEnv.Append(LIBS=['mitsuba-hw'])
|
||||
colladaEnv.Append(LIBPATH=['src/libhw'])
|
||||
if env.has_key('COLLADAINCLUDE'):
|
||||
colladaEnv.Append(CPPPATH=env['COLLADAINCLUDE'])
|
||||
colladaEnv.Prepend(CPPPATH=env['COLLADAINCLUDE'])
|
||||
if env.has_key('COLLADALIBDIR'):
|
||||
colladaEnv.Append(LIBPATH=env['COLLADALIBDIR'])
|
||||
colladaEnv.Prepend(LIBPATH=env['COLLADALIBDIR'])
|
||||
if env.has_key('COLLADALIB'):
|
||||
colladaEnv.Append(LIBS=env['COLLADALIB'])
|
||||
colladaEnv.Prepend(LIBS=env['COLLADALIB'])
|
||||
converter_objects = [
|
||||
colladaEnv.StaticObject('src/converter/collada.cpp'),
|
||||
colladaEnv.StaticObject('src/converter/obj.cpp'),
|
||||
|
@ -473,9 +474,9 @@ if hasQt:
|
|||
if hasCollada:
|
||||
qtgui_files += converter_objects
|
||||
if env.has_key('COLLADALIBDIR'):
|
||||
qtEnv.Append(LIBPATH=env['COLLADALIBDIR'])
|
||||
qtEnv.Prepend(LIBPATH=env['COLLADALIBDIR'])
|
||||
if env.has_key('COLLADALIB'):
|
||||
qtEnv.Append(LIBS=env['COLLADALIB'])
|
||||
qtEnv.Prepend(LIBS=env['COLLADALIB'])
|
||||
|
||||
if sys.platform == 'darwin':
|
||||
qtEnv_osx = qtEnv.Clone();
|
||||
|
|
|
@ -32,7 +32,19 @@ template <typename T> inline bool atomicCompareAndExchangePtr(T **v, T *newValue
|
|||
return InterlockedCompareExchangePointer(
|
||||
reinterpret_cast<volatile PVOID *>(v), newValue, oldValue) == oldValue;
|
||||
#else
|
||||
#if !defined(__clang__)
|
||||
return __sync_bool_compare_and_swap(v, oldValue, newValue);
|
||||
#else
|
||||
#if __SIZEOF_POINTER__ == 8
|
||||
return __sync_bool_compare_and_swap(
|
||||
reinterpret_cast<long long volatile *>(v), reinterpret_cast<long long>(oldValue),
|
||||
reinterpret_cast<long long>(newValue));
|
||||
#else
|
||||
return __sync_bool_compare_and_swap(
|
||||
reinterpret_cast<long volatile *>(v), reinterpret_cast<long>(oldValue),
|
||||
reinterpret_cast<long>(newValue));
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
|
@ -19,6 +19,8 @@
|
|||
#if !defined(__REFERENCE_H)
|
||||
#define __REFERENCE_H
|
||||
|
||||
#include "util.h"
|
||||
|
||||
MTS_NAMESPACE_BEGIN
|
||||
|
||||
/**
|
||||
|
|
|
@ -161,17 +161,26 @@ MTS_NAMESPACE_END
|
|||
#if defined(WIN32)
|
||||
inline bool ubi_isnan(float f) {
|
||||
int classification = ::_fpclass(f);
|
||||
return classification == _FPCLASS_QNAN || classification == _FPCLASS_SNAN;
|
||||
return classification == _FPCLASS_QNAN
|
||||
|| classification == _FPCLASS_SNAN;
|
||||
}
|
||||
|
||||
inline bool ubi_isnan(double f) {
|
||||
int classification = ::_fpclass(f);
|
||||
return classification == _FPCLASS_QNAN || classification == _FPCLASS_SNAN;
|
||||
return classification == _FPCLASS_QNAN
|
||||
|| classification == _FPCLASS_SNAN;
|
||||
}
|
||||
extern "C" {
|
||||
extern MTS_EXPORT_CORE float nextafterf(float x, float y);
|
||||
};
|
||||
#elif defined(__clang__)
|
||||
inline bool ubi_isnan(float f) {
|
||||
return std::isnan(f);
|
||||
}
|
||||
|
||||
inline bool ubi_isnan(double f) {
|
||||
return std::isnan(f);
|
||||
}
|
||||
#else
|
||||
inline bool ubi_isnan(float f) {
|
||||
return std::fpclassify(f) == FP_NAN;
|
||||
|
|
|
@ -16,17 +16,17 @@ inline BSDFQueryRecord::BSDFQueryRecord(const Intersection &its, Point2 sample)
|
|||
|
||||
inline BSDFQueryRecord::BSDFQueryRecord(RadianceQueryRecord &rRec,
|
||||
const Intersection &its, const Vector &wo)
|
||||
: rRec(&rRec), its(its), wi(its.wi), wo(wo), sample(sample), quantity(ERadiance),
|
||||
: rRec(&rRec), its(its), wi(its.wi), wo(wo), quantity(ERadiance),
|
||||
typeMask(0xFFFFFFFF), sampledType(0), component(-1), sampledComponent(-1) {
|
||||
}
|
||||
|
||||
inline BSDFQueryRecord::BSDFQueryRecord(const Intersection &its, const Vector &wo)
|
||||
: rRec(NULL), its(its), wi(its.wi), wo(wo), sample(sample), quantity(ERadiance),
|
||||
: rRec(NULL), its(its), wi(its.wi), wo(wo), quantity(ERadiance),
|
||||
typeMask(0xFFFFFFFF), sampledType(0), component(-1), sampledComponent(-1) {
|
||||
}
|
||||
|
||||
inline BSDFQueryRecord::BSDFQueryRecord(const Intersection &its, const Vector &wi, const Vector &wo)
|
||||
: rRec(NULL), its(its), wi(wi), wo(wo), sample(sample), quantity(ERadiance),
|
||||
: rRec(NULL), its(its), wi(wi), wo(wo), quantity(ERadiance),
|
||||
typeMask(0xFFFFFFFF), sampledType(0), component(-1), sampledComponent(-1) {
|
||||
}
|
||||
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
#include <mitsuba/core/plugin.h>
|
||||
#include <mitsuba/render/gatherproc.h>
|
||||
#include <mitsuba/render/renderqueue.h>
|
||||
#if !defined(__OSX__)
|
||||
#if !defined(__OSX__) && defined(_OPENMP)
|
||||
#include <omp.h>
|
||||
#endif
|
||||
|
||||
|
@ -124,7 +124,7 @@ public:
|
|||
Vector2i cropSize = film->getCropSize();
|
||||
Point2i cropOffset = film->getCropOffset();
|
||||
|
||||
#if !defined(__OSX__)
|
||||
#if !defined(__OSX__) && defined(_OPENMP)
|
||||
omp_set_num_threads(nCores);
|
||||
#endif
|
||||
m_gatherPoints.clear();
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
#include <mitsuba/core/bitmap.h>
|
||||
#include <mitsuba/render/gatherproc.h>
|
||||
#include <mitsuba/render/renderqueue.h>
|
||||
#if !defined(__OSX__)
|
||||
#if !defined(__OSX__) && defined(_OPENMP)
|
||||
#include <omp.h>
|
||||
#endif
|
||||
|
||||
|
@ -150,7 +150,7 @@ public:
|
|||
int samplerResID = sched->registerManifoldResource(
|
||||
static_cast<std::vector<SerializableObject*> &>(samplers));
|
||||
|
||||
#if !defined(__OSX__)
|
||||
#if !defined(__OSX__) && defined(_OPENMP)
|
||||
omp_set_num_threads(nCores);
|
||||
#endif
|
||||
|
||||
|
@ -178,7 +178,7 @@ public:
|
|||
#pragma omp parallel for schedule(dynamic)
|
||||
for (int i=-1; i<(int) m_gatherBlocks.size(); ++i) {
|
||||
std::vector<GatherPoint> &gatherPoints = m_gatherBlocks[i];
|
||||
#if !defined(__OSX__)
|
||||
#if !defined(__OSX__) && defined(_OPENMP)
|
||||
Sampler *sampler = static_cast<Sampler *>(samplers[omp_get_thread_num()]);
|
||||
#else
|
||||
Sampler *sampler = static_cast<Sampler *>(samplers[0]);
|
||||
|
|
|
@ -289,7 +289,7 @@ void WGLDevice::init(Device *other) {
|
|||
|
||||
if (!m_hwnd)
|
||||
Log(EError, "Unable to create the window");
|
||||
SetWindowLong(m_hwnd, 0, (LONG) this);
|
||||
SetWindowLongPtr(m_hwnd, 0, (LONG_PTR) this);
|
||||
ShowWindow(m_hwnd, SW_HIDE);
|
||||
|
||||
/* Switch to fullscreen */
|
||||
|
|
|
@ -22,11 +22,35 @@
|
|||
#include <mitsuba/core/fstream.h>
|
||||
#include <mitsuba/core/timer.h>
|
||||
#include <ply/ply_parser.hpp>
|
||||
#if defined(WIN32)
|
||||
|
||||
#if defined(__clang__)
|
||||
#define MTS_USE_BOOST_TR1 (!__has_feature(cxx_variadic_templates))
|
||||
#else
|
||||
# if defined(_MSC_VER) && (_MSC_VER < 1600)
|
||||
# define MTS_USE_BOOST_TR1 1
|
||||
# else
|
||||
# define MTS_USE_BOOST_TR1 0
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if MTS_USE_BOOST_TR1
|
||||
# if defined(Float)
|
||||
# define MTS_Float
|
||||
# pragma push_macro("Float")
|
||||
# undef Float
|
||||
# endif
|
||||
#include <boost/tr1/functional.hpp>
|
||||
# if defined(MTS_Float)
|
||||
# pragma pop_macro("Float")
|
||||
# undef MTS_Float
|
||||
# endif
|
||||
#else
|
||||
#if defined(_MSC_VER) && (_MSC_VER >= 1600)
|
||||
#include <functional>
|
||||
#else
|
||||
#include <tr1/functional>
|
||||
#endif
|
||||
#endif
|
||||
|
||||
using namespace std::tr1::placeholders;
|
||||
|
||||
|
|
|
@ -9,14 +9,39 @@
|
|||
#include <vector>
|
||||
#include <cctype>
|
||||
|
||||
#if defined(WIN32)
|
||||
#if defined(__clang__)
|
||||
#define MTS_USE_BOOST_TR1 (!__has_feature(cxx_variadic_templates))
|
||||
#else
|
||||
# if defined(_MSC_VER) && (_MSC_VER < 1600)
|
||||
# define MTS_USE_BOOST_TR1 1
|
||||
# else
|
||||
# define MTS_USE_BOOST_TR1 0
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if MTS_USE_BOOST_TR1
|
||||
# if defined(Float)
|
||||
# define MTS_Float
|
||||
# pragma push_macro("Float")
|
||||
# undef Float
|
||||
# endif
|
||||
#include <boost/tr1/functional.hpp>
|
||||
#include <boost/tr1/memory.hpp>
|
||||
#include <boost/tr1/tuple.hpp>
|
||||
# if defined(MTS_Float)
|
||||
# pragma pop_macro("Float")
|
||||
# undef MTS_Float
|
||||
# endif
|
||||
#else
|
||||
#if defined(_MSC_VER) && (_MSC_VER >= 1600)
|
||||
#include <functional>
|
||||
#include <memory>
|
||||
#include <tuple>
|
||||
#else
|
||||
#include <tr1/functional>
|
||||
#include <tr1/memory>
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include <boost/mpl/fold.hpp>
|
||||
#include <boost/mpl/inherit.hpp>
|
||||
|
@ -93,6 +118,7 @@ public:
|
|||
{
|
||||
return static_cast<callbacks_element<ScalarType>&>(callbacks_).callback;
|
||||
}
|
||||
#if !defined(__clang__)
|
||||
template <typename ScalarType>
|
||||
friend typename scalar_property_definition_callback_type<ScalarType>::type& at(scalar_property_definition_callbacks_type& scalar_property_definition_callbacks)
|
||||
{
|
||||
|
@ -103,6 +129,7 @@ public:
|
|||
{
|
||||
return scalar_property_definition_callbacks.get<ScalarType>();
|
||||
}
|
||||
#endif
|
||||
};
|
||||
|
||||
template <typename SizeType, typename ScalarType>
|
||||
|
@ -183,6 +210,7 @@ public:
|
|||
{
|
||||
return static_cast<const callbacks_element<boost::mpl::pair<SizeType, ScalarType> >&>(callbacks_).callback;
|
||||
}
|
||||
#if !defined(__clang__)
|
||||
template <typename SizeType, typename ScalarType>
|
||||
friend typename list_property_definition_callback_type<SizeType, ScalarType>::type& at(list_property_definition_callbacks_type& list_property_definition_callbacks)
|
||||
{
|
||||
|
@ -193,6 +221,7 @@ public:
|
|||
{
|
||||
return list_property_definition_callbacks.get<SizeType, ScalarType>();
|
||||
}
|
||||
#endif
|
||||
};
|
||||
|
||||
void info_callback(const info_callback_type& info_callback);
|
||||
|
@ -374,7 +403,10 @@ inline void ply::ply_parser::parse_list_property_definition(const std::string& p
|
|||
{
|
||||
typedef SizeType size_type;
|
||||
typedef ScalarType scalar_type;
|
||||
typename list_property_definition_callback_type<size_type, scalar_type>::type& list_property_definition_callback = list_property_definition_callbacks_.get<size_type, scalar_type>();
|
||||
#if !defined(__INTEL_COMPILER)
|
||||
typename
|
||||
#endif
|
||||
list_property_definition_callback_type<size_type, scalar_type>::type& list_property_definition_callback = list_property_definition_callbacks_.get<size_type, scalar_type>();
|
||||
typedef typename list_property_begin_callback_type<size_type, scalar_type>::type list_property_begin_callback_type;
|
||||
typedef typename list_property_element_callback_type<size_type, scalar_type>::type list_property_element_callback_type;
|
||||
typedef typename list_property_end_callback_type<size_type, scalar_type>::type list_property_end_callback_type;
|
||||
|
@ -517,4 +549,39 @@ inline bool ply::ply_parser::parse_list_property(format_type format, std::istrea
|
|||
}
|
||||
}
|
||||
|
||||
#if defined(__clang__)
|
||||
// Horrible workaround for ADT failure as of Clang 2.8
|
||||
namespace ply
|
||||
{
|
||||
|
||||
template <typename ScalarType>
|
||||
typename ply_parser::scalar_property_definition_callback_type<ScalarType>::type& at
|
||||
(ply_parser::scalar_property_definition_callbacks_type& scalar_property_definition_callbacks)
|
||||
{
|
||||
return scalar_property_definition_callbacks.get<ScalarType>();
|
||||
}
|
||||
template <typename ScalarType>
|
||||
const typename ply_parser::scalar_property_definition_callback_type<ScalarType>::type& at
|
||||
(const ply_parser::scalar_property_definition_callbacks_type& scalar_property_definition_callbacks)
|
||||
{
|
||||
return scalar_property_definition_callbacks.get<ScalarType>();
|
||||
}
|
||||
|
||||
|
||||
template <typename SizeType, typename ScalarType>
|
||||
typename ply_parser::list_property_definition_callback_type<SizeType, ScalarType>::type& at
|
||||
(ply_parser::list_property_definition_callbacks_type& list_property_definition_callbacks)
|
||||
{
|
||||
return list_property_definition_callbacks.get<SizeType, ScalarType>();
|
||||
}
|
||||
template <typename SizeType, typename ScalarType>
|
||||
const typename ply_parser::list_property_definition_callback_type<SizeType, ScalarType>::type& at
|
||||
(const ply_parser::list_property_definition_callbacks_type& list_property_definition_callbacks)
|
||||
{
|
||||
return list_property_definition_callbacks.get<SizeType, ScalarType>();
|
||||
}
|
||||
|
||||
} // namespace ply
|
||||
#endif
|
||||
|
||||
#endif // PLY_PLY_PARSER_HPP_INCLUDED
|
||||
|
|
Loading…
Reference in New Issue