Преглед на файлове

include/starpu_util.h: configure.ac: check the availability of strerror_r in configure.ac

Nathalie Furmento преди 13 години
родител
ревизия
9c958b5da5
променени са 2 файла, в които са добавени 5 реда и са изтрити 2 реда
  1. 4 1
      configure.ac
  2. 1 1
      include/starpu_util.h

+ 4 - 1
configure.ac

@@ -1,7 +1,7 @@
 # StarPU --- Runtime system for heterogeneous multicore architectures.
 #
 # Copyright (C) 2009, 2010, 2011  Université de Bordeaux 1
-# Copyright (C) 2010, 2011  Centre National de la Recherche Scientifique
+# Copyright (C) 2010, 2011, 2012  Centre National de la Recherche Scientifique
 # Copyright (C) 2011  Télécom-SudParis
 # Copyright (C) 2011  Institut National de Recherche en Informatique et Automatique
 #
@@ -139,6 +139,9 @@ else
   AC_DEFINE([starpu_erand48_r(xsubi, buffer, result)],[do {*(result) = ((double)(rand()) / RAND_MAX);} while (0);],[erand48_r equivalent function])
 fi
 
+# Some systems do not define strerror_r
+AC_CHECK_FUNC([strerror_r], [AC_DEFINE([STARPU_HAVE_STRERROR_R], [1], [Define to 1 if the function strerro_r is available.])])
+
 # Define slow machine
 AC_ARG_ENABLE(slow-machine, [AS_HELP_STRING([--enable-slow-machine],
 				   [Lower default values for the testcases run by make check])],

+ 1 - 1
include/starpu_util.h

@@ -46,7 +46,7 @@ extern "C"
 
 #define STARPU_ABORT()		abort()
 
-#if !defined(STARPU_HAVE_WINDOWS)
+#if !defined(STARPU_HAVE_STRERROR_R)
 #  define STARPU_CHECK_RETURN_VALUE(err, message) {if (err < 0) { \
 			char xmessage[256]; strerror_r(-err, xmessage, 256); \
 			fprintf(stderr, "StarPU function <%s> returned unexpected value: <%d:%s>\n", message, err, xmessage); \