add a g_byte_array_sized_new() helper if we compile for glib < 2
svn path=/trunk/; revision=23373
This commit is contained in:
parent
8da1f94cca
commit
7885237398
|
@ -1018,6 +1018,20 @@ g_strlcpy(gchar *dest, const gchar *src, gsize dest_size)
|
|||
}
|
||||
#endif
|
||||
|
||||
/* g_byte_array_sized_new() doesnt exist in glib-1.2 */
|
||||
#if GLIB_MAJOR_VERSION < 2
|
||||
GByteArray *
|
||||
g_byte_array_sized_new(guint reserved_size)
|
||||
{
|
||||
GByteArray *gba;
|
||||
|
||||
gba = g_byte_array_new();
|
||||
g_byte_array_set_size(gba, reserved_size);
|
||||
|
||||
return gba;
|
||||
}
|
||||
#endif
|
||||
|
||||
char *
|
||||
epan_strcasestr(const char *haystack, const char *needle)
|
||||
{
|
||||
|
|
|
@ -235,4 +235,9 @@ gsize g_strlcpy(gchar *dest, const gchar *src, gsize dest_size);
|
|||
|
||||
#endif
|
||||
|
||||
#if GLIB_MAJOR_VERSION < 2
|
||||
/* g_byte_array_sized_new() doesnt exist in glib-1.2 */
|
||||
GByteArray *g_byte_array_sized_new(guint reserved_size);
|
||||
#endif
|
||||
|
||||
#endif /* __STRUTIL_H__ */
|
||||
|
|
Loading…
Reference in New Issue