From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.lisp.guile.devel Subject: [PATCH] Remove unneeded HAVE_POSIX conditionals Date: Sat, 22 Feb 2014 12:33:33 +0200 Message-ID: <837g8n4ete.fsf@gnu.org> References: <834n3x8o7m.fsf@gnu.org> <83y519788a.fsf@gnu.org> <871tz0d5vc.fsf@gnu.org> <83iosc76kz.fsf@gnu.org> <87vbwc72dp.fsf_-_@gnu.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1393065205 20834 80.91.229.3 (22 Feb 2014 10:33:25 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 22 Feb 2014 10:33:25 +0000 (UTC) Cc: guile-devel@gnu.org To: ludo@gnu.org (Ludovic =?iso-8859-1?Q?Court=E8s?=) Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Sat Feb 22 11:33:33 2014 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1WH9tk-0003Er-NI for guile-devel@m.gmane.org; Sat, 22 Feb 2014 11:33:32 +0100 Original-Received: from localhost ([::1]:49015 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WH9tk-0004Sz-7I for guile-devel@m.gmane.org; Sat, 22 Feb 2014 05:33:32 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:39504) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WH9tb-0004SP-Af for guile-devel@gnu.org; Sat, 22 Feb 2014 05:33:30 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WH9tU-0000q3-0Q for guile-devel@gnu.org; Sat, 22 Feb 2014 05:33:23 -0500 Original-Received: from mtaout20.012.net.il ([80.179.55.166]:35187) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WH9tT-0000py-O3; Sat, 22 Feb 2014 05:33:15 -0500 Original-Received: from conversion-daemon.a-mtaout20.012.net.il by a-mtaout20.012.net.il (HyperSendmail v2007.08) id <0N1E00I007E5ZS00@a-mtaout20.012.net.il>; Sat, 22 Feb 2014 12:33:14 +0200 (IST) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout20.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0N1E00IC67ZDJPA0@a-mtaout20.012.net.il>; Sat, 22 Feb 2014 12:33:14 +0200 (IST) In-reply-to: <87vbwc72dp.fsf_-_@gnu.org> X-012-Sender: halo1@inter.net.il X-detected-operating-system: by eggs.gnu.org: Solaris 10 X-Received-From: 80.179.55.166 X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Original-Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.devel:16904 Archived-At: This patch removes several "#ifdef HAVE_POSIX" conditionals that unnecessarily prevent useful Guile functions from showing up in the MinGW build on MS-Windows. Remove unneeded HAVE_POSIX conditionals * libguile/filesys.c (fsync, link) [__MINGW32__]: Redirect Posix functions to their Windows equivalents. (scm_chown, scm_open_fdes, scm_open, scm_close, scm_close_fdes) (scm_link, scm_chdir, set_element, fill_select_type) (get_element, retrieve_select_type, scm_select, scm_fcntl) (scm_fsync, scm_symlink, scm_readlink, scm_copy_file, scm_sendfile) (scm_dir_print, scm_dir_free): These functions are no longer wholesale ifdef'ed away if HAVE_POSIX is not defined. (scm_init_filesys): Don't ifdef away parts of the function when HAVE_POSIX is not defined. diff --git a/libguile/filesys.c b/libguile/filesys.c index aa3e671..441ced8 100644 --- a/libguile/filesys.c +++ b/libguile/filesys.c @@ -111,7 +111,12 @@ /* Some more definitions for the native Windows port. */ #ifdef __MINGW32__ -# define fsync(fd) _commit (fd) +# define fsync(fd) _commit (fd) +# define WIN32_LEAN_AND_MEAN +# include +/* FIXME: Should use 'link' module from gnulib. */ +# define link(f1,f2) CreateHardLink(f2, f1, NULL) +# define HAVE_LINK 1 #endif /* __MINGW32__ */ @@ -146,8 +151,6 @@ -#ifdef HAVE_POSIX - /* {Permissions} */ @@ -323,8 +326,6 @@ SCM_DEFINE (scm_close_fdes, "close-fdes", 1, 0, 0, } #undef FUNC_NAME -#endif /* HAVE_POSIX */ - /* {Files} */ @@ -590,7 +591,6 @@ SCM_DEFINE (scm_lstat, "lstat", 1, 0, 0, #endif /* HAVE_LSTAT */ -#ifdef HAVE_POSIX /* {Modifying Directories} */ @@ -1222,8 +1222,6 @@ SCM_DEFINE (scm_sendfile, "sendfile", 3, 1, 0, } #undef FUNC_NAME -#endif /* HAVE_POSIX */ - /* Essential procedures used in (system base compile). */ @@ -1848,7 +1846,6 @@ SCM_DEFINE (scm_closedir, "closedir", 1, 0, 0, #undef FUNC_NAME -#ifdef HAVE_POSIX static int scm_dir_print (SCM exp, SCM port, scm_print_state *pstate SCM_UNUSED) { @@ -1869,14 +1866,12 @@ scm_dir_free (SCM p) closedir ((DIR *) SCM_SMOB_DATA_1 (p)); return 0; } -#endif void scm_init_filesys () { -#ifdef HAVE_POSIX scm_tc16_dir = scm_make_smob_type ("directory", 0); scm_set_smob_free (scm_tc16_dir, scm_dir_free); scm_set_smob_print (scm_tc16_dir, scm_dir_print); @@ -1945,7 +1940,6 @@ scm_init_filesys () #ifdef FD_CLOEXEC scm_c_define ("FD_CLOEXEC", scm_from_int (FD_CLOEXEC)); #endif -#endif /* HAVE_POSIX */ /* `access' symbols. */ scm_c_define ("R_OK", scm_from_int (R_OK));