summaryrefslogtreecommitdiff
path: root/Include/pyport.h
diff options
context:
space:
mode:
authorJeffrey Yasskin <jyasskin@gmail.com>2009-01-09 16:47:07 +0000
committerJeffrey Yasskin <jyasskin@gmail.com>2009-01-09 16:47:07 +0000
commitc369baafa36ca1bafbc4ec0ff6a2760dc2b89fec (patch)
tree5cba7035e92f29c864a1368179eeb8b03ea6e73a /Include/pyport.h
parenta001fde82ffaf2361c072e005f1370bb85389ce9 (diff)
downloadcpython-c369baafa36ca1bafbc4ec0ff6a2760dc2b89fec.tar.gz
Fix issue 4884, preventing a crash in the socket code when python is compiled
with llvm-gcc and run with a glibc <2.10.
Diffstat (limited to 'Include/pyport.h')
-rw-r--r--Include/pyport.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/Include/pyport.h b/Include/pyport.h
index 15c8644f56..54411f2597 100644
--- a/Include/pyport.h
+++ b/Include/pyport.h
@@ -709,6 +709,15 @@ typedef struct fd_set {
#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
*/