# define __attribute__(x)
#endif
-/* For silencing gcc warnings about rcsids */
-#ifndef __unused
-# if defined(__GNUC__) && (__GNUC__ > 2 || __GNUC__ == 2 && __GNUC_MINOR__ > 7)
-# define __unused __attribute__((__unused__))
-# else
-# define __unused
-# endif
-#endif
-
/* For catching format string mismatches */
#ifndef __printflike
# if defined(__GNUC__) && (__GNUC__ > 2 || __GNUC__ == 2 && __GNUC_MINOR__ >= 7)
# define MAX(a,b) (((a)>(b))?(a):(b))
#endif
+/*
+ * Older systems may be missing stddef.h and/or offsetof macro
+ */
+#ifndef offsetof
+# ifdef __offsetof
+# define offsetof(type, field) __offsetof(type, field)
+# else
+# define offsetof(type, field) ((size_t)(&((type *)0)->field))
+# endif
+#endif
+
/*
* Simple isblank() macro and function for systems without it.
*/
#ifndef HAVE_NANOSLEEP
int nanosleep(const struct timespec *, struct timespec *);
#endif
+#ifndef HAVE_PW_DUP
+struct passwd *pw_dup(const struct passwd *);
+#endif
#ifndef HAVE_SETENV
int setenv(const char *, const char *, int);
#endif