summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNirbheek Chauhan <nirbheek@centricular.com>2021-08-23 19:36:26 +0530
committerSimon Ser <contact@emersion.fr>2021-09-17 16:08:04 +0000
commitbd4e7a9b9e672105bda35ff736c977adbf719c6c (patch)
treebb9ba8b424619f51ef753b051040f49da6f16a46
parente0d4403e78a7af8f4be4110ae25e9c3d1ac93a78 (diff)
downloadpixman-bd4e7a9b9e672105bda35ff736c977adbf719c6c.tar.gz
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
-rw-r--r--test/utils.c4
1 files 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.