send: drop `CURL_UNCONST()` from buffer argument on most platforms
No binary (build failed)
—
(log yok)
| @@ -77,7 +77,6 @@ | |
| #define HAVE_SEND 1 | |
| #define SEND_TYPE_ARG1 int | |
| - | #define SEND_QUAL_ARG2 const |
| #define SEND_TYPE_ARG2 void * | |
| #define SEND_TYPE_ARG3 size_t | |
| #define SEND_TYPE_ARG4 int | |
| @@ -256,8 +256,8 @@ | |
| /* Define to the type of arg 1 for send. */ | |
| #define SEND_TYPE_ARG1 int | |
| - | /* Define to the type qualifier of arg 2 for send. */ |
| - | #define SEND_QUAL_ARG2 |
| + | /* Define if the type qualifier of arg 2 for send is not const. */ |
| + | #define SEND_NONCONST_ARG2 |
| /* Define to the type of arg 2 for send. */ | |
| #define SEND_TYPE_ARG2 char * | |
| @@ -213,9 +213,6 @@ | |
| /* Define to the type of arg 1 for send. */ | |
| #define SEND_TYPE_ARG1 int | |
| - | /* Define to the type qualifier of arg 2 for send. */ |
| - | #define SEND_QUAL_ARG2 const |
| - | |
| /* Define to the type of arg 2 for send. */ | |
| #define SEND_TYPE_ARG2 void * | |
| @@ -156,9 +156,6 @@ | |
| /* Define to the type of arg 1 for send. */ | |
| #define SEND_TYPE_ARG1 SOCKET | |
| - | /* Define to the type qualifier of arg 2 for send. */ |
| - | #define SEND_QUAL_ARG2 const |
| - | |
| /* Define to the type of arg 2 for send. */ | |
| #define SEND_TYPE_ARG2 char * | |
| @@ -144,9 +144,10 @@ struct timeval { | |
| * which is used to write outgoing data on a connected socket. | |
| * If yours has another name then do not define HAVE_SEND. | |
| * | |
| - | * If HAVE_SEND is defined then SEND_TYPE_ARG1, SEND_QUAL_ARG2, |
| - | * SEND_TYPE_ARG2, SEND_TYPE_ARG3, SEND_TYPE_ARG4 and |
| - | * SEND_TYPE_RETV must also be defined. |
| + | * If HAVE_SEND is defined then SEND_TYPE_ARG1, SEND_TYPE_ARG2, |
| + | * SEND_TYPE_ARG3, SEND_TYPE_ARG4 and SEND_TYPE_RETV must also |
| + | * be defined. SEND_NONCONST_ARG2 must also be defined if ARG2 |
| + | * does not accept const. |
| */ | |
| #define sread(x, y, z) (ssize_t)recv((RECV_TYPE_ARG1)(x), \ | |
| @@ -165,10 +166,17 @@ struct timeval { | |
| (SEND_TYPE_ARG2)CURL_UNCONST(y), \ | |
| (SEND_TYPE_ARG3)(z)) | |
| #elif defined(HAVE_SEND) | |
| + | #ifdef SEND_NONCONST_ARG2 |
| #define swrite(x, y, z) (ssize_t)send((SEND_TYPE_ARG1)(x), \ | |
| - | (SEND_QUAL_ARG2 SEND_TYPE_ARG2)CURL_UNCONST(y), \ |
| + | (SEND_TYPE_ARG2)CURL_UNCONST(y), \ |
| (SEND_TYPE_ARG3)(z), \ | |
| (SEND_TYPE_ARG4)(SEND_4TH_ARG)) | |
| + | #else |
| + | #define swrite(x, y, z) (ssize_t)send((SEND_TYPE_ARG1)(x), \ |
| + | (const SEND_TYPE_ARG2)(y), \ |
| + | (SEND_TYPE_ARG3)(z), \ |
| + | (SEND_TYPE_ARG4)(SEND_4TH_ARG)) |
| + | #endif /* SEND_NONCONST_ARG2 */ |
| #else /* HAVE_SEND */ | |
| #ifndef swrite | |
| #error "Missing definition of macro swrite!" | |
| @@ -59,9 +59,9 @@ | |
| #define RECV_TYPE_ARG4 long | |
| #define RECV_TYPE_RETV long | |
| - | /* int send(int, const char *, int, int); */ |
| + | /* int send(int, char *, int, int); */ |
| #define SEND_TYPE_ARG1 int | |
| - | #define SEND_QUAL_ARG2 |
| + | #define SEND_NONCONST_ARG2 |
| #define SEND_TYPE_ARG2 char * | |
| #define SEND_TYPE_ARG3 int | |
| #define SEND_TYPE_RETV int | |
| @@ -87,10 +87,6 @@ | |
| #define RECV_TYPE_RETV ssize_t | |
| #endif | |
| - | #ifndef SEND_QUAL_ARG2 |
| - | #define SEND_QUAL_ARG2 const |
| - | #endif |
| - | |
| #ifndef SEND_TYPE_ARG1 | |
| #define SEND_TYPE_ARG1 int | |
| #endif | |
| @@ -1582,13 +1582,6 @@ $! Process SEND directives | |
| $!------------------------------------- | |
| $ if key2a .eqs. "SEND" | |
| $ then | |
| - | $ if key2 .eqs. "SEND_QUAL_ARG2" |
| - | $ then |
| - | $ write tf "#ifndef ''key2'" |
| - | $ write tf "#define ''key2' const" |
| - | $ write tf "#endif" |
| - | $ goto cfgh_in_loop1 |
| - | $ endif |
| $ if key2 .eqs. "SEND_TYPE_ARG1" | |
| $ then | |
| $ write tf "#ifndef ''key2'" | |