Mercurial > hg > nginx
comparison src/os/win32/ngx_win32_config.h @ 9198:514c518b9d6c
Win32: extended ngx_random() range to 0x7fffffff.
rand() is used on win32. RAND_MAX is implementation defined. win32's is
0x7fff.
Existing uses of ngx_random() rely upon 0x7fffffff range provided by
POSIX implementations of random().
author | J Carter <jordanc.carter@outlook.com> |
---|---|
date | Sat, 09 Dec 2023 08:38:14 +0000 |
parents | b347fe705ff2 |
children |
comparison
equal
deleted
inserted
replaced
9197:cc16989c6d61 | 9198:514c518b9d6c |
---|---|
278 #define NGX_HAVE_FIONREAD 1 | 278 #define NGX_HAVE_FIONREAD 1 |
279 #endif | 279 #endif |
280 | 280 |
281 #define NGX_HAVE_GETADDRINFO 1 | 281 #define NGX_HAVE_GETADDRINFO 1 |
282 | 282 |
283 #define ngx_random rand | 283 #define ngx_random() \ |
284 ((long) (0x7fffffff & ( ((uint32_t) rand() << 16) \ | |
285 ^ ((uint32_t) rand() << 8) \ | |
286 ^ ((uint32_t) rand()) ))) | |
287 | |
284 #define ngx_debug_init() | 288 #define ngx_debug_init() |
285 | 289 |
286 | 290 |
287 #endif /* _NGX_WIN32_CONFIG_H_INCLUDED_ */ | 291 #endif /* _NGX_WIN32_CONFIG_H_INCLUDED_ */ |