[commit: packages/unix] master: Simplify code via AC_USE_SYSTEM_EXTENSIONS (5740003)

git at git.haskell.org git at git.haskell.org
Tue Apr 19 21:37:16 UTC 2016


Repository : ssh://git@git.haskell.org/unix

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/5740003e06f0c585460501514f3352f5e105c98c/unix

>---------------------------------------------------------------

commit 5740003e06f0c585460501514f3352f5e105c98c
Author: Herbert Valerio Riedel <hvr at gnu.org>
Date:   Thu Dec 3 22:25:13 2015 +0100

    Simplify code via AC_USE_SYSTEM_EXTENSIONS
    
    `AC_USE_SYSTEM_EXTENSIONS` takes care of defining feature_test_macros(7)
    thereby allowing us to remove a few manual `#define`s


>---------------------------------------------------------------

5740003e06f0c585460501514f3352f5e105c98c
 cbits/dirUtils.c  | 11 -----------
 cbits/execvpe.c   |  4 ----
 configure.ac      |  3 +++
 include/HsUnix.h  |  4 ----
 include/execvpe.h |  1 -
 5 files changed, 3 insertions(+), 20 deletions(-)

diff --git a/cbits/dirUtils.c b/cbits/dirUtils.c
index 6fc0830..0a645eb 100644
--- a/cbits/dirUtils.c
+++ b/cbits/dirUtils.c
@@ -4,17 +4,6 @@
  * Directory Runtime Support
  */
 
-/* needed only for solaris2_HOST_OS */
-#ifdef __GLASGOW_HASKELL__
-#include "ghcconfig.h"
-#endif
-
-// The following is required on Solaris to force the POSIX versions of
-// the various _r functions instead of the Solaris versions.
-#ifdef solaris2_HOST_OS
-#define _POSIX_PTHREAD_SEMANTICS
-#endif
-
 #include "HsUnix.h"
 
 /*
diff --git a/cbits/execvpe.c b/cbits/execvpe.c
index c27bca9..82e1bdc 100644
--- a/cbits/execvpe.c
+++ b/cbits/execvpe.c
@@ -11,10 +11,6 @@
 
 #include "HsUnixConfig.h"
 
-#if HAVE_EXECVPE
-# define _GNU_SOURCE
-#endif
-
 #include <errno.h>
 #include <sys/types.h>
 #if HAVE_SYS_WAIT_H
diff --git a/configure.ac b/configure.ac
index c63b45b..8738680 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,8 +1,11 @@
 AC_INIT([Haskell unix package], [2.0], [libraries at haskell.org], [unix])
+AC_PREREQ([2.60])
 
 # Safety check: Ensure that we are in the correct source directory.
 AC_CONFIG_SRCDIR([include/HsUnix.h])
 
+AC_USE_SYSTEM_EXTENSIONS
+
 AC_ARG_WITH([cc],
             [C compiler],
             [CC=$withval])
diff --git a/include/HsUnix.h b/include/HsUnix.h
index ba3e053..cfdddb4 100644
--- a/include/HsUnix.h
+++ b/include/HsUnix.h
@@ -19,10 +19,6 @@
 #undef PACKAGE_TARNAME
 #undef PACKAGE_VERSION
 
-#ifdef solaris2_HOST_OS
-#define _POSIX_PTHREAD_SEMANTICS
-#endif
-
 #include <stdlib.h>
 #include <stdio.h>
 
diff --git a/include/execvpe.h b/include/execvpe.h
index 1fd2fbb..63cd042 100644
--- a/include/execvpe.h
+++ b/include/execvpe.h
@@ -14,7 +14,6 @@ __hsunix_execvpe(const char *name, char *const argv[], char *const envp[]);
 #ifndef HSUNIX_EXECVPE_H_NO_COMPAT
 #include "HsUnixConfig.h"
 #if HAVE_EXECVPE
-# define _GNU_SOURCE
 # include <unistd.h>
 extern int
 execvpe(const char *name, char *const argv[], char *const envp[]);



More information about the ghc-commits mailing list