Skip to content

Commit 30b40bf

Browse files
committed
MSVC doesn't support "std::array<bool>".
1 parent aafecaf commit 30b40bf

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/box.h

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,10 @@
4141
#include "logging.h"
4242
#include "bitstream.h"
4343

44+
#if !defined(__EMSCRIPTEN__) && !defined(_MSC_VER)
45+
// std::array<bool> is not supported on some older compilers.
46+
#define HAS_BOOL_ARRAY 1
47+
#endif
4448

4549
namespace heif {
4650

@@ -475,7 +479,7 @@ namespace heif {
475479
class Box_hvcC : public Box {
476480
public:
477481
Box_hvcC(const BoxHeader& hdr) : Box(hdr) {
478-
#if defined(__EMSCRIPTEN__)
482+
#if !defined(HAS_BOOL_ARRAY)
479483
m_general_constraint_indicator_flags.resize(NUM_CONSTRAINT_INDICATOR_FLAGS);
480484
#endif
481485
}
@@ -494,7 +498,7 @@ namespace heif {
494498
bool m_general_tier_flag;
495499
uint8_t m_general_profile_idc;
496500
uint32_t m_general_profile_compatibility_flags;
497-
#if !defined(__EMSCRIPTEN__)
501+
#if defined(HAS_BOOL_ARRAY)
498502
std::array<bool,NUM_CONSTRAINT_INDICATOR_FLAGS> m_general_constraint_indicator_flags;
499503
#else
500504
std::vector<bool> m_general_constraint_indicator_flags;

0 commit comments

Comments
 (0)