removing c++14 stuff

v0.27.3
Michał Walenciak 8 years ago
parent 7e0b63142e
commit e64103a31d

@ -1,4 +1,5 @@
#include <cassert>
#include <cstring> #include <cstring>
#include <stdarg.h> #include <stdarg.h>
#include <stdint.h> #include <stdint.h>
@ -103,7 +104,7 @@ bool is8ByteType(uint16_t type)
|| type == tiffIfd8; || type == tiffIfd8;
} }
constexpr bool isBigEndianPlatform() bool isBigEndianPlatform()
{ {
union union
{ {
@ -114,7 +115,7 @@ constexpr bool isBigEndianPlatform()
return e.c[0]?true:false; return e.c[0]?true:false;
} }
constexpr bool isLittleEndianPlatform() { return !isBigEndianPlatform(); } bool isLittleEndianPlatform() { return !isBigEndianPlatform(); }
template<int> template<int>
struct TypeForSize {}; struct TypeForSize {};
@ -140,7 +141,7 @@ struct TypeForSize<64>
template<int size> template<int size>
typename TypeForSize<size>::Type byte_swap(const typename TypeForSize<size>::Type& v) typename TypeForSize<size>::Type byte_swap(const typename TypeForSize<size>::Type& v)
{ {
static_assert(size == 16 || size == 32 || size == 64, "unsupported data size"); assert(size == 16 || size == 32 || size == 64); // supported sizes
typename TypeForSize<size>::Type result = 0; typename TypeForSize<size>::Type result = 0;
if (size == 16) if (size == 16)

Loading…
Cancel
Save