diff options
author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2018-12-30 18:39:00 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-12-30 18:39:00 -0800 |
commit | d82344378ad8e471b8ed12fb99807f68351c5412 (patch) | |
tree | 4167099d18d8f0b7f29a9477ebe9f8dcfb093593 /Python | |
parent | e40429905773cdbdb5458a5d93600b5816668470 (diff) | |
download | cpython-git-d82344378ad8e471b8ed12fb99807f68351c5412.tar.gz |
bpo-35550: Fix incorrect Solaris define guards (GH-11275)
Python source code uses on several places ifdef sun or defined(sun) without the underscores, which is not standard compliant and shouldn't be used.
Defines should check for __sun instead. Reference: http://nadeausoftware.com/articles/2012/01/c_c_tip_how_use_compiler_predefined_macros_detect_operating_systemGH-Solaris
https://bugs.python.org/issue35550
(cherry picked from commit 6f9bc72c79c3262e5d0f2c0e96b016477399cfb1)
Co-authored-by: Jakub KulĂk <Kulikjak@gmail.com>
Diffstat (limited to 'Python')
-rw-r--r-- | Python/bootstrap_hash.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Python/bootstrap_hash.c b/Python/bootstrap_hash.c index e2afba2b2e..58b0802f46 100644 --- a/Python/bootstrap_hash.c +++ b/Python/bootstrap_hash.c @@ -116,7 +116,7 @@ py_getrandom(void *buffer, Py_ssize_t size, int blocking, int raise) flags = blocking ? 0 : GRND_NONBLOCK; dest = buffer; while (0 < size) { -#ifdef sun +#if defined(__sun) && defined(__SVR4) /* Issue #26735: On Solaris, getrandom() is limited to returning up to 1024 bytes. Call it multiple times if more bytes are requested. */ @@ -266,7 +266,7 @@ py_getentropy(char *buffer, Py_ssize_t size, int raise) } return 1; } -#endif /* defined(HAVE_GETENTROPY) && !defined(sun) */ +#endif /* defined(HAVE_GETENTROPY) && !(defined(__sun) && defined(__SVR4)) */ static struct { |