]> granicus.if.org Git - json-c/commitdiff
Fix up the test_util_file test for builds on Windows VS2015.
authorEric Haszlakiewicz <erh+git@nimenees.com>
Sun, 24 Nov 2019 04:14:24 +0000 (23:14 -0500)
committerEric Haszlakiewicz <erh+git@nimenees.com>
Sun, 24 Nov 2019 04:14:24 +0000 (23:14 -0500)
tests/test_util_file.c

index d4145478642ee97bf33bbc228ea8c916585c9f5f..65be9b93c7a03fe9d6b3804d75298d736d45ecf9 100644 (file)
@@ -1,5 +1,10 @@
 #include "strerror_override.h"
 #include "strerror_override_private.h"
+#ifdef WIN32
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+#include <io.h>
+#endif /* defined(WIN32) */  
 #include <stdio.h>
 #include <stdlib.h>
 #include <stddef.h>
@@ -23,6 +28,10 @@ static void test_read_closed(void);
 static void test_write_to_file();
 static void stat_and_cat(const char *file);
 
+#ifndef PATH_MAX
+#define PATH_MAX 256
+#endif
+
 static void test_write_to_file()
 {
        json_object *jso;