From f3dbe1aff3b462ed35a300feb13f5dbe543e87fe Mon Sep 17 00:00:00 2001 From: Kevin Ryde Date: Thu, 28 Sep 2006 01:05:55 +0000 Subject: [PATCH] (truncate): Conditionalize on "HAVE_FTRUNCATE && ! HAVE_TRUNCATE" so as not to hard-code mingw. --- libguile/ports.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/libguile/ports.c b/libguile/ports.c index 3d2e746e5..c547ae5c6 100644 --- a/libguile/ports.c +++ b/libguile/ports.c @@ -1422,8 +1422,9 @@ SCM_DEFINE (scm_seek, "seek", 3, 0, 0, } #undef FUNC_NAME -#ifdef __MINGW32__ -/* Define this function since it is not supported under Windows. */ +/* Mingw has ftruncate(), perhaps implemented above using chsize, but + doesn't have the filename version truncate(), hence this code. */ +#if HAVE_FTRUNCATE && ! HAVE_TRUNCATE static int truncate (char *file, int length) { int ret = -1, fdes; @@ -1434,7 +1435,7 @@ static int truncate (char *file, int length) } return ret; } -#endif /* __MINGW32__ */ +#endif /* HAVE_FTRUNCATE && ! HAVE_TRUNCATE */ SCM_DEFINE (scm_truncate_file, "truncate-file", 1, 1, 0, (SCM object, SCM length),