diff options
Diffstat (limited to 'JavaScriptCore/wtf/gobject/GRefPtr.cpp')
-rw-r--r-- | JavaScriptCore/wtf/gobject/GRefPtr.cpp | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/JavaScriptCore/wtf/gobject/GRefPtr.cpp b/JavaScriptCore/wtf/gobject/GRefPtr.cpp index 9d16cb5..c16024c 100644 --- a/JavaScriptCore/wtf/gobject/GRefPtr.cpp +++ b/JavaScriptCore/wtf/gobject/GRefPtr.cpp @@ -23,30 +23,47 @@ namespace WTF { -template <> GHashTable* refGPtr(GHashTable* ptr) +template <> GHashTable* refPlatformPtr(GHashTable* ptr) { if (ptr) g_hash_table_ref(ptr); return ptr; } -template <> void derefGPtr(GHashTable* ptr) +template <> void derefPlatformPtr(GHashTable* ptr) { g_hash_table_unref(ptr); } #if GLIB_CHECK_VERSION(2, 24, 0) -template <> GVariant* refGPtr(GVariant* ptr) +template <> GVariant* refPlatformPtr(GVariant* ptr) { if (ptr) g_variant_ref(ptr); return ptr; } -template <> void derefGPtr(GVariant* ptr) +template <> void derefPlatformPtr(GVariant* ptr) { g_variant_unref(ptr); } + +#else + +// We do this so that we can avoid including the glib.h header in GRefPtr.h. +typedef struct _GVariant { + bool fake; +} GVariant; + +template <> GVariant* refPlatformPtr(GVariant* ptr) +{ + return ptr; +} + +template <> void derefPlatformPtr(GVariant* ptr) +{ +} + #endif } // namespace WTF |