Forráskód Böngészése

detect if malloc.h exists so that we can use memalign on various systems.

Cédric Augonnet 16 éve
szülő
commit
b11e0c4f06
3 módosított fájl, 11 hozzáadás és 0 törlés
  1. 6 0
      configure.ac
  2. 3 0
      examples/ppm-downscaler/ppm-downscaler.c
  3. 2 0
      include/starpu_config.h.in

+ 6 - 0
configure.ac

@@ -66,6 +66,12 @@ if test x$have_posix_memalign = xyes; then
 	AC_DEFINE(HAVE_POSIX_MEMALIGN,[],[posix_memalign is available])
 fi
 
+
+AC_CHECK_HEADER([malloc.h],[have_malloc_h_header=yes],[have_malloc_h_header=no])
+if test x$have_malloc_h_header = xyes; then
+	AC_DEFINE(HAVE_MALLOC_H_HEADER,[],[malloc.h header is available])
+fi
+
 # This defines HAVE_SYNC_BUILTINS
 STARPU_CHECK_SYNC_BUILTINS
 

+ 3 - 0
examples/ppm-downscaler/ppm-downscaler.c

@@ -18,7 +18,10 @@
 
 #include <starpu.h>
 
+#ifdef HAVE_MALLOC_H_HEADER
 #include <malloc.h>
+#endif
+#include <stdlib.h>
 #include <assert.h>
 #include <stdio.h>
 

+ 2 - 0
include/starpu_config.h.in

@@ -19,6 +19,8 @@
 
 #undef HAVE_POSIX_MEMALIGN
 
+#undef HAVE_MALLOC_H_HEADER
+
 #undef HAVE_SYNC_BUILTINS
 
 #undef MODEL_DEBUG