}
/* save the path name for error messages */
- state->path = malloc(strlen(path) + 1);
+# define WPATH "<widepath>"
+ state->path = malloc(strlen(fd == -2 ? WPATH : (path) + 1);
if (state->path == NULL) {
free(state);
return NULL;
}
- strcpy(state->path, path);
+ strcpy(state->path, fd == -2 ? WPATH : path);
/* compute the flags for open() */
oflag =
# endif
#endif
+#ifdef _WIN32
+# include <stddef.h> /* for wchar_t */
+#endif
+
/* a little trick to accommodate both "#define _LARGEFILE64_SOURCE" and
* "#define _LARGEFILE64_SOURCE 1" as requesting 64-bit operations, (even
* though the former does not conform to the LFS document), but considering
# endif
#endif
+#ifdef _WIN32
+# include <stddef.h> /* for wchar_t */
+#endif
+
/* a little trick to accommodate both "#define _LARGEFILE64_SOURCE" and
* "#define _LARGEFILE64_SOURCE 1" as requesting 64-bit operations, (even
* though the former does not conform to the LFS document), but considering
# endif
#endif
+#ifdef _WIN32
+# include <stddef.h> /* for wchar_t */
+#endif
+
/* a little trick to accommodate both "#define _LARGEFILE64_SOURCE" and
* "#define _LARGEFILE64_SOURCE 1" as requesting 64-bit operations, (even
* though the former does not conform to the LFS document), but considering