mirror of
https://github.com/curl/curl.git
synced 2026-07-26 08:38:02 +03:00
build: tidy up and simplify setmode() detection and use
- move macro to `curl_setup.h` (from curlx), and rename. It's required by src, test servers, libtests. Also used by unit/tunit, (which is fixable but this patch doesn't touch it.) - special-case it for Windows/Cygwin/MS-DOS. - build: drop `setmode()`/`_setmode()` detection. This also avoids detecting the different `setmode()` on BSDs, and a lot of complexity and overhead. - use `CURL_O_BINARY`. Follow-up to250d613763#15787 Follow-up to5e70566094#15169 Closes #20539
This commit is contained in:
parent
2c0019b085
commit
cdfc8dc7ad
19 changed files with 32 additions and 103 deletions
|
|
@ -675,7 +675,7 @@ static ParameterError data_urlencode(const char *nextarg,
|
|||
/* a '@' letter, it means that a filename or - (stdin) follows */
|
||||
if(!strcmp("-", p)) {
|
||||
file = stdin;
|
||||
CURLX_SET_BINMODE(stdin);
|
||||
CURL_BINMODE(stdin);
|
||||
}
|
||||
else {
|
||||
file = curlx_fopen(p, "rb");
|
||||
|
|
@ -949,7 +949,7 @@ static ParameterError set_data(cmdline_t cmd,
|
|||
if(!strcmp("-", nextarg)) {
|
||||
file = stdin;
|
||||
if(cmd == C_DATA_BINARY) /* forced data-binary */
|
||||
CURLX_SET_BINMODE(stdin);
|
||||
CURL_BINMODE(stdin);
|
||||
}
|
||||
else {
|
||||
file = curlx_fopen(nextarg, "rb");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue