mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-05-03 05:20:16 +02:00
(truncate): Conditionalize on "HAVE_FTRUNCATE && ! HAVE_TRUNCATE" so
as not to hard-code mingw.
This commit is contained in:
parent
3527bdc71b
commit
f3dbe1aff3
1 changed files with 4 additions and 3 deletions
|
@ -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),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue