diff options
author | Alexander Kuznetsov <kuzsasha@gmail.com> | 2012-03-20 06:17:37 +0400 |
---|---|---|
committer | Alexander Kuznetsov <kuzsasha@gmail.com> | 2012-03-20 06:17:37 +0400 |
commit | f11a6d3a847e8e18faefd8694373d2f11b5ec802 (patch) | |
tree | b4bec6dcfd28e3da4fa1e84ee4bd20fa0a21be39 /source/blender/blenloader/intern | |
parent | deea1f38b1ec0ccba283abeb63506cbc15e093d5 (diff) |
Adds support for utf paths on Windows.
Not all file formats/calls are supported yet. It will be expended.
Please from now on use BLI_fopen, BLI_* for file manipulations.
For non-windows systems BLI_fopen just calls fopen.
For Windows, the utf-8 string is translated to utf-16 string in order to call UTF version of the function.
Diffstat (limited to 'source/blender/blenloader/intern')
-rw-r--r-- | source/blender/blenloader/intern/readfile.c | 2 | ||||
-rw-r--r-- | source/blender/blenloader/intern/runtime.c | 4 | ||||
-rw-r--r-- | source/blender/blenloader/intern/writefile.c | 2 |
3 files changed, 4 insertions, 4 deletions
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 95a76dac616..7a6e23cd5bb 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -990,7 +990,7 @@ FileData *blo_openblenderfile(const char *filepath, ReportList *reports) { gzFile gzfile; errno= 0; - gzfile= gzopen(filepath, "rb"); + gzfile= BLI_gzopen(filepath, "rb"); if (gzfile == (gzFile)Z_NULL) { BKE_reportf(reports, RPT_ERROR, "Unable to open \"%s\": %s.", filepath, errno ? strerror(errno) : "Unknown error reading file"); diff --git a/source/blender/blenloader/intern/runtime.c b/source/blender/blenloader/intern/runtime.c index 3f8a9807f18..88f602641ff 100644 --- a/source/blender/blenloader/intern/runtime.c +++ b/source/blender/blenloader/intern/runtime.c @@ -68,7 +68,7 @@ static int handle_read_msb_int(int handle) int BLO_is_a_runtime(const char *path) { - int res= 0, fd= open(path, O_BINARY|O_RDONLY, 0); + int res= 0, fd= BLI_open(path, O_BINARY|O_RDONLY, 0); int datastart; char buf[8]; @@ -102,7 +102,7 @@ BlendFileData *BLO_read_runtime(const char *path, ReportList *reports) int fd, datastart; char buf[8]; - fd= open(path, O_BINARY|O_RDONLY, 0); + fd= BLI_open(path, O_BINARY|O_RDONLY, 0); if(fd==-1) { BKE_reportf(reports, RPT_ERROR, "Unable to open \"%s\": %s.", path, strerror(errno)); diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c index 8cd6712c560..02de7a371ff 100644 --- a/source/blender/blenloader/intern/writefile.c +++ b/source/blender/blenloader/intern/writefile.c @@ -2887,7 +2887,7 @@ int BLO_write_file(Main *mainvar, const char *filepath, int write_flags, ReportL /* open temporary file, so we preserve the original in case we crash */ BLI_snprintf(tempname, sizeof(tempname), "%s@", filepath); - file = open(tempname,O_BINARY+O_WRONLY+O_CREAT+O_TRUNC, 0666); + file = BLI_open(tempname,O_BINARY+O_WRONLY+O_CREAT+O_TRUNC, 0666); if(file == -1) { BKE_reportf(reports, RPT_ERROR, "Can't open file %s for writing: %s.", tempname, strerror(errno)); return 0; |