build: workaround compiler warning in meson detection of __uint128_t

Otherwise, `CFLAGS='-Wall -Werror' meson build` fails detection with:

  Code:
   int main() {
  static __uint128_t v1 = 100;
  static __uint128_t v2 = 10;
  static __uint128_t u;
  u = v1 / v2;
  }
  -----------
  Command line: `cc /data/src/glib/build/meson-private/tmp451h9ogd/testfile.c -o /data/src/glib/build/meson-private/tmp451h9ogd/output.obj -c -Werror -Wall -D_FILE_OFFSET_BITS=64 -O0 -std=gnu99` -> 1
  stderr:
  /data/src/glib/build/meson-private/tmp451h9ogd/testfile.c: In function 'main':
  /data/src/glib/build/meson-private/tmp451h9ogd/testfile.c:4:20: error: variable 'u' set but not used [-Werror=unused-but-set-variable]
      4 | static __uint128_t u;
        |                    ^
  cc1: all warnings being treated as errors
  -----------
  Checking if "__uint128_t available" compiles: NO
This commit is contained in:
Thomas Haller 2024-02-07 10:53:41 +01:00
parent d0afd2b783
commit 4bdadb6ccc

View File

@ -1023,6 +1023,7 @@ static __uint128_t v1 = 100;
static __uint128_t v2 = 10;
static __uint128_t u;
u = v1 / v2;
(void) u;
}'''
if cc.compiles(uint128_t_src, name : '__uint128_t available')
glib_conf.set('HAVE_UINT128_T', 1)