with llvm-gcc and run with a glibc <2.10.
#define Py_FORMAT_PARSETUPLE(func,p1,p2)
#endif
+/*
+ * Specify alignment on compilers that support it.
+ */
+#if defined(__GNUC__) && __GNUC__ >= 3
+#define Py_ALIGNED(x) __attribute__((aligned(x)))
+#else
+#define Py_ALIGNED(x)
+#endif
+
/* Eliminate end-of-loop code not reached warnings from SunPro C
* when using do{...}while(0) macros
*/
#ifdef HAVE_GETHOSTBYNAME_R_3_ARG
struct hostent_data data;
#else
- char buf[16384];
+ /* glibcs up to 2.10 assume that the buf argument to
+ gethostbyaddr_r is 8-byte aligned, which at least llvm-gcc
+ does not ensure. The attribute below instructs the compiler
+ to maintain this alignment. */
+ char buf[16384] Py_ALIGNED(8);
int buf_len = (sizeof buf) - 1;
int errnop;
#endif