libebook: Define boxed EPhoneNumber type at single place
authorMathias Hasselmann <mathias@openismus.com>
Fri, 25 Jan 2013 13:48:51 +0000 (14:48 +0100)
committerMathias Hasselmann <mathias@openismus.com>
Thu, 31 Jan 2013 17:55:44 +0000 (18:55 +0100)
G_DEFINE_BOXED() doesn't need the EPhoneNumber structure's size,
so we can define the boxed type even when not using C++.

See: https://bugzilla.gnome.org/show_bug.cgi?id=689622

addressbook/libebook/e-phone-number-private.cpp
addressbook/libebook/e-phone-number.c

index 99caa7f..5679f52 100644 (file)
@@ -45,11 +45,6 @@ struct _EPhoneNumber {
        i18n::phonenumbers::PhoneNumber phone_number;
 };
 
-G_DEFINE_BOXED_TYPE (EPhoneNumber,
-                     e_phone_number,
-                     e_phone_number_copy,
-                     e_phone_number_free)
-
 static PhoneNumberUtil *
 e_phone_number_util_get_instance (void)
 {
index 47dfea1..dee3bac 100644 (file)
 
 #include "e-phone-number-private.h"
 
-#ifndef ENABLE_PHONENUMBER
-
-/* With phonenumber support enabled the boxed type must be defined in
- * the C++ code because we cannot compute the size of C++ types here. */
-G_DEFINE_BOXED_TYPE (EPhoneNumber,
-                     e_phone_number,
-                     e_phone_number_copy,
-                     e_phone_number_free)
-
-#endif /* ENABLE_PHONENUMBER */
+G_DEFINE_BOXED_TYPE (
+       EPhoneNumber, e_phone_number,
+       e_phone_number_copy, e_phone_number_free)
 
 G_DEFINE_QUARK (e-phone-number-error-quark, e_phone_number_error)