Fix crypt.cpp sanitizer test on FreeBSD

FreeBSD doesn't provide a crypt.h header but instead defines the functions
in unistd.h. Use __has_include() to handle that case.

Reviewed By: #sanitizers, vitalybuka

Differential Revision: https://reviews.llvm.org/D85406
This commit is contained in:
Alex Richardson 2020-08-24 18:55:29 +01:00
parent 5695fa9190
commit 39d2506461
1 changed files with 2 additions and 0 deletions

View File

@ -6,7 +6,9 @@
#include <assert.h>
#include <unistd.h>
#include <cstring>
#if __has_include(<crypt.h>)
#include <crypt.h>
#endif
int
main (int argc, char** argv)