mirror of
https://github.com/curl/curl.git
synced 2026-04-14 22:41:40 +03:00
tidy-up: avoid using the reserved macro namespace
To avoid hitting `-Wreserved-macro-identifier` where possible. - amigaos: introduce local macro instead of reusing `__request()`. - easy_lock: avoid redefining `__has_builtin()`. Follow-up to33fd57b8ff#9062 - rand: drop interim macro `_random()`. - windows: rename local macro `_tcsdup()` to `Curl_tcsdup()`. To avoid using the reserved macro namespace and to avoid colliding with `_tcsdup()` as defined by Windows headers. - checksrc: ban `_tcsdup()` in favor of `Curl_tcsdup()`. - tool_doswin: avoid redefining `_use_lfn()` (MS-DOS). - tool_findfile: limit `__NO_NET_API` hack to AmigaOS. Syncing this pattern with `lib/netrc.c`. Follow-up to784a8ec2c1#16279 - examples/http2-upload: avoid reserved namespace for local macro. More cases will be removed when dropping WinCE support via #17927. Cases remain when defining external macros out of curl's control. Ref: #18477 Closes #18482
This commit is contained in:
parent
096fc4325b
commit
ad26a6cb99
16 changed files with 40 additions and 36 deletions
12
lib/rand.c
12
lib/rand.c
|
|
@ -149,12 +149,6 @@ static CURLcode weak_random(struct Curl_easy *data,
|
|||
}
|
||||
#endif
|
||||
|
||||
#ifdef USE_SSL
|
||||
#define _random(x,y,z) Curl_ssl_random(x,y,z)
|
||||
#else
|
||||
#define _random(x,y,z) weak_random(x,y,z)
|
||||
#endif
|
||||
|
||||
static CURLcode randit(struct Curl_easy *data, unsigned int *rnd,
|
||||
bool env_override)
|
||||
{
|
||||
|
|
@ -185,7 +179,11 @@ static CURLcode randit(struct Curl_easy *data, unsigned int *rnd,
|
|||
#endif
|
||||
|
||||
/* data may be NULL! */
|
||||
return _random(data, (unsigned char *)rnd, sizeof(*rnd));
|
||||
#ifdef USE_SSL
|
||||
return Curl_ssl_random(data, (unsigned char *)rnd, sizeof(*rnd));
|
||||
#else
|
||||
return weak_random(data, (unsigned char *)rnd, sizeof(*rnd));
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue