setenv() does not exist on Windows API, hence babl tools fail to build.
Fixing the issue by using an alternative Windows API.
#define random rand
#endif
+#ifdef _WIN32
+/* On Windows setenv() does not exist, using _putenv_s() instead. The overwrite
+ * arg is ignored (i.e. same as always 1).
+ */
+#define setenv(name,value,overwrite) _putenv_s(name, value)
+#endif
+
int ITERATIONS = 4;
#define N_PIXELS (1024*1024) // a too small batch makes the test set live
// in l2 cache skewing results
#define random rand
#endif
+#ifdef _WIN32
+/* On Windows setenv() does not exist, using _putenv_s() instead. The overwrite
+ * arg is ignored (i.e. same as always 1).
+ */
+#define setenv(name,value,overwrite) _putenv_s(name, value)
+#endif
+
static double
test_generic (const Babl *source, const Babl *dest)
{
#define SPACE1 babl_space("sRGB")
//#define SPACE2 babl_space("Apple")
+#ifdef _WIN32
+/* On Windows setenv() does not exist, using _putenv_s() instead. The overwrite
+ * arg is ignored (i.e. same as always 1).
+ */
+#define setenv(name,value,overwrite) _putenv_s(name, value)
+#endif
+
int
file_get_contents (const char *path,
char **contents,