First step to xcode 4.3 compatibility
git-svn-id: http://www.openmesh.org/svnrepo/OpenMesh/trunk@551 fdac6126-5c0c-442c-9429-916003d36597
This commit is contained in:
@@ -384,17 +384,6 @@ namespace OMFormat {
|
|||||||
// calc minimum (power-of-2) number of bits needed
|
// calc minimum (power-of-2) number of bits needed
|
||||||
Chunk::Integer_Size needed_bits( size_t s );
|
Chunk::Integer_Size needed_bits( size_t s );
|
||||||
|
|
||||||
|
|
||||||
// Return the storage type (Chunk::Header::bits_)
|
|
||||||
template <typename T>
|
|
||||||
inline
|
|
||||||
unsigned int bits(const T& val)
|
|
||||||
{
|
|
||||||
return is_integer(val)
|
|
||||||
? (static_cast<unsigned int>(integer_size(val)))
|
|
||||||
: (static_cast<unsigned int>(float_size(val)));
|
|
||||||
}
|
|
||||||
|
|
||||||
// Convert size of type to Integer_Size
|
// Convert size of type to Integer_Size
|
||||||
#ifdef NDEBUG
|
#ifdef NDEBUG
|
||||||
template <typename T> Chunk::Integer_Size integer_size(const T&)
|
template <typename T> Chunk::Integer_Size integer_size(const T&)
|
||||||
@@ -433,6 +422,16 @@ namespace OMFormat {
|
|||||||
return Chunk::Float_Size(0);
|
return Chunk::Float_Size(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Return the storage type (Chunk::Header::bits_)
|
||||||
|
template <typename T>
|
||||||
|
inline
|
||||||
|
unsigned int bits(const T& val)
|
||||||
|
{
|
||||||
|
return is_integer(val)
|
||||||
|
? (static_cast<unsigned int>(integer_size(val)))
|
||||||
|
: (static_cast<unsigned int>(float_size(val)));
|
||||||
|
}
|
||||||
|
|
||||||
// -------------------- create/read version
|
// -------------------- create/read version
|
||||||
|
|
||||||
inline uint8 mk_version(const uint16 major, const uint16 minor)
|
inline uint8 mk_version(const uint16 major, const uint16 minor)
|
||||||
|
|||||||
@@ -87,12 +87,7 @@ namespace IO {
|
|||||||
function body which will result in a linker error */
|
function body which will result in a linker error */
|
||||||
|
|
||||||
template < size_t N > inline
|
template < size_t N > inline
|
||||||
void _reverse_byte_order_N(uint8_t* _val)
|
void _reverse_byte_order_N(uint8_t* _val);
|
||||||
{
|
|
||||||
assert_compile(false);
|
|
||||||
// compile_time_error__only_for_fundamental_types(_val);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
template <> inline
|
template <> inline
|
||||||
void _reverse_byte_order_N<1>(uint8_t* /*_val*/) { }
|
void _reverse_byte_order_N<1>(uint8_t* /*_val*/) { }
|
||||||
@@ -150,15 +145,11 @@ void _reverse_byte_order_N<16>(uint8_t* _val)
|
|||||||
// reverting pointers makes no sense, hence forbid it.
|
// reverting pointers makes no sense, hence forbid it.
|
||||||
/** this does not compile for g++3.4 and higher, hence we comment the
|
/** this does not compile for g++3.4 and higher, hence we comment the
|
||||||
function body which will result in a linker error */
|
function body which will result in a linker error */
|
||||||
template <typename T> inline T* reverse_byte_order(T* t)
|
template <typename T> inline T* reverse_byte_order(T* t);
|
||||||
{
|
|
||||||
// Should never reach this point. If so, then some operator were not
|
// Should never reach this point. If so, then some operator were not
|
||||||
// overloaded. Especially check for IO::binary<> specialization on
|
// overloaded. Especially check for IO::binary<> specialization on
|
||||||
// custom data types.
|
// custom data types.
|
||||||
// compile_time_error__cannot_do_that(a);
|
|
||||||
assert_compile(false);
|
|
||||||
return t;
|
|
||||||
}
|
|
||||||
|
|
||||||
inline void compile_time_error__no_fundamental_type()
|
inline void compile_time_error__no_fundamental_type()
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user