[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
getlogin_r on mingw
From: |
Bruno Haible |
Subject: |
getlogin_r on mingw |
Date: |
Sat, 17 Dec 2016 12:08:16 +0100 |
User-agent: |
KMail/4.8.5 (Linux/3.8.0-44-generic; KDE/4.8.5; x86_64; ; ) |
I'm seeing this compilation failure on a recent mingw:
../../gltests/test-getlogin_r.c:31:17: fatal error: pwd.h: No such file or
directory
compilation terminated.
make[4]: *** [Makefile:7987: test-getlogin_r.o] Error 1
This fixes it:
2016-12-17 Bruno Haible <address@hidden>
getlogin_r tests: Port to mingw.
* tests/test-getlogin_r.c: Don't include <pwd.h> on native Windows.
Fixes
regression introduced on 2014-05-19.
diff --git a/tests/test-getlogin_r.c b/tests/test-getlogin_r.c
index 94e7ec7..7104d6a 100644
--- a/tests/test-getlogin_r.c
+++ b/tests/test-getlogin_r.c
@@ -28,7 +28,9 @@ SIGNATURE_CHECK (getlogin_r, int, (char *, size_t));
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
-#include <pwd.h>
+#if !((defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__)
+# include <pwd.h>
+#endif
#include <sys/stat.h>
#include <sys/types.h>
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- getlogin_r on mingw,
Bruno Haible <=