src/psl.c: Fix build on Visual Studio
Visual Studio does not come with unistd.h, so only include it when we have HAVE_UNISTD_H. It also does not like including locale.h within main() for some reason, so include that with the other system headers.
This commit is contained in:
parent
9620b13374
commit
5f85085d76
|
@ -32,10 +32,14 @@
|
|||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#include <unistd.h>
|
||||
#ifdef HAVE_UNISTD_H
|
||||
# include <unistd.h>
|
||||
#endif
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <ctype.h>
|
||||
#include <locale.h>
|
||||
|
||||
#include <libpsl.h>
|
||||
|
||||
|
@ -78,7 +82,6 @@ int main(int argc, const char *const *argv)
|
|||
psl_ctx_t *psl = (psl_ctx_t *) psl_latest(NULL);
|
||||
|
||||
/* set current locale according to the environment variables */
|
||||
#include <locale.h>
|
||||
setlocale(LC_ALL, "");
|
||||
|
||||
for (arg = argv + 1; arg < argv + argc; arg++) {
|
||||
|
|
Loading…
Reference in New Issue