1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-03 13:20:26 +02:00

(truncate): Conditionalize on "HAVE_FTRUNCATE && ! HAVE_TRUNCATE" so

as not to hard-code mingw.
This commit is contained in:
Kevin Ryde 2006-09-28 01:05:55 +00:00
parent 3527bdc71b
commit f3dbe1aff3

View file

@ -1422,8 +1422,9 @@ SCM_DEFINE (scm_seek, "seek", 3, 0, 0,
} }
#undef FUNC_NAME #undef FUNC_NAME
#ifdef __MINGW32__ /* Mingw has ftruncate(), perhaps implemented above using chsize, but
/* Define this function since it is not supported under Windows. */ doesn't have the filename version truncate(), hence this code. */
#if HAVE_FTRUNCATE && ! HAVE_TRUNCATE
static int truncate (char *file, int length) static int truncate (char *file, int length)
{ {
int ret = -1, fdes; int ret = -1, fdes;
@ -1434,7 +1435,7 @@ static int truncate (char *file, int length)
} }
return ret; return ret;
} }
#endif /* __MINGW32__ */ #endif /* HAVE_FTRUNCATE && ! HAVE_TRUNCATE */
SCM_DEFINE (scm_truncate_file, "truncate-file", 1, 1, 0, SCM_DEFINE (scm_truncate_file, "truncate-file", 1, 1, 0,
(SCM object, SCM length), (SCM object, SCM length),