diff lib/gftp.h @ 48:e5f6054590b5

2002-11-5 Brian Masney <masneyb@gftp.org> * lib/*.c src/gtk/*.c - removed function declarations for the static functions from the top of the file. I had to rearrange the order of a bunch of functions to avoid compiler warnings * lib/gftp.h - include sys/sysmacros.h. If major() and minor() isn't defined, give a compiler warning and define our own * lib/local.c (local_get_next_file) - if this file is a device, store the major/minor number in the file size * src/gtk/misc-gtk.c (add_file_listbox) - if this file is a device, use the major() and minor() macros to display the major and minor number
author masneyb
date Wed, 06 Nov 2002 02:20:25 +0000
parents eec25f215772
children a12bcbc2fce4
line wrap: on
line diff
--- a/lib/gftp.h	Tue Nov 05 20:36:11 2002 +0000
+++ b/lib/gftp.h	Wed Nov 06 02:20:25 2002 +0000
@@ -35,6 +35,7 @@
 #endif
 #include <sys/wait.h>
 #include <sys/utsname.h>
+#include <sys/sysmacros.h>
 #include <netinet/in.h>
 #include <arpa/inet.h>
 #include <glib.h>
@@ -76,6 +77,18 @@
 #define AF_LOCAL AF_UNIX
 #endif
 
+/* We need the major() and minor() macros in the user interface. If they aren't
+   defined by the system, we'll just define them here. */
+#ifndef major
+#warning major macro was not defined by the system. Defining one that is probably wrong for your system
+#define major(dev) (((dev) >> 8) & 0xff)
+#endif
+
+#ifndef minor
+#warning minor macro was not defined by the system. Defining one that is probably wrong for your system
+#define minor(dev) ((dev) & 0xff)
+#endif
+
 #ifdef HAVE_DMALLOC
 #include <dmalloc.h>
 #endif