2006-05-26 Martin Lambers <marlam@marlam.de>
authorSimon Josefsson <simon@josefsson.org>
Fri, 26 May 2006 10:13:59 +0000 (10:13 +0000)
committerSimon Josefsson <simon@josefsson.org>
Fri, 26 May 2006 10:13:59 +0000 (10:13 +0000)
* getpass.c: Updates the test for the native W32 API, and adds
missing includes, thus fixing compilation warnings.

lib/ChangeLog
lib/getpass.c

index a015d11..9e687ae 100644 (file)
@@ -1,3 +1,8 @@
+2006-05-26  Martin Lambers  <marlam@marlam.de>
+
+       * getpass.c: Updates the test for the native W32 API, and adds
+       missing includes, thus fixing compilation warnings.
+
 2006-05-25  Paul Eggert  <eggert@cs.ucla.edu>
 
        * tempname.c (small_open, large_open): New macros.
index f0b3184..4e33396 100644 (file)
@@ -23,7 +23,7 @@
 
 #include <stdio.h>
 
-#if !defined _WIN32
+#if !((defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__)
 
 #include <stdbool.h>
 
@@ -170,13 +170,17 @@ getpass (const char *prompt)
   return buf;
 }
 
-#else /* WIN32 */
+#else /* W32 native */
 
 /* Windows implementation by Martin Lambers <marlam@marlam.de>,
    improved by Simon Josefsson. */
 
 /* For PASS_MAX. */
 #include <limits.h>
+/* For _getch(). */
+#include <conio.h>
+/* For strdup(). */
+#include <string.h>
 
 #ifndef PASS_MAX
 # define PASS_MAX 512