- Added a g_memmove function for SunOS compatability.

- Disabled unused gldouble definitions which were a portability problem

                                        - owt
This commit is contained in:
Owen Taylor
1997-12-02 21:03:14 +00:00
parent a95ad0a897
commit 8fc5d3586a
13 changed files with 123 additions and 16 deletions

View File

@ -63,7 +63,8 @@ AC_CHECK_SIZEOF(long)
AC_CHECK_SIZEOF(int)
AC_CHECK_SIZEOF(void *)
AC_C_LONG_DOUBLE
# long doubles were not used, and a portability problem
# AC_C_LONG_DOUBLE
AC_C_CONST
AC_C_INLINE
@ -71,8 +72,8 @@ AC_CHECK_HEADERS(float.h, AC_DEFINE(HAVE_FLOAT_H))
AC_CHECK_HEADERS(limits.h, AC_DEFINE(HAVE_LIMITS_H))
AC_CHECK_HEADERS(values.h, AC_DEFINE(HAVE_VALUES_H))
# Check for strerror and strsignal functions
AC_CHECK_FUNCS(strerror strsignal)
# Check for strerror, strsignal, and memmove functions
AC_CHECK_FUNCS(strerror strsignal memmove)
# Check for sys_errlist
AC_MSG_CHECKING(sys_errlist)

View File

@ -92,7 +92,7 @@ g_rarray_prepend (GArray *array,
{
g_array_maybe_expand ((GRealArray*) array, size);
memmove (array->data + size, array->data, array->len);
g_memmove (array->data + size, array->data, array->len);
memcpy (array->data, data, size);
array->len += size;

View File

@ -257,11 +257,16 @@ typedef unsigned int guint;
typedef float gfloat;
typedef double gdouble;
/* HAVE_LONG_DOUBLE doesn't work correctly on all platforms.
* Since gldouble isn't used anywhere, just disable it for now */
#if 0
#ifdef HAVE_LONG_DOUBLE
typedef long double gldouble;
#else /* HAVE_LONG_DOUBLE */
typedef double gldouble;
#endif /* HAVE_LONG_DOUBLE */
#endif /* 0 */
typedef void* gpointer;
@ -588,6 +593,14 @@ gchar* g_strdup (const gchar *str);
gchar* g_strerror (gint errnum);
gchar* g_strsignal (gint signum);
/* We make the assumption that if memmove isn't available, then
* bcopy will do the job. This isn't safe everywhere. (bcopy can't
* necessarily handle overlapping copies) */
#ifdef HAVE_MEMMOVE
#define g_memmove memmove
#else
#define g_memmove(a,b,c) bcopy(b,a,c)
#endif
/* Errors
*/

View File

@ -22,7 +22,6 @@
#undef HAVE_DOPRNT
#undef HAVE_FLOAT_H
#undef HAVE_LIMITS_H
#undef HAVE_LONG_DOUBLE
#undef HAVE_SYS_SELECT_H
#undef HAVE_STRERROR
#undef HAVE_STRSIGNAL
@ -57,6 +56,9 @@
/* Define if you have the strsignal function. */
#undef HAVE_STRSIGNAL
/* Define if you have the memmove function */
#undef HAVE_MEMMOVE
/* Define if you have the <float.h> header file. */
#undef HAVE_FLOAT_H

View File

@ -286,7 +286,7 @@ g_string_prepend (GString *fstring, gchar *val)
g_string_maybe_expand (string, len);
memmove (string->str, string->str + len, string->len);
g_memmove (string->str, string->str + len, string->len);
strncpy (string->str, val, len);
@ -304,7 +304,7 @@ g_string_prepend_c (GString *fstring, char c)
g_string_maybe_expand (string, 1);
memmove (string->str, string->str + 1, string->len);
g_memmove (string->str, string->str + 1, string->len);
string->str[0] = c;