diff options
author | Marcel Raad <Marcel.Raad@teamviewer.com> | 2020-01-02 22:47:33 +0100 |
---|---|---|
committer | Marcel Raad <Marcel.Raad@teamviewer.com> | 2020-05-14 18:13:37 +0200 |
commit | ffdddb45d9dc87b3a2f67dcdbdcc11f4a4e029d2 (patch) | |
tree | 0c19793ff9ad4afbbda7296e948f300f4e749684 /lib/curl_setup.h | |
parent | 9e5669f3880674de262000e772ef21ec0cc874be (diff) | |
download | curl-ffdddb45d9dc87b3a2f67dcdbdcc11f4a4e029d2.tar.gz |
curl_setup: support Unicode functions to open files on Windows
Use them only if `_UNICODE` is defined, in which case command-line
arguments have been converted to UTF-8.
Closes https://github.com/curl/curl/pull/3784
Diffstat (limited to 'lib/curl_setup.h')
-rw-r--r-- | lib/curl_setup.h | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/curl_setup.h b/lib/curl_setup.h index 56e6db83c..a86a235b3 100644 --- a/lib/curl_setup.h +++ b/lib/curl_setup.h @@ -331,9 +331,12 @@ # undef fstat # define fstat(fdes,stp) _fstati64(fdes, stp) # undef stat -# define stat(fname,stp) _stati64(fname, stp) +# define stat(fname,stp) curlx_win32_stat(fname, stp) # define struct_stat struct _stati64 # define LSEEK_ERROR (__int64)-1 +# define fopen(fname,mode) curlx_win32_fopen(fname, mode) + int curlx_win32_stat(const char *path, struct_stat *buffer); + FILE *curlx_win32_fopen(const char *filename, const char *mode); #endif /* @@ -348,8 +351,11 @@ # undef lseek # define lseek(fdes,offset,whence) _lseek(fdes, (long)offset, whence) # define fstat(fdes,stp) _fstat(fdes, stp) -# define stat(fname,stp) _stat(fname, stp) +# define stat(fname,stp) curlx_win32_stat(fname, stp) # define struct_stat struct _stat +# define fopen(fname,mode) curlx_win32_fopen(fname, mode) + int curlx_win32_stat(const char *path, struct_stat *buffer); + FILE *curlx_win32_fopen(const char *filename, const char *mode); # endif # define LSEEK_ERROR (long)-1 #endif |