diff options
author | Björn Esser <besser82@fedoraproject.org> | 2020-08-18 21:15:52 +0200 |
---|---|---|
committer | Björn Esser <besser82@fedoraproject.org> | 2020-10-12 16:35:22 +0200 |
commit | 7bb2e241a0f39a2e42dee6dc3ec3773d42aabb92 (patch) | |
tree | 2117d4c8a4427d34d7a4b6f0fdb71e0ddc9fc2e3 /test | |
parent | d3c5b3dd41e13a17a42d1af278f99720adaa23d4 (diff) | |
download | libxcrypt-7bb2e241a0f39a2e42dee6dc3ec3773d42aabb92.tar.gz libxcrypt-7bb2e241a0f39a2e42dee6dc3ec3773d42aabb92.tar.bz2 libxcrypt-7bb2e241a0f39a2e42dee6dc3ec3773d42aabb92.zip |
lib/crypt-port.h: Include <unistd.h> without declaring crypt prototypes.
The prototypes of the crypt{,_r}() function and struct crypt_data
possibly defined in <unistd.h> need to be renamed as they might be
incompatible with our declarations.
We achieve this by defining macros *BEFORE* including <unistd.h> at
the top of <crypt-port.h> and undefining them directly afterwards.
Defining these macros *AFTER* <crypt-symbol-vers.h>, which also
defines the same macros for symbol-versioning purposes, was included,
would lead to a clashing redefinition of this macro, and thus cause
our internal symbol-versioning would not work properly anymore.
Also drop any direct inclusion of <unistd.h> in several source files.
Fixes #110.
Diffstat (limited to 'test')
-rw-r--r-- | test/badsalt.c | 1 | ||||
-rw-r--r-- | test/crypt-badargs.c | 1 | ||||
-rw-r--r-- | test/getrandom-fallbacks.c | 3 | ||||
-rw-r--r-- | test/getrandom-interface.c | 1 |
4 files changed, 0 insertions, 6 deletions
diff --git a/test/badsalt.c b/test/badsalt.c index 803b575..2e28623 100644 --- a/test/badsalt.c +++ b/test/badsalt.c @@ -22,7 +22,6 @@ #include <stdio.h> #include <string.h> #include <sys/mman.h> -#include <unistd.h> static const char phrase[] = "values of β will give rise to dom!"; diff --git a/test/crypt-badargs.c b/test/crypt-badargs.c index 59c6690..ae69032 100644 --- a/test/crypt-badargs.c +++ b/test/crypt-badargs.c @@ -15,7 +15,6 @@ #include <string.h> #include <signal.h> #include <sys/mman.h> -#include <unistd.h> /* The behavior tested below should be consistent for all hashing methods. */ diff --git a/test/getrandom-fallbacks.c b/test/getrandom-fallbacks.c index 9f93cba..8469a2e 100644 --- a/test/getrandom-fallbacks.c +++ b/test/getrandom-fallbacks.c @@ -23,9 +23,6 @@ #ifdef HAVE_SYS_STAT_H #include <sys/stat.h> #endif -#ifdef HAVE_UNISTD_H -#include <unistd.h> -#endif /* If arc4random_buf is available, all of the fallback logic is compiled out and this test is unnecessary. If ld --wrap is not available this diff --git a/test/getrandom-interface.c b/test/getrandom-interface.c index 82be78a..e033687 100644 --- a/test/getrandom-interface.c +++ b/test/getrandom-interface.c @@ -15,7 +15,6 @@ #include <string.h> #include <signal.h> #include <sys/mman.h> -#include <unistd.h> static bool error_occurred; |