more build fixes for Windows
authorLuke Howard <lukeh@padl.com>
Tue, 13 Sep 2011 05:22:38 +0000 (15:22 +1000)
committerLuke Howard <lukeh@padl.com>
Tue, 13 Sep 2011 05:28:02 +0000 (15:28 +1000)
mech_eap/gssapiP_eap.h
mech_eap/util_cred.c

index b141032..50884ec 100644 (file)
 #include <sys/param.h>
 #endif
 
+#ifdef WIN32
+#ifndef MAXHOSTNAMELEN
+# include <WinSock2.h>
+# define MAXHOSTNAMELEN NI_MAXHOST
+#endif
+#endif
+
 /* GSS headers */
 #include <gssapi/gssapi.h>
 #include <gssapi/gssapi_krb5.h>
index 0cb8a76..0479c59 100644 (file)
@@ -36,7 +36,9 @@
 
 #include "gssapiP_eap.h"
 
-#ifndef WIN32
+#ifdef WIN32
+#include <shlobj.h>
+#else
 #include <pwd.h>
 #endif
 
@@ -129,10 +131,13 @@ readStaticIdentityFile(OM_uint32 *minor,
 {
     OM_uint32 major, tmpMinor;
     FILE *fp = NULL;
-    char pwbuf[BUFSIZ], buf[BUFSIZ];
+    char buf[BUFSIZ];
     char *ccacheName;
-    struct passwd *pw = NULL, pwd;
     int i = 0;
+#ifndef WIN32
+    struct passwd *pw = NULL, pwd;
+    char pwbuf[BUFSIZ];
+#endif
 
     defaultIdentity->length = 0;
     defaultIdentity->value = NULL;