diff --git a/src/libcamera/controls.cpp b/src/libcamera/controls.cpp
index 08df7f29e938..eaef45a5f62c 100644
--- a/src/libcamera/controls.cpp
+++ b/src/libcamera/controls.cpp
@@ -8,6 +8,7 @@
 #include <libcamera/controls.h>

 #include <iomanip>
+#include <map>
 #include <sstream>
 #include <string>
 #include <string.h>
@@ -50,16 +51,16 @@ LOG_DEFINE_CATEGORY(Controls)

 namespace {

-static constexpr size_t ControlValueSize[] = {
-	[ControlTypeNone]		= 0,
-	[ControlTypeBool]		= sizeof(bool),
-	[ControlTypeByte]		= sizeof(uint8_t),
-	[ControlTypeInteger32]		= sizeof(int32_t),
-	[ControlTypeInteger64]		= sizeof(int64_t),
-	[ControlTypeFloat]		= sizeof(float),
-	[ControlTypeString]		= sizeof(char),
-	[ControlTypeRectangle]		= sizeof(Rectangle),
-	[ControlTypeSize]		= sizeof(Size),
+std::map<unsigned int, size_t> ControlValueSize = {
+	{ ControlTypeNone,	0  },
+	{ ControlTypeBool,	sizeof(bool) },
+	{ ControlTypeByte,	sizeof(uint8_t) },
+	{ ControlTypeInteger32,	sizeof(int32_t) },
+	{ ControlTypeInteger64,	sizeof(int64_t) },
+	{ ControlTypeFloat,	sizeof(float) },
+	{ ControlTypeString,	sizeof(char) },
+	{ ControlTypeRectangle,	sizeof(Rectangle) },
+	{ ControlTypeSize,	sizeof(Size) },
 };

 } /* namespace */
