bug-gnulib@gnu.org mirror (unofficial)
 help / color / mirror / Atom feed
From: Bruno Haible <bruno@clisp.org>
To: bug-gnulib@gnu.org
Subject: physmem: Fix compilation errors on MSVC
Date: Sat, 30 May 2020 10:40:30 +0200	[thread overview]
Message-ID: <4422528.eCPO1PZ79S@omega> (raw)

A testdir for module 'physmem' produces compilation errors with MSVC 14:
- It includes <unistd.h>, but this header file does not exist in MSVC.
- It uses the undefined type 'WINBOOL'.

This patch fixes it.


2020-05-30  Bruno Haible  <bruno@clisp.org>

	physmem: Fix compilation errors on MSVC.
	* lib/physmem.c (PFN_MS_EX): Use BOOL, not WINBOOL.
	* modules/physmem (Depends-on): Add unistd.

diff --git a/lib/physmem.c b/lib/physmem.c
index 76813a4..6f0c5ef 100644
--- a/lib/physmem.c
+++ b/lib/physmem.c
@@ -81,7 +81,7 @@ typedef struct
   DWORDLONG ullAvailVirtual;
   DWORDLONG ullAvailExtendedVirtual;
 } lMEMORYSTATUSEX;
-typedef WINBOOL (WINAPI *PFN_MS_EX) (lMEMORYSTATUSEX*);
+typedef BOOL (WINAPI *PFN_MS_EX) (lMEMORYSTATUSEX*);
 
 #endif
 
diff --git a/modules/physmem b/modules/physmem
index 9644522..2cb7e7f 100644
--- a/modules/physmem
+++ b/modules/physmem
@@ -7,6 +7,7 @@ lib/physmem.c
 m4/physmem.m4
 
 Depends-on:
+unistd
 
 configure.ac:
 gl_PHYSMEM



                 reply	other threads:[~2020-05-30  8:40 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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

  List information: https://lists.gnu.org/mailman/listinfo/bug-gnulib

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

  git send-email \
    --in-reply-to=4422528.eCPO1PZ79S@omega \
    --to=bruno@clisp.org \
    --cc=bug-gnulib@gnu.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).