Proper implementations have offsetof in stddef.h
Signed-off-by: NeilBrown <neilb@suse.de>
#include "mdadm.h"
#include "dlink.h"
#include <sys/mman.h>
+#include <stddef.h>
#include <stdint.h>
#include <signal.h>
#include <sys/wait.h>
#include "md_u.h"
#include "md_p.h"
-#ifndef offsetof
-#define offsetof(t,f) ((size_t)&(((t*)0)->f))
-#endif
-
int restore_backup(struct supertype *st,
struct mdinfo *content,
int working_disks,
#include "mdmon.h"
#include "sha1.h"
#include <values.h>
+#include <stddef.h>
/* a non-official T10 name for creation GUIDs */
static char T10[] = "Linux-MD";
char *name, char *homehost,
int *uuid, unsigned long long data_offset);
-#ifndef offsetof
-#define offsetof(t,f) ((size_t)&(((t*)0)->f))
-#endif
-
#if DEBUG
static void pr_state(struct ddf_super *ddf, const char *msg)
{
* Email: <neilb@suse.de>
*/
+#include <stddef.h>
#include "mdadm.h"
/*
* The version-1 superblock :
|MD_FEATURE_NEW_OFFSET \
)
-#ifndef offsetof
-#define offsetof(t,f) ((size_t)&(((t*)0)->f))
-#endif
static unsigned int calc_sb_1_csum(struct mdp_superblock_1 * sb)
{
unsigned int disk_csum, csum;