qemu-trivial.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Huth <thuth@redhat.com>
To: "Stefan Weil" <sw@weilnetz.de>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"Marc-André Lureau" <marcandre.lureau@redhat.com>,
	"Philippe Mathieu-Daudé" <philmd@linaro.org>,
	"Daniel P . Berrangé" <berrange@redhat.com>,
	"Samuel Thibault" <samuel.thibault@ens-lyon.org>
Cc: qemu-devel@nongnu.org, qemu-trivial@nongnu.org
Subject: Re: [PATCH for-10.1] meson: Fix brlapi compile test for Windows builds
Date: Mon, 18 Aug 2025 10:04:39 +0200	[thread overview]
Message-ID: <d1e64b7c-79cf-4a0b-8166-819c05c23111@redhat.com> (raw)
In-Reply-To: <20250806204624.510091-1-sw@weilnetz.de>

On 06/08/2025 22.45, Stefan Weil via wrote:
> brlapi__openConnection returns a brlapi_fileDescriptor which is a pointer
> for Windows builds.
> 
> The test for brlapi fails with cross builds on Debian trixie
> (x86_64-w64-mingw32-gcc (GCC) 14-win32):
> 
> testfile.c:4:30: error: returning 'brlapi_fileDescriptor' {aka 'void *'} from a function with return type 'int' makes integer from pointer without a cast [-Wint-conversion]
>      4 |      int main(void) { return brlapi__openConnection (NULL, NULL, NULL); }
>        |                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> -----------
> ../../../meson.build:1607: WARNING: could not link brlapi, disabling
> 
> Signed-off-by: Stefan Weil <sw@weilnetz.de>
> ---
> 
> I think that this patch is trivial because it does not change
> anything for Linux.
> 
> Note that this patch only fixes the configure test and allows builds
> with the Braille API for Windows.
> 
> A similar change can be applied to chardev/baum.c and will be sent
> separately because it is not required for 10.1.
> 
> Note that for 64 bit Windows there is an issue because brlapi_fileDescriptor
> is a 64 bit pointer while QEMU assumes int for file descriptors. But the
> good news is that the resulting code seems to work nevertheless – at least
> the people who asked me for Braille support on Windows are satisfied as
> far as I know.
> 
> Regards,
> Stefan W.
> 
> 
>   meson.build | 8 +++++---
>   1 file changed, 5 insertions(+), 3 deletions(-)
> 
> diff --git a/meson.build b/meson.build
> index e53cd5b413..d6abe1917e 100644
> --- a/meson.build
> +++ b/meson.build
> @@ -1586,9 +1586,11 @@ if not get_option('brlapi').auto() or have_system
>     brlapi = cc.find_library('brlapi', has_headers: ['brlapi.h'],
>                            required: get_option('brlapi'))
>     if brlapi.found() and not cc.links('''
> -     #include <brlapi.h>
> -     #include <stddef.h>
> -     int main(void) { return brlapi__openConnection (NULL, NULL, NULL); }''', dependencies: brlapi)
> +    #include <brlapi.h>
> +    #include <stddef.h>
> +    int main(void) {
> +      return brlapi__openConnection(NULL, NULL, NULL) == BRLAPI_INVALID_FILE_DESCRIPTOR;
> +    }''', dependencies: brlapi)
>       brlapi = not_found
>       if get_option('brlapi').enabled()
>         error('could not link brlapi')

Reviewed-by: Thomas Huth <thuth@redhat.com>



      parent reply	other threads:[~2025-08-18  8:05 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-06 20:45 [PATCH for-10.1] meson: Fix brlapi compile test for Windows builds Stefan Weil via
2025-08-06 20:52 ` Pierrick Bouvier
2025-08-18  8:04 ` Thomas Huth [this message]

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=d1e64b7c-79cf-4a0b-8166-819c05c23111@redhat.com \
    --to=thuth@redhat.com \
    --cc=berrange@redhat.com \
    --cc=marcandre.lureau@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=philmd@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-trivial@nongnu.org \
    --cc=samuel.thibault@ens-lyon.org \
    --cc=sw@weilnetz.de \
    /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 NNTP newsgroup(s).