diff options
author | Murray Cumming <murrayc@murrayc.com> | 2005-01-20 18:24:28 +0000 |
---|---|---|
committer | Murray Cumming <murrayc@src.gnome.org> | 2005-01-20 18:24:28 +0000 |
commit | e89045516fe7022c468249c913520d0d0908973b (patch) | |
tree | 2d6f29bea14038c3959aff77bbc97712e3c439c4 /glib/glibmm/value_custom.cc | |
parent | f4ff8255ba21cfdea5310eccea639ec13cd4eb48 (diff) | |
download | glibmm-e89045516fe7022c468249c913520d0d0908973b.tar.gz |
Custom boxed types, more #ifdef ABI-changing to add intermediate extern-C
2005-01-20 Murray Cumming <murrayc@murrayc.com>
* glib/glibmm/value.h, value_custom.[h|cc]: Custom boxed types, more
#ifdef ABI-changing to add intermediate extern-C callback function,
for the IRIX MipsPro compiler. This might not actually work at runtime,
but if it does not then lots of funtionality should still work.
Conditionally moved the RefPtr Value specialization into object.h, as
before.
Diffstat (limited to 'glib/glibmm/value_custom.cc')
-rw-r--r-- | glib/glibmm/value_custom.cc | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/glib/glibmm/value_custom.cc b/glib/glibmm/value_custom.cc index bb0afcbc..96fd76f0 100644 --- a/glib/glibmm/value_custom.cc +++ b/glib/glibmm/value_custom.cc @@ -140,5 +140,36 @@ GType custom_pointer_type_register(const char* type_name) return g_type_register_static(G_TYPE_POINTER, full_name.c_str(), &type_info, GTypeFlags(0)); } +#ifndef GLIBMM_CAN_ASSIGN_NON_EXTERN_C_FUNCTIONS_TO_EXTERN_C_CALLBACKS +namespace { //anonymous + +//Theses are extern "C" functions that call non-extern C functions: +void Value_value_init_func(GValue* value) +{ + ValueBase_Boxed* pBase = static_cast<T*>(value->data[0].v_pointer); + if(pBase) + pBase->value_init_func(value); +} + +void Value_value_free_func(GValue* value) +{ + ValueBase_Boxed* pBase = static_cast<T*>(value->data[0].v_pointer); + if(pBase) + pBase->value_free_func(value); +} + +void Value_value_copy_func(const GValue* src_value, GValue* dest_value) +{ + ValueBase_Boxed* pBase = static_cast<T*>(value->data[0].v_pointer); + if(pBase) + pBase->value_copy_func(src_value, dest_value); +} + +} //namespace +#endif //GLIBMM_CAN_ASSIGN_NON_EXTERN_C_FUNCTIONS_TO_EXTERN_C_CALLBACKS + + + + } // namespace Glib |