Index: libopenjpeg/opj_malloc.h
--- libopenjpeg/opj_malloc.h.orig	2007-12-21 11:19:01 +0100
+++ libopenjpeg/opj_malloc.h	2009-03-12 23:03:18 +0100
@@ -75,11 +75,11 @@
 #else /* Not WIN32 */
 	#if defined(__sun)
 			#define HAVE_MEMALIGN
-		#elif defined(__GNUC__)
+		#elif defined(__linux__) && defined(__GNUC__)
 			#define HAVE_MEMALIGN
-			#include <malloc.h>		
+			#include <stdlib.h>		
 		/* Linux x86_64 and OSX always align allocations to 16 bytes */
-		#elif !defined(__amd64__) && !defined(__APPLE__)	
+		#elif defined(__linux__) && !defined(__amd64__) && !defined(__APPLE__)	
 			/* FIXME: Yes, this is a big assumption */
 			#define HAVE_POSIX_MEMALIGN
 	#endif
