1
1

Work around structure size / packing issue on 64 bit Intel Mac builds. Long

comment explaining the patch in the patch.

Refs trac:574

This commit was SVN r13276.

The following Trac tickets were found above:
  Ticket 574 --> https://svn.open-mpi.org/trac/ompi/ticket/574
Этот коммит содержится в:
Brian Barrett 2007-01-24 17:31:49 +00:00
родитель 6919ccfd2b
Коммит 4e990ac0e9

Просмотреть файл

@ -41,15 +41,22 @@
#include <arpa/inet.h>
#endif
#ifdef HAVE_NET_IF_H
#if defined(__APPLE__) && defined(__POWERPC__) && defined(_LP64)
/* Apple engineering suggested this as a workaround for a bug in OS X
* 10.4 (Tiger) that prevented ioctl(..., SIOCGIFCONF, ...) from
* working properly in 64 bit mode */
#pragma options align=power
#if defined(__APPLE__) && defined(_LP64)
/* Apple engineering suggested using options align=power as a
workaround for a bug in OS X 10.4 (Tiger) that prevented ioctl(...,
SIOCGIFCONF, ...) from working properly in 64 bit mode on Power PC.
It turns out that the underlying issue is the size of struct
ifconf, which the kernel expects to be 12 and natural 64 bit
alignment would make 16. The same bug appears in 64 bit mode on
Intel macs, but align=power is a no-op there, so instead, use the
pack pragma to instruct the compiler to pack on 4 byte words, which
has the same effect as align=power for our needs and works on both
Intel and Power PC Macs. */
#pragma pack(push,4)
#endif
#include <net/if.h>
#if defined(__APPLE__) && defined(__POWERPC__) && defined(_LP64)
#pragma options align=reset
#if defined(__APPLE__) && defined(_LP64)
#pragma pack(pop)
#endif
#endif
#ifdef HAVE_NETDB_H