public inbox for bzip2-devel@sourceware.org
 help / color / mirror / Atom feed
From: Dmitry Tsarevich <dimhotepus@gmail.com>
To: bzip2-devel@sourceware.org
Subject: Unable to build under Windows
Date: Sun, 20 Feb 2022 00:45:06 +0300	[thread overview]
Message-ID: <CANh+qY3iBxtgK9vk_fz4ruW-fH0HeOpY30p9P3ACUv45vhUEpg@mail.gmail.com> (raw)

Hello!

I'm trying to build bzip2 under Windows / MSVC

Unfortunately, STDERR_FILENO is *nix specific and is not defined under MSVC.

What I can suggest is to patch bzip2.c to define STDERR_FILENO under MSVC:

diff --git a/bzip2.c b/bzip2.c
index d1f2fa8..d4550a9 100644
--- a/bzip2.c
+++ b/bzip2.c
@@ -150,6 +150,8 @@
          ERROR_IF_MINUS_ONE ( retVal );               \
       } while ( 0 )

+#define STDERR_FILENO _fileno(stderr)
+
 #endif /* BZ_LCCWIN32 */

             reply	other threads:[~2022-02-19 21:45 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-19 21:45 Dmitry Tsarevich [this message]
2022-04-19 22:36 ` Mark Wielaard

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CANh+qY3iBxtgK9vk_fz4ruW-fH0HeOpY30p9P3ACUv45vhUEpg@mail.gmail.com \
    --to=dimhotepus@gmail.com \
    --cc=bzip2-devel@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).