mirror of
				https://gitlab.gnome.org/GNOME/glib.git
				synced 2025-10-31 08:22:16 +01:00 
			
		
		
		
	Merge branch 'cygwin-gunicollate-check-sizeof-wchar-t' into 'master'
gunicollate/cygwin: Don't use __STDC_ISO_10646__ for wchar_t related checks See merge request GNOME/glib!863
This commit is contained in:
		| @@ -20,7 +20,7 @@ | ||||
|  | ||||
| #include <locale.h> | ||||
| #include <string.h> | ||||
| #ifdef __STDC_ISO_10646__ | ||||
| #ifdef HAVE_WCHAR_H | ||||
| #include <wchar.h> | ||||
| #endif | ||||
|  | ||||
| @@ -35,9 +35,7 @@ | ||||
| #include "gstrfuncs.h" | ||||
| #include "gtestutils.h" | ||||
| #include "gcharset.h" | ||||
| #ifndef __STDC_ISO_10646__ | ||||
| #include "gconvert.h" | ||||
| #endif | ||||
|  | ||||
|  | ||||
| #ifdef _MSC_VER | ||||
| @@ -101,7 +99,7 @@ g_utf8_collate (const gchar *str1, | ||||
|   g_free (str2_utf16); | ||||
|   g_free (str1_utf16); | ||||
|  | ||||
| #elif defined(__STDC_ISO_10646__) | ||||
| #elif defined(HAVE_WCHAR_H) && SIZEOF_WCHAR_T == 4 | ||||
|  | ||||
|   gunichar *str1_norm; | ||||
|   gunichar *str2_norm; | ||||
| @@ -117,7 +115,7 @@ g_utf8_collate (const gchar *str1, | ||||
|   g_free (str1_norm); | ||||
|   g_free (str2_norm); | ||||
|  | ||||
| #else /* !__STDC_ISO_10646__ */ | ||||
| #else | ||||
|  | ||||
|   const gchar *charset; | ||||
|   gchar *str1_norm; | ||||
| @@ -154,12 +152,12 @@ g_utf8_collate (const gchar *str1, | ||||
|   g_free (str1_norm); | ||||
|   g_free (str2_norm); | ||||
|  | ||||
| #endif /* __STDC_ISO_10646__ */ | ||||
| #endif | ||||
|  | ||||
|   return result; | ||||
| } | ||||
|  | ||||
| #if defined(__STDC_ISO_10646__) | ||||
| #if defined(HAVE_WCHAR_H) && SIZEOF_WCHAR_T == 4 | ||||
| /* We need UTF-8 encoding of numbers to encode the weights if | ||||
|  * we are using wcsxfrm. However, we aren't encoding Unicode | ||||
|  * characters, so we can't simply use g_unichar_to_utf8. | ||||
| @@ -206,7 +204,7 @@ utf8_encode (char *buf, wchar_t val) | ||||
|  | ||||
|   return retval; | ||||
| } | ||||
| #endif /* __STDC_ISO_10646__ */ | ||||
| #endif | ||||
|  | ||||
| #ifdef HAVE_CARBON | ||||
|  | ||||
| @@ -382,7 +380,7 @@ g_utf8_collate_key (const gchar *str, | ||||
|   g_return_val_if_fail (str != NULL, NULL); | ||||
|   result = carbon_collate_key (str, len); | ||||
|  | ||||
| #elif defined(__STDC_ISO_10646__) | ||||
| #elif defined(HAVE_WCHAR_H) && SIZEOF_WCHAR_T == 4 | ||||
|  | ||||
|   gsize xfrm_len; | ||||
|   gunichar *str_norm; | ||||
| @@ -412,7 +410,7 @@ g_utf8_collate_key (const gchar *str, | ||||
|   g_free (str_norm); | ||||
|  | ||||
|   return result; | ||||
| #else /* !__STDC_ISO_10646__ */ | ||||
| #else | ||||
|  | ||||
|   gsize xfrm_len; | ||||
|   const gchar *charset; | ||||
| @@ -466,7 +464,7 @@ g_utf8_collate_key (const gchar *str, | ||||
|     } | ||||
|  | ||||
|   g_free (str_norm); | ||||
| #endif /* __STDC_ISO_10646__ */ | ||||
| #endif | ||||
|  | ||||
|   return result; | ||||
| } | ||||
|   | ||||
| @@ -268,6 +268,7 @@ headers = [ | ||||
|   'termios.h', | ||||
|   'unistd.h', | ||||
|   'values.h', | ||||
|   'wchar.h', | ||||
|   'xlocale.h', | ||||
| ] | ||||
|  | ||||
| @@ -1181,6 +1182,7 @@ glib_conf.set('SIZEOF_LONG_LONG', long_long_size) | ||||
| glib_conf.set('SIZEOF_SIZE_T', sizet_size) | ||||
| glib_conf.set('SIZEOF_SSIZE_T', ssizet_size) | ||||
| glib_conf.set('SIZEOF_VOID_P', voidp_size) | ||||
| glib_conf.set('SIZEOF_WCHAR_T', cc.sizeof('wchar_t', prefix: '#include <stddef.h>')) | ||||
|  | ||||
| if short_size == 2 | ||||
|   gint16 = 'short' | ||||
| @@ -2107,4 +2109,4 @@ if get_option('man') | ||||
| endif | ||||
|  | ||||
| gnome = import('gnome') | ||||
| subdir('docs/reference') | ||||
| subdir('docs/reference') | ||||
|   | ||||
		Reference in New Issue
	
	Block a user