aboutsummaryrefslogtreecommitdiffstats
path: root/wsutil
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2015-11-06 11:19:45 -0800
committerGuy Harris <guy@alum.mit.edu>2015-11-06 23:44:11 +0000
commitf542ab8e8ef5919fd9c2d4bbbf05ae0d7dc7e9d1 (patch)
tree17a6b70162f6fb90869a032c1c3ed53fce513fd2 /wsutil
parent161f449c4e475f8ee709125636bd7a2492352466 (diff)
file_util.h includes io.h, we don't need to do so ourselves.
While we're at it, get rid of a commented-out include, and update a comment to give more information. Change-Id: I910a26a3d7f4a50f0559abe5f2ab97a93c80357f Reviewed-on: https://code.wireshark.org/review/11610 Petri-Dish: Guy Harris <guy@alum.mit.edu> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'wsutil')
-rw-r--r--wsutil/file_util.c39
1 files changed, 32 insertions, 7 deletions
diff --git a/wsutil/file_util.c b/wsutil/file_util.c
index 50f4fff411..48570027b6 100644
--- a/wsutil/file_util.c
+++ b/wsutil/file_util.c
@@ -20,13 +20,40 @@
*
*/
-/* file wrapper functions to prevent the file functions from GLib like g_open(),
- * as code compiled with MSVC 7 and above will collide with libs linked with msvcrt.dll (MSVC 6), lib GLib is
+/*
+ * File wrapper functions to replace the file functions from GLib like
+ * g_open().
+ *
+ * With MSVC, code using the C support library from one version of MSVC
+ * cannot use file descriptors or FILE *'s returned from code using
+ * the C support library from another version of MSVC.
+ *
+ * We therefore provide our own versions of the routines to open files,
+ * so that they're built to use the same C support library as our code
+ * that reads them.
+ *
+ * (If both were built to use the Universal CRT:
+ *
+ * http://blogs.msdn.com/b/vcblog/archive/2015/03/03/introducing-the-universal-crt.aspx
*
- * DO NOT USE THESE FUNCTIONS DIRECTLY, USE ws_open() AND ALIKE FUNCTIONS FROM file_util.h INSTEAD!!!
+ * this would not be a problem.)
*
- * the following code is stripped down code copied from the GLib file glib/gstdio.h
- * stripped down, because this is used on _WIN32 only and we use only wide char functions */
+ * DO NOT USE THESE FUNCTIONS DIRECTLY, USE ws_open() AND ALIKE FUNCTIONS
+ * FROM file_util.h INSTEAD!!!
+ *
+ * The following code is stripped down code copied from the GLib file
+ * glib/gstdio.h - stripped down because this is used only on Windows
+ * and we use only wide char functions.
+ *
+ * In addition, we have our own ws_stdio_stat64(), which uses
+ * _wstati64(), so that we can get file sizes for files > 4 GB in size.
+ *
+ * XXX - is there any reason why we supply our own versions of routines
+ * that *don't* return file descriptors, other than ws_stdio_stat64()?
+ * Is there an issue with UTF-16 support in _wmkdir() with some versions
+ * of the C runtime, so that if GLib is built to use that version, it
+ * won't handle UTF-16 paths?
+ */
#ifndef _WIN32
#error "This is only for Windows"
@@ -40,8 +67,6 @@
#include <errno.h>
#include <wchar.h>
#include <tchar.h>
-/*#include <direct.h>*/
-#include <io.h>
#include <stdlib.h>
#include "file_util.h"