summaryrefslogtreecommitdiffstats
path: root/src/H5win32defs.h
diff options
context:
space:
mode:
authorDana Robinson <derobins@hdfgroup.org>2019-03-31 01:31:11 (GMT)
committerDana Robinson <derobins@hdfgroup.org>2019-03-31 01:31:11 (GMT)
commit6e0d81dc8b65dc078fa31dae50acf96f3ce372e7 (patch)
tree588378063a4eae446ffe0c7e684f4e3aff6af358 /src/H5win32defs.h
parentfdbbe61bcf2c5bcbea8a4e08bd6ce8c62f7b43bc (diff)
parent799a732650735b8ad05a0398781d2a26ec47b288 (diff)
downloadhdf5-6e0d81dc8b65dc078fa31dae50acf96f3ce372e7.zip
hdf5-6e0d81dc8b65dc078fa31dae50acf96f3ce372e7.tar.gz
hdf5-6e0d81dc8b65dc078fa31dae50acf96f3ce372e7.tar.bz2
Merge pull request #1629 in HDFFV/hdf5 from ~DEROBINS/hdf5_der:feature/json_vol to feature/json_vol
* commit '799a732650735b8ad05a0398781d2a26ec47b288': (185 commits) Updated the VOL struct. The json_vol test fails, though, because the plugin can't be found. Will diagnose later. Correct examples for packaging HDFFV-10738 Wrong INTENT for H5LTread_dataset_double_f Changes that show the right way to iterate over enums. Changes that show the right way to iterate over enums. Test improvement Description Moved the new tests to a more appropriate test function. Platforms tested: Linux/64 (jelly) Used the H5_INC_ENUM macro to squash enum value increment warnings. Fixed HDFFV-10210 and HDFFV-10587 Description: - Added parameter validation (HDFFV-10210) - Added detection of division by zero (HDFFV-10587 - CVE-2018-17438) - Fixed typos in various tests Platforms tested: Linux/64 (jelly) Linux/64 (platypus) Darwin (osx1011test) Fix CMake error in name Commented out memcpy overlap check while we investigate parallel filters issues. Yanked check for memcpy n > 0 - Added H5MMprivate.h #includes where needed - Added casts to quiet H5MM_memcpy warnings - Removed char * casts from HDmemcpy Added an H5MM_memcpy call that checks for buffer overlap. Added the HDopen work-around on windows to pio_engine.c Adds _wopen support on Windows so that files with UTF-8 names can be opened. CMake: fix pthread linking to only be private Add API routines to retrieve, restore, reset, and free library state. Added a note of bug fix for HDFFV-10705. Fixed the MANIFEST Fix issue with direct chunk write not updating the "last chunk" index cache. Fix issues involving datasets being "no allocated" when they contain cached raw data. ...
Diffstat (limited to 'src/H5win32defs.h')
-rw-r--r--src/H5win32defs.h14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/H5win32defs.h b/src/H5win32defs.h
index 140afc3..2ae2575 100644
--- a/src/H5win32defs.h
+++ b/src/H5win32defs.h
@@ -34,6 +34,7 @@ typedef __int64 h5_stat_size_t;
#define HDaccess(F,M) _access(F,M)
#define HDchdir(S) _chdir(S)
#define HDclose(F) _close(F)
+#define HDcreat(S,M) Wopen_utf8(S,O_CREAT|O_TRUNC|O_RDWR,M)
#define HDdup(F) _dup(F)
#define HDfdopen(N,S) _fdopen(N,S)
#define HDfileno(F) _fileno(F)
@@ -47,15 +48,13 @@ typedef __int64 h5_stat_size_t;
#define HDmkdir(S,M) _mkdir(S)
#define HDnanosleep(N, O) Wnanosleep(N, O)
#define HDoff_t __int64
-/* _O_BINARY must be set in Windows to avoid CR-LF <-> LF EOL
- * transformations when performing I/O. Note that this will
- * produce Unix-style text files, though.
- *
- * Also note that the variadic macro is using a VC++ extension
+
+/* Note that the variadic HDopen macro is using a VC++ extension
* where the comma is dropped if nothing is passed to the ellipsis.
*/
-#define HDopen(S,F,...) _open(S, F | _O_BINARY, __VA_ARGS__)
+#define HDopen(S,F,...) Wopen_utf8(S,F,__VA_ARGS__)
#define HDread(F,M,Z) _read(F,M,Z)
+#define HDremove(S) Wremove_utf8(S)
#define HDrmdir(S) _rmdir(S)
#define HDsetvbuf(F,S,M,Z) setvbuf(F,S,M,(Z>1?Z:2))
#define HDsleep(S) Sleep(S*1000)
@@ -128,6 +127,9 @@ extern "C" {
H5_DLL int c99_vsnprintf(char* str, size_t size, const char* format, va_list ap);
H5_DLL int Wnanosleep(const struct timespec *req, struct timespec *rem);
H5_DLL herr_t H5_expand_windows_env_vars(char **env_var);
+ H5_DLL const wchar_t *H5_get_utf16_str(const char *s);
+ H5_DLL int Wopen_utf8(const char *path, int oflag, ...);
+ H5_DLL int Wremove_utf8(const char *path);
/* Round functions only needed for VS2012 and earlier.
* They are always built to ensure they don't go stale and