]> code.delx.au - gnu-emacs/blobdiff - src/xrdb.c
* make-dist: Distribute some VMS files we got from Richard Levitte.
[gnu-emacs] / src / xrdb.c
index d6defba4a866cd010b77ef1f877ba0ee6f1f2559..a83cb37fe53e9c9ef9cd530b74237a08a117bfd8 100644 (file)
@@ -29,14 +29,19 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
 #endif /* USG5 */
 
 #endif /* 1 */
+
+/* This should be included before the X include files; otherwise, we get
+   warnings about redefining NULL under BSD 4.3.  */
+#include <sys/param.h>
+
 #include <X11/Xlib.h>
 #include <X11/Xatom.h>
+#if 0
 #include <X11/Xos.h>
+#endif
 #include <X11/X.h>
 #include <X11/Xutil.h>
 #include <X11/Xresource.h>
-#include <sys/param.h>
 #ifdef VMS
 #include "vms-pwd.h"
 #else
@@ -49,7 +54,15 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
 #endif
 
 extern char *getenv ();
-extern int getuid ();
+
+/* This does cause trouble on AIX.  I'm going to take the comment at
+   face value.  */
+#if 0
+extern short getuid ();                /* If this causes portability problems,
+                                  I think we should just delete it; it'll
+                                  default to `int' anyway.  */
+#endif
+
 extern struct passwd *getpwuid ();
 extern struct passwd *getpwnam ();
 
@@ -96,7 +109,7 @@ file_p (path)
 {
   struct stat status;
 
-  return (access (path, R_OK) == 0             /* exists and is readable */
+  return (access (path, 4) == 0                        /* exists and is readable */
          && stat (path, &status) == 0          /* get the status */
          && (status.st_mode & S_IFDIR) == 0);  /* not a directory */
 }
@@ -279,9 +292,12 @@ get_user_db (display)
   XrmDatabase db;
   char *xdefs;
 
-  /* Yes, I know we should probably get this using XResourceManagerString.
-     Who cares.  */
+#ifdef PBaseSize               /* Cheap way to test for X11R4 or later.  */
+  xdefs = XResourceManagerString (display);
+#else
   xdefs = display->xdefaults;
+#endif
+
   if (xdefs != NULL)
     db = XrmGetStringDatabase (xdefs);
   else
@@ -393,7 +409,7 @@ x_get_resource (rdb, name, class, expected_type, ret_value)
       && (type == expected_type))
     {
       if (type == x_rm_string)
-       (char *) ret_value->addr = value.addr;
+       ret_value->addr = (char *) value.addr;
       else
        bcopy (value.addr, ret_value->addr, ret_value->size);