programmer_table: add table size constant

Makes the array size known to other compilation units.

Change-Id: Idacb4b7b0dd98af8bc7cbecf567d33daafb4b24d
Signed-off-by: Thomas Heijligen <thomas.heijligen@secunet.de>
Original-Reviewed-on: https://review.coreboot.org/c/flashrom/+/55116
Original-Reviewed-by: Nico Huber <nico.h@gmx.de>
Original-Reviewed-by: Edward O'Callaghan <quasisec@chromium.org>
Original-Reviewed-by: Anastasia Klimchuk <aklm@chromium.org>
Reviewed-on: https://review.coreboot.org/c/flashrom-stable/+/71367
Reviewed-by: Nico Huber <nico.h@gmx.de>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
diff --git a/flashrom.c b/flashrom.c
index 59a2739..1334a19 100644
--- a/flashrom.c
+++ b/flashrom.c
@@ -474,6 +474,8 @@
 #endif
 };
 
+const size_t programmer_table_size = ARRAY_SIZE(programmer_table);
+
 #define SHUTDOWN_MAXFN 32
 static int shutdown_fn_count = 0;
 /** @private */
@@ -2068,7 +2070,7 @@
 	/* Safety check. Instead of aborting after the first error, check
 	 * if more errors exist.
 	 */
-	if (ARRAY_SIZE(programmer_table) != PROGRAMMER_INVALID) {
+	if (programmer_table_size != PROGRAMMER_INVALID) {
 		msg_gerr("Programmer table miscompilation!\n");
 		ret = 1;
 	}