summary refs log tree commit diff
path: root/Src
diff options
context:
space:
mode:
Diffstat (limited to 'Src')
-rw-r--r--Src/system.h10
-rw-r--r--Src/utils.c6
2 files changed, 13 insertions, 3 deletions
diff --git a/Src/system.h b/Src/system.h
index 42a5f1197..c9e1a5a27 100644
--- a/Src/system.h
+++ b/Src/system.h
@@ -89,6 +89,16 @@ char *alloca _((size_t));
 # include <unistd.h>
 #endif
 
+#ifdef HAVE_STDDEF_H
+/*
+ * Seen on Solaris 8 with gcc: stddef defines offsetof, which clashes
+ * with system.h's definition of the symbol unless we include this
+ * first.  Otherwise, this will be hooked in by wchar.h, too late
+ * for comfort.
+ */
+#include <stddef.h>
+#endif
+
 #include <stdio.h>
 #include <ctype.h>
 #include <sys/stat.h>
diff --git a/Src/utils.c b/Src/utils.c
index 57a5e6771..6671c62d9 100644
--- a/Src/utils.c
+++ b/Src/utils.c
@@ -3395,8 +3395,8 @@ getkeystring(char *s, int *len, int fromwhere, int *misc)
 		for (i=(*s == 'u' ? 4 : 8); i>0; i--) {
 		    if (*++s && idigit(*s))
 		        wval = wval * 16 + (*s - '0');
-		    else if (*s && (*s >= 'a' && *s <= 'f') ||
-		            (*s >= 'A' && *s <= 'F'))
+		    else if (*s && ((*s >= 'a' && *s <= 'f') ||
+				    (*s >= 'A' && *s <= 'F')))
 		        wval = wval * 16 + (*s & 0x1f) + 9;
 		    else {
 		    	s--;
@@ -3430,7 +3430,7 @@ getkeystring(char *s, int *len, int fromwhere, int *misc)
 		    *len = t - buf;
 		    return buf;
 		}
-                iconv(cd, &inptr, &inbytes, &outptr, &outbytes);
+                iconv(cd, (const char **)&inptr, &inbytes, &outptr, &outbytes);
 		iconv_close(cd);
 		count = wctomb(t, *outbuf);
 #endif