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

check in configure.ac if unsetenv is available

Nathalie Furmento 13 éve
szülő
commit
be06e1d5de
3 módosított fájl, 6 hozzáadás és 3 törlés
  1. 3 0
      configure.ac
  2. 1 1
      tests/core/starpu_init.c
  3. 2 2
      tests/errorcheck/starpu_init_noworker.c

+ 3 - 0
configure.ac

@@ -158,6 +158,9 @@ 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.])])
 
+# Some systems do not define unsetenv
+AC_CHECK_FUNC([unsetenv], [AC_DEFINE([STARPU_HAVE_UNSETENV], [1], [Define to 1 if the function unsetenv 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
tests/core/starpu_init.c

@@ -18,7 +18,7 @@
 #include "../helper.h"
 #include <stdlib.h>
 
-#if !(defined(_BSD_SOURCE) || _POSIX_C_SOURCE >= 200112L || _XOPEN_SOURCE >= 600)
+#if !defined(STARPU_HAVE_UNSETENV)
 #warning unsetenv is not defined. Skipping test
 int main(int argc, char **argv)
 {

+ 2 - 2
tests/errorcheck/starpu_init_noworker.c

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2009, 2010  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
  *
  * StarPU is free software; you can redistribute it and/or modify
  * it under the terms of the GNU Lesser General Public License as published by
@@ -21,7 +21,7 @@
 #include <starpu.h>
 #include <stdlib.h>
 
-#if !(defined(_BSD_SOURCE) || _POSIX_C_SOURCE >= 200112L || _XOPEN_SOURCE >= 600)
+#if !defined(STARPU_HAVE_UNSETENV)
 #warning unsetenv is not defined. Skipping test
 #include "../helper.h"
 int main(int argc, char **argv)