From bd4e7a9b9e672105bda35ff736c977adbf719c6c Mon Sep 17 00:00:00 2001 From: Nirbheek Chauhan Date: Mon, 23 Aug 2021 19:36:26 +0530 Subject: tests: Fix undefined symbol build error on macOS prng_state and prng_state_data are getting classified as a "Common symbol" by the compiler due to the convoluted way in which it is `#include`-ed in various test sources, and that's not read as a valid symbol by the linker later. Initializing the symbol clarifies it to the compiler that this specific declaration is the canonical location for this variable, and that it's not a "Common symbol". Fixes https://gitlab.freedesktop.org/pixman/pixman/-/issues/42 --- test/utils.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/utils.c b/test/utils.c index cd9ab26..1c64cee 100644 --- a/test/utils.c +++ b/test/utils.c @@ -35,8 +35,8 @@ /* Random number generator state */ -prng_t prng_state_data; -prng_t *prng_state; +prng_t prng_state_data = {0}; +prng_t *prng_state = NULL; /*----------------------------------------------------------------------------*\ * CRC-32 version 2.0.0 by Craig Bruce, 2006-04-29. -- cgit v1.2.1