mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-07-21 17:37:53 +02:00
Require C90 compliance
Assume all supported platforms implement C90, and therefore they (correctly) implement atexit(), memmove(), setlocale(), strerror(), and vprintf(), and have <float.h> and <limits.h>. (Also remove the configure check testing that "do ... while (0)" works correctly; the non-do/while-based version of G_STMT_START and G_STMT_END was removed years ago, but the check remained. Also, remove some checks that configure.ac claimed were needed for libcharset, but aren't actually used.) Note that removing the g_memmove() function is not an ABI break even on systems where g_memmove() was previously not a macro, because it was never marked GLIB_AVAILABLE_IN_ALL or listed in glib.symbols, so it would have been glib-internal since 2004. https://bugzilla.gnome.org/show_bug.cgi?id=710519
This commit is contained in:
@@ -172,7 +172,6 @@ _glib_get_dll_directory (void)
|
||||
|
||||
#endif
|
||||
|
||||
#if !defined (HAVE_MEMMOVE) && !defined (HAVE_WORKING_BCOPY)
|
||||
/**
|
||||
* g_memmove:
|
||||
* @dest: the destination address to copy the bytes to.
|
||||
@@ -182,37 +181,8 @@ _glib_get_dll_directory (void)
|
||||
* Copies a block of memory @len bytes long, from @src to @dest.
|
||||
* The source and destination areas may overlap.
|
||||
*
|
||||
* In order to use this function, you must include
|
||||
* <filename>string.h</filename> yourself, because this macro will
|
||||
* typically simply resolve to memmove() and GLib does not include
|
||||
* <filename>string.h</filename> for you.
|
||||
* Deprecated:2.40: Just use memmove().
|
||||
*/
|
||||
void
|
||||
g_memmove (gpointer dest,
|
||||
gconstpointer src,
|
||||
gulong len)
|
||||
{
|
||||
gchar* destptr = dest;
|
||||
const gchar* srcptr = src;
|
||||
if (src + len < dest || dest + len < src)
|
||||
{
|
||||
bcopy (src, dest, len);
|
||||
return;
|
||||
}
|
||||
else if (dest <= src)
|
||||
{
|
||||
while (len--)
|
||||
*(destptr++) = *(srcptr++);
|
||||
}
|
||||
else
|
||||
{
|
||||
destptr += len;
|
||||
srcptr += len;
|
||||
while (len--)
|
||||
*(--destptr) = *(--srcptr);
|
||||
}
|
||||
}
|
||||
#endif /* !HAVE_MEMMOVE && !HAVE_WORKING_BCOPY */
|
||||
|
||||
#ifdef G_OS_WIN32
|
||||
#undef g_atexit
|
||||
@@ -259,29 +229,13 @@ void
|
||||
g_atexit (GVoidFunc func)
|
||||
{
|
||||
gint result;
|
||||
const gchar *error = NULL;
|
||||
|
||||
/* keep this in sync with glib.h */
|
||||
|
||||
#ifdef G_NATIVE_ATEXIT
|
||||
result = ATEXIT (func);
|
||||
if (result)
|
||||
error = g_strerror (errno);
|
||||
#elif defined (HAVE_ATEXIT)
|
||||
result = atexit ((void (*)(void)) func);
|
||||
if (result)
|
||||
error = g_strerror (errno);
|
||||
#elif defined (HAVE_ON_EXIT)
|
||||
result = on_exit ((void (*)(int, void *)) func, NULL);
|
||||
if (result)
|
||||
error = g_strerror (errno);
|
||||
#else
|
||||
result = 0;
|
||||
error = "no implementation";
|
||||
#endif /* G_NATIVE_ATEXIT */
|
||||
|
||||
if (error)
|
||||
g_error ("Could not register atexit() function: %s", error);
|
||||
{
|
||||
g_error ("Could not register atexit() function: %s",
|
||||
g_strerror (errno));
|
||||
}
|
||||
}
|
||||
|
||||
/* Based on execvp() from GNU Libc.
|
||||
|
Reference in New Issue
Block a user