Fix Windows compilation (#2506)

* docs: Fix Windows compile instructions

Signed-off-by: Naoki Ikeguchi <me@s6n.jp>

* fix: Use fallocate stub on MSYS2

Signed-off-by: Naoki Ikeguchi <me@s6n.jp>

---------

Signed-off-by: Naoki Ikeguchi <me@s6n.jp>
This commit is contained in:
Naoki Ikeguchi 2024-07-27 09:54:38 +09:00 committed by GitHub
parent fcb5aa77fb
commit 4fe2652c6c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 3 deletions

View File

@ -68,7 +68,7 @@ On Windows, use [MSYS2](https://www.msys2.org/) to compile for itself.
2. Install dependencies onto MSYS2: 2. Install dependencies onto MSYS2:
```sh ```sh
pacman -S git autoconf automake gcc make pkg-config libopenssl-devel libcurl-devel libxml2-devel libzstd-devel pacman -S git autoconf automake gcc make pkg-config openssl-devel libcurl-devel libxml2-devel libzstd-devel
``` ```
3. Clone this repository, then change directory into the cloned one. 3. Clone this repository, then change directory into the cloned one.
@ -101,7 +101,7 @@ On Windows, use [MSYS2](https://www.msys2.org/) to compile for itself.
```sh ```sh
./autogen.sh ./autogen.sh
PKG_CONFIG_PATH="$PKG_CONFIG_PATH:$(pwd)" ./configure PKG_CONFIG_PATH="$PKG_CONFIG_PATH:$(pwd)" ./configure
make make CXXFLAGS="-I/usr/include"
``` ```
7. Copy binary files to distribute at one place: 7. Copy binary files to distribute at one place:

View File

@ -2427,7 +2427,7 @@ int FdEntity::UploadPendingHasLock(int fd)
// For systems where the fallocate function cannot be detected, use a dummy function. // For systems where the fallocate function cannot be detected, use a dummy function.
// ex. OSX // ex. OSX
// //
#ifndef HAVE_FALLOCATE #if !defined(HAVE_FALLOCATE) || defined(__MSYS__)
static int fallocate(int /*fd*/, int /*mode*/, off_t /*offset*/, off_t /*len*/) static int fallocate(int /*fd*/, int /*mode*/, off_t /*offset*/, off_t /*len*/)
{ {
errno = ENOSYS; // This is a bad idea, but the caller can handle it simply. errno = ENOSYS; // This is a bad idea, but the caller can handle it simply.