replace refstring macro implementation with C functions

This commit is contained in:
Ailin Nemui 2021-02-25 10:50:51 +01:00
commit 322df0d2c8
2 changed files with 30 additions and 20 deletions

View file

@ -1,16 +1,42 @@
#include <glib.h>
#include <string.h>
#include <irssi/src/core/refstrings.h>
#if GLIB_CHECK_VERSION(2, 58, 0)
/* callback implementation for GHashTable */
#undef i_refstr_release
void i_refstr_init(void)
{
/* nothing */
}
char *i_refstr_intern(const char *str)
{
if (str == NULL) {
return NULL;
}
return g_ref_string_new_intern(str);
}
void i_refstr_release(char *str)
{
if (str != NULL) {
g_ref_string_release(str);
if (str == NULL) {
return;
}
g_ref_string_release(str);
}
void i_refstr_deinit(void)
{
/* nothing */
}
char *i_refstr_table_size_info(void)
{
/* not available */
return NULL;
}
#else