mirror of
				https://gitlab.gnome.org/GNOME/glib.git
				synced 2025-11-04 01:58:54 +01:00 
			
		
		
		
	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:
		@@ -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)
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user