mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-02-10 12:55:48 +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:
commit
73f8ff82ed
@ -20,7 +20,7 @@
|
|||||||
|
|
||||||
#include <locale.h>
|
#include <locale.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#ifdef __STDC_ISO_10646__
|
#ifdef HAVE_WCHAR_H
|
||||||
#include <wchar.h>
|
#include <wchar.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -35,9 +35,7 @@
|
|||||||
#include "gstrfuncs.h"
|
#include "gstrfuncs.h"
|
||||||
#include "gtestutils.h"
|
#include "gtestutils.h"
|
||||||
#include "gcharset.h"
|
#include "gcharset.h"
|
||||||
#ifndef __STDC_ISO_10646__
|
|
||||||
#include "gconvert.h"
|
#include "gconvert.h"
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
@ -101,7 +99,7 @@ g_utf8_collate (const gchar *str1,
|
|||||||
g_free (str2_utf16);
|
g_free (str2_utf16);
|
||||||
g_free (str1_utf16);
|
g_free (str1_utf16);
|
||||||
|
|
||||||
#elif defined(__STDC_ISO_10646__)
|
#elif defined(HAVE_WCHAR_H) && SIZEOF_WCHAR_T == 4
|
||||||
|
|
||||||
gunichar *str1_norm;
|
gunichar *str1_norm;
|
||||||
gunichar *str2_norm;
|
gunichar *str2_norm;
|
||||||
@ -117,7 +115,7 @@ g_utf8_collate (const gchar *str1,
|
|||||||
g_free (str1_norm);
|
g_free (str1_norm);
|
||||||
g_free (str2_norm);
|
g_free (str2_norm);
|
||||||
|
|
||||||
#else /* !__STDC_ISO_10646__ */
|
#else
|
||||||
|
|
||||||
const gchar *charset;
|
const gchar *charset;
|
||||||
gchar *str1_norm;
|
gchar *str1_norm;
|
||||||
@ -154,12 +152,12 @@ g_utf8_collate (const gchar *str1,
|
|||||||
g_free (str1_norm);
|
g_free (str1_norm);
|
||||||
g_free (str2_norm);
|
g_free (str2_norm);
|
||||||
|
|
||||||
#endif /* __STDC_ISO_10646__ */
|
#endif
|
||||||
|
|
||||||
return result;
|
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 need UTF-8 encoding of numbers to encode the weights if
|
||||||
* we are using wcsxfrm. However, we aren't encoding Unicode
|
* we are using wcsxfrm. However, we aren't encoding Unicode
|
||||||
* characters, so we can't simply use g_unichar_to_utf8.
|
* characters, so we can't simply use g_unichar_to_utf8.
|
||||||
@ -206,7 +204,7 @@ utf8_encode (char *buf, wchar_t val)
|
|||||||
|
|
||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
#endif /* __STDC_ISO_10646__ */
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_CARBON
|
#ifdef HAVE_CARBON
|
||||||
|
|
||||||
@ -382,7 +380,7 @@ g_utf8_collate_key (const gchar *str,
|
|||||||
g_return_val_if_fail (str != NULL, NULL);
|
g_return_val_if_fail (str != NULL, NULL);
|
||||||
result = carbon_collate_key (str, len);
|
result = carbon_collate_key (str, len);
|
||||||
|
|
||||||
#elif defined(__STDC_ISO_10646__)
|
#elif defined(HAVE_WCHAR_H) && SIZEOF_WCHAR_T == 4
|
||||||
|
|
||||||
gsize xfrm_len;
|
gsize xfrm_len;
|
||||||
gunichar *str_norm;
|
gunichar *str_norm;
|
||||||
@ -412,7 +410,7 @@ g_utf8_collate_key (const gchar *str,
|
|||||||
g_free (str_norm);
|
g_free (str_norm);
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
#else /* !__STDC_ISO_10646__ */
|
#else
|
||||||
|
|
||||||
gsize xfrm_len;
|
gsize xfrm_len;
|
||||||
const gchar *charset;
|
const gchar *charset;
|
||||||
@ -466,7 +464,7 @@ g_utf8_collate_key (const gchar *str,
|
|||||||
}
|
}
|
||||||
|
|
||||||
g_free (str_norm);
|
g_free (str_norm);
|
||||||
#endif /* __STDC_ISO_10646__ */
|
#endif
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
@ -268,6 +268,7 @@ headers = [
|
|||||||
'termios.h',
|
'termios.h',
|
||||||
'unistd.h',
|
'unistd.h',
|
||||||
'values.h',
|
'values.h',
|
||||||
|
'wchar.h',
|
||||||
'xlocale.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_SIZE_T', sizet_size)
|
||||||
glib_conf.set('SIZEOF_SSIZE_T', ssizet_size)
|
glib_conf.set('SIZEOF_SSIZE_T', ssizet_size)
|
||||||
glib_conf.set('SIZEOF_VOID_P', voidp_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
|
if short_size == 2
|
||||||
gint16 = 'short'
|
gint16 = 'short'
|
||||||
|
Loading…
x
Reference in New Issue
Block a user