This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
[PATCH COMMITTED] nss_dns: Remove custom offsetof macro definition
- From: Florian Weimer <fweimer at redhat dot com>
- To: GNU C Library <libc-alpha at sourceware dot org>
- Date: Wed, 27 Apr 2016 16:55:22 +0200
- Subject: [PATCH COMMITTED] nss_dns: Remove custom offsetof macro definition
- Authentication-results: sourceware.org; auth=none
Added #include <stddef.h> to be on the safe side regarding availability
of offsetof.
Florian
2016-04-27 Florian Weimer <fweimer@redhat.com>
* resolv/nss_dns/dns-network.c (offsetof): Remove macro
definition. Include <stddef.h> instead.
diff --git a/resolv/nss_dns/dns-network.c b/resolv/nss_dns/dns-network.c
index 8f301a7..99ec755 100644
--- a/resolv/nss_dns/dns-network.c
+++ b/resolv/nss_dns/dns-network.c
@@ -62,6 +62,7 @@
#include <stdlib.h>
#include <string.h>
#include <stdint.h>
+#include <stddef.h>
#include "nsswitch.h"
#include <arpa/inet.h>
@@ -234,9 +235,6 @@ _nss_dns_getnetbyaddr_r (uint32_t net, int type, struct netent *result,
}
-#undef offsetof
-#define offsetof(Type, Member) ((size_t) &((Type *) NULL)->Member)
-
static enum nss_status
getanswer_r (const querybuf *answer, int anslen, struct netent *result,
char *buffer, size_t buflen, int *errnop, int *h_errnop,