This fixes #1114.
C++11 forbids declaring types inside typeof and offsetof,
so we drop the macro call and declare the struct separately
for the only use of the call.
(cherry picked from commit
d0ba0d53f2dad05d7eb3ba12f508eea3464a855f)
return NULL;
}
- pcap_t* handle = PCAP_CREATE_COMMON(errorBuffer, struct pcap_haiku);
+ struct wrapper_struct { pcap_t __common; struct pcap_haiku __private; };
+ pcap_t* handle = pcap_create_common(errorBuffer,
+ sizeof (struct wrapper_struct),
+ offsetof (struct wrapper_struct, __private));
+
if (handle == NULL) {
snprintf(errorBuffer, PCAP_ERRBUF_SIZE, "malloc: %s", strerror(errno));
close(socket);