Browse Source

meson: Fix brlapi compile test for Windows builds

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>
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Reviewed-by: Michael Tokarev <mjt@tls.msk.ru>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
pull/304/head
Stefan Weil via 1 year ago
committed by Michael Tokarev
parent
commit
8c9aae4364
  1. 8
      meson.build

8
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')

Loading…
Cancel
Save