diff --git a/src/Magnum/Magnum.h b/src/Magnum/Magnum.h index 4e1dde2b7..3da95c146 100644 --- a/src/Magnum/Magnum.h +++ b/src/Magnum/Magnum.h @@ -167,11 +167,21 @@ typedef std::uint32_t UnsignedInt; /** @brief Signed int (32bit) */ typedef std::int32_t Int; -/** @brief Unsigned long (64bit) */ +#ifndef MAGNUM_TARGET_WEBGL +/** +@brief Unsigned long (64bit) + +@attention 64-bit integers are not available in @ref MAGNUM_TARGET_WEBGL "WebGL". +*/ typedef std::uint64_t UnsignedLong; -/** @brief Signed long (64bit) */ +/** +@brief Signed long (64bit) + +@attention 64-bit integers are not available in @ref MAGNUM_TARGET_WEBGL "WebGL". +*/ typedef std::int64_t Long; +#endif /** @brief Float (32bit) */ typedef float Float; diff --git a/src/Magnum/Math/TypeTraits.h b/src/Magnum/Math/TypeTraits.h index e8f515b88..6d2a4c0c0 100644 --- a/src/Magnum/Math/TypeTraits.h +++ b/src/Magnum/Math/TypeTraits.h @@ -144,6 +144,7 @@ template<> struct TypeTraits: Implementation::TypeTraitsIntegral { typedef Double FloatingPointType; #endif }; +#ifndef MAGNUM_TARGET_WEBGL template<> struct TypeTraits: Implementation::TypeTraitsIntegral { #ifndef MAGNUM_TARGET_GLES typedef long double FloatingPointType; @@ -154,6 +155,7 @@ template<> struct TypeTraits: Implementation::TypeTraitsIntegral { typedef long double FloatingPointType; #endif }; +#endif /* Floating-point scalar types */ namespace Implementation { diff --git a/src/Magnum/Query.cpp b/src/Magnum/Query.cpp index 649994cf8..d6bee60f2 100644 --- a/src/Magnum/Query.cpp +++ b/src/Magnum/Query.cpp @@ -123,6 +123,7 @@ template<> Int AbstractQuery::result() { return result; } +#ifndef MAGNUM_TARGET_WEBGL template<> UnsignedLong AbstractQuery::result() { CORRADE_ASSERT(!target, "AbstractQuery::result(): the query is currently running", {}); @@ -151,6 +152,7 @@ template<> Long AbstractQuery::result() { return result; } #endif +#endif void AbstractQuery::begin(GLenum target) { CORRADE_ASSERT(!this->target, "AbstractQuery::begin(): the query is already running", ); diff --git a/src/Magnum/Query.h b/src/Magnum/Query.h index db978053f..726d508ea 100644 --- a/src/Magnum/Query.h +++ b/src/Magnum/Query.h @@ -107,6 +107,8 @@ class MAGNUM_EXPORT AbstractQuery: public AbstractObject { * @requires_es_extension %Extension @es_extension{EXT,disjoint_timer_query} * for result types @ref Magnum::Int "Int", @ref Magnum::UnsignedLong "UnsignedLong" * @ref Magnum::Long "Long". + * @attention @ref Magnum::UnsignedLong "UnsignedLong" and @ref Magnum::Long "Long" + * result type is not available in @ref MAGNUM_TARGET_WEBGL "WebGL". */ template T result(); @@ -147,9 +149,11 @@ class MAGNUM_EXPORT AbstractQuery: public AbstractObject { template<> bool MAGNUM_EXPORT AbstractQuery::result(); template<> UnsignedInt MAGNUM_EXPORT AbstractQuery::result(); template<> Int MAGNUM_EXPORT AbstractQuery::result(); +#ifndef MAGNUM_TARGET_WEBGL template<> UnsignedLong MAGNUM_EXPORT AbstractQuery::result(); template<> Long MAGNUM_EXPORT AbstractQuery::result(); #endif +#endif #ifndef MAGNUM_TARGET_GLES2 /** diff --git a/src/Magnum/Types.h b/src/Magnum/Types.h index 8a2be413e..ef3de0a72 100644 --- a/src/Magnum/Types.h +++ b/src/Magnum/Types.h @@ -42,8 +42,10 @@ typedef std::uint16_t UnsignedShort; typedef std::int16_t Short; typedef std::uint32_t UnsignedInt; typedef std::int32_t Int; +#ifndef MAGNUM_TARGET_WEBGL typedef std::uint64_t UnsignedLong; typedef std::int64_t Long; +#endif /** @todo C++14: use std::float32_t and std::float_64t [N3626](http://open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3626.pdf) */ typedef float Float;