MSVC compatibility: Disable "C99 designated initializers" by a compiler-dependent macro

Same as r18755.

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@18840 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Christian Stimming 2010-03-05 19:57:04 +00:00
parent 249a8c5612
commit 8b646bb485
11 changed files with 120 additions and 110 deletions

View File

@ -457,17 +457,17 @@ int gncAddressCompare (const GncAddress *a, const GncAddress *b)
static QofObject GncAddressDesc =
{
.interface_version = QOF_OBJECT_VERSION,
.e_type = GNC_ID_ADDRESS,
.type_label = "Address",
.create = (gpointer)qofAddressCreate,
.book_begin = NULL,
.book_end = NULL,
.is_dirty = qof_collection_is_dirty,
.mark_clean = qof_collection_mark_clean,
.foreach = qof_collection_foreach,
.printable = NULL,
.version_cmp = (int (*)(gpointer, gpointer)) qof_instance_version_cmp,
DI(.interface_version =) QOF_OBJECT_VERSION,
DI(.e_type =) GNC_ID_ADDRESS,
DI(.type_label =) "Address",
DI(.create =) (gpointer)qofAddressCreate,
DI(.book_begin =) NULL,
DI(.book_end =) NULL,
DI(.is_dirty =) qof_collection_is_dirty,
DI(.mark_clean =) qof_collection_mark_clean,
DI(.foreach =) qof_collection_foreach,
DI(.printable =) NULL,
DI(.version_cmp =) (int (*)(gpointer, gpointer)) qof_instance_version_cmp,
};
gboolean gncAddressRegister (void)

View File

@ -793,17 +793,17 @@ static void _gncBillTermDestroy (QofBook *book)
static QofObject gncBillTermDesc =
{
.interface_version = QOF_OBJECT_VERSION,
.e_type = _GNC_MOD_NAME,
.type_label = "Billing Term",
.create = (gpointer)gncBillTermCreate,
.book_begin = _gncBillTermCreate,
.book_end = _gncBillTermDestroy,
.is_dirty = qof_collection_is_dirty,
.mark_clean = qof_collection_mark_clean,
.foreach = qof_collection_foreach,
.printable = NULL,
.version_cmp = (int (*)(gpointer, gpointer)) qof_instance_version_cmp,
DI(.interface_version =) QOF_OBJECT_VERSION,
DI(.e_type =) _GNC_MOD_NAME,
DI(.type_label =) "Billing Term",
DI(.create =) (gpointer)gncBillTermCreate,
DI(.book_begin =) _gncBillTermCreate,
DI(.book_end =) _gncBillTermDestroy,
DI(.is_dirty =) qof_collection_is_dirty,
DI(.mark_clean =) qof_collection_mark_clean,
DI(.foreach =) qof_collection_foreach,
DI(.printable =) NULL,
DI(.version_cmp =) (int (*)(gpointer, gpointer)) qof_instance_version_cmp,
};
gboolean gncBillTermRegister (void)

View File

@ -47,4 +47,14 @@
#define GNC_TAXTABLE_MODULE_NAME GNC_ID_TAXTABLE
#define GNC_VENDOR_MODULE_NAME GNC_ID_VENDOR
#ifndef DI
# ifdef _MSC_VER
/* MSVC compiler doesn't have C99 "designated initializers"
* so we wrap them in a macro that is empty on MSVC. */
# define DI(x) /* */
# else
# define DI(x) x
# endif
#endif
#endif /* GNC_BUSINESS_H_ */

View File

@ -715,17 +715,17 @@ static const char * _gncCustomerPrintable (gpointer item)
static QofObject gncCustomerDesc =
{
.interface_version = QOF_OBJECT_VERSION,
.e_type = _GNC_MOD_NAME,
.type_label = "Customer",
.create = (gpointer)gncCustomerCreate,
.book_begin = NULL,
.book_end = NULL,
.is_dirty = qof_collection_is_dirty,
.mark_clean = qof_collection_mark_clean,
.foreach = qof_collection_foreach,
.printable = (const char * (*)(gpointer))gncCustomerGetName,
.version_cmp = (int (*)(gpointer, gpointer)) qof_instance_version_cmp,
DI(.interface_version =) QOF_OBJECT_VERSION,
DI(.e_type =) _GNC_MOD_NAME,
DI(.type_label =) "Customer",
DI(.create =) (gpointer)gncCustomerCreate,
DI(.book_begin =) NULL,
DI(.book_end =) NULL,
DI(.is_dirty =) qof_collection_is_dirty,
DI(.mark_clean =) qof_collection_mark_clean,
DI(.foreach =) qof_collection_foreach,
DI(.printable =) (const char * (*)(gpointer))gncCustomerGetName,
DI(.version_cmp =) (int (*)(gpointer, gpointer)) qof_instance_version_cmp,
};
gboolean gncCustomerRegister (void)

View File

@ -544,17 +544,17 @@ listen_for_address_events(QofInstance *entity, QofEventId event_type,
static QofObject gncEmployeeDesc =
{
.interface_version = QOF_OBJECT_VERSION,
.e_type = _GNC_MOD_NAME,
.type_label = "Employee",
.create = (gpointer)gncEmployeeCreate,
.book_begin = NULL,
.book_end = NULL,
.is_dirty = qof_collection_is_dirty,
.mark_clean = qof_collection_mark_clean,
.foreach = qof_collection_foreach,
.printable = _gncEmployeePrintable,
.version_cmp = (int (*)(gpointer, gpointer)) qof_instance_version_cmp,
DI(.interface_version =) QOF_OBJECT_VERSION,
DI(.e_type =) _GNC_MOD_NAME,
DI(.type_label =) "Employee",
DI(.create =) (gpointer)gncEmployeeCreate,
DI(.book_begin =) NULL,
DI(.book_end =) NULL,
DI(.is_dirty =) qof_collection_is_dirty,
DI(.mark_clean =) qof_collection_mark_clean,
DI(.foreach =) qof_collection_foreach,
DI(.printable =) _gncEmployeePrintable,
DI(.version_cmp =) (int (*)(gpointer, gpointer)) qof_instance_version_cmp,
};
gboolean gncEmployeeRegister (void)

View File

@ -1341,17 +1341,17 @@ int gncEntryCompare (const GncEntry *a, const GncEntry *b)
static QofObject gncEntryDesc =
{
.interface_version = QOF_OBJECT_VERSION,
.e_type = _GNC_MOD_NAME,
.type_label = "Order/Invoice/Bill Entry",
.create = (gpointer)gncEntryCreate,
.book_begin = NULL,
.book_end = NULL,
.is_dirty = qof_collection_is_dirty,
.mark_clean = qof_collection_mark_clean,
.foreach = qof_collection_foreach,
.printable = NULL,
.version_cmp = (int (*)(gpointer, gpointer)) qof_instance_version_cmp,
DI(.interface_version =) QOF_OBJECT_VERSION,
DI(.e_type =) _GNC_MOD_NAME,
DI(.type_label =) "Order/Invoice/Bill Entry",
DI(.create =) (gpointer)gncEntryCreate,
DI(.book_begin =) NULL,
DI(.book_end =) NULL,
DI(.is_dirty =) qof_collection_is_dirty,
DI(.mark_clean =) qof_collection_mark_clean,
DI(.foreach =) qof_collection_foreach,
DI(.printable =) NULL,
DI(.version_cmp =) (int (*)(gpointer, gpointer)) qof_instance_version_cmp,
};
gboolean gncEntryRegister (void)

View File

@ -1829,17 +1829,17 @@ static const char * _gncInvoicePrintable (gpointer obj)
static QofObject gncInvoiceDesc =
{
.interface_version = QOF_OBJECT_VERSION,
.e_type = _GNC_MOD_NAME,
.type_label = "Invoice",
.create = (gpointer)gncInvoiceCreate,
.book_begin = NULL,
.book_end = NULL,
.is_dirty = qof_collection_is_dirty,
.mark_clean = qof_collection_mark_clean,
.foreach = qof_collection_foreach,
.printable = _gncInvoicePrintable,
.version_cmp = (int (*)(gpointer, gpointer)) qof_instance_version_cmp,
DI(.interface_version =) QOF_OBJECT_VERSION,
DI(.e_type =) _GNC_MOD_NAME,
DI(.type_label =) "Invoice",
DI(.create =) (gpointer)gncInvoiceCreate,
DI(.book_begin =) NULL,
DI(.book_end =) NULL,
DI(.is_dirty =) qof_collection_is_dirty,
DI(.mark_clean =) qof_collection_mark_clean,
DI(.foreach =) qof_collection_foreach,
DI(.printable =) _gncInvoicePrintable,
DI(.version_cmp =) (int (*)(gpointer, gpointer)) qof_instance_version_cmp,
};
static void

View File

@ -455,17 +455,17 @@ static const char * _gncJobPrintable (gpointer item)
static QofObject gncJobDesc =
{
.interface_version = QOF_OBJECT_VERSION,
.e_type = _GNC_MOD_NAME,
.type_label = "Job",
.create = (gpointer)gncJobCreate,
.book_begin = NULL,
.book_end = NULL,
.is_dirty = qof_collection_is_dirty,
.mark_clean = qof_collection_mark_clean,
.foreach = qof_collection_foreach,
.printable = _gncJobPrintable,
.version_cmp = (int (*)(gpointer, gpointer)) qof_instance_version_cmp,
DI(.interface_version =) QOF_OBJECT_VERSION,
DI(.e_type =) _GNC_MOD_NAME,
DI(.type_label =) "Job",
DI(.create =) (gpointer)gncJobCreate,
DI(.book_begin =) NULL,
DI(.book_end =) NULL,
DI(.is_dirty =) qof_collection_is_dirty,
DI(.mark_clean =) qof_collection_mark_clean,
DI(.foreach =) qof_collection_foreach,
DI(.printable =) _gncJobPrintable,
DI(.version_cmp =) (int (*)(gpointer, gpointer)) qof_instance_version_cmp,
};
gboolean gncJobRegister (void)

View File

@ -502,17 +502,17 @@ _gncOrderPrintable (gpointer obj)
static QofObject gncOrderDesc =
{
.interface_version = QOF_OBJECT_VERSION,
.e_type = _GNC_MOD_NAME,
.type_label = "Order",
.create = (gpointer)gncOrderCreate,
.book_begin = NULL,
.book_end = NULL,
.is_dirty = qof_collection_is_dirty,
.mark_clean = qof_collection_mark_clean,
.foreach = qof_collection_foreach,
.printable = _gncOrderPrintable,
.version_cmp = (int (*)(gpointer, gpointer)) qof_instance_version_cmp,
DI(.interface_version =) QOF_OBJECT_VERSION,
DI(.e_type =) _GNC_MOD_NAME,
DI(.type_label =) "Order",
DI(.create =) (gpointer)gncOrderCreate,
DI(.book_begin =) NULL,
DI(.book_end =) NULL,
DI(.is_dirty =) qof_collection_is_dirty,
DI(.mark_clean =) qof_collection_mark_clean,
DI(.foreach =) qof_collection_foreach,
DI(.printable =) _gncOrderPrintable,
DI(.version_cmp =) (int (*)(gpointer, gpointer)) qof_instance_version_cmp,
};
gboolean gncOrderRegister (void)

View File

@ -890,17 +890,17 @@ static void _gncTaxTableDestroy (QofBook *book)
static QofObject gncTaxTableDesc =
{
.interface_version = QOF_OBJECT_VERSION,
.e_type = _GNC_MOD_NAME,
.type_label = "Tax Table",
.create = (gpointer)gncTaxTableCreate,
.book_begin = _gncTaxTableCreate,
.book_end = _gncTaxTableDestroy,
.is_dirty = qof_collection_is_dirty,
.mark_clean = qof_collection_mark_clean,
.foreach = qof_collection_foreach,
.printable = NULL,
.version_cmp = (int (*)(gpointer, gpointer)) qof_instance_version_cmp,
DI(.interface_version =) QOF_OBJECT_VERSION,
DI(.e_type =) _GNC_MOD_NAME,
DI(.type_label =) "Tax Table",
DI(.create =) (gpointer)gncTaxTableCreate,
DI(.book_begin =) _gncTaxTableCreate,
DI(.book_end =) _gncTaxTableDestroy,
DI(.is_dirty =) qof_collection_is_dirty,
DI(.mark_clean =) qof_collection_mark_clean,
DI(.foreach =) qof_collection_foreach,
DI(.printable =) NULL,
DI(.version_cmp =) (int (*)(gpointer, gpointer)) qof_instance_version_cmp,
};
gboolean gncTaxTableRegister (void)

View File

@ -653,17 +653,17 @@ static const char * _gncVendorPrintable (gpointer item)
static QofObject gncVendorDesc =
{
.interface_version = QOF_OBJECT_VERSION,
.e_type = _GNC_MOD_NAME,
.type_label = "Vendor",
.create = (gpointer)gncVendorCreate,
.book_begin = NULL,
.book_end = NULL,
.is_dirty = qof_collection_is_dirty,
.mark_clean = qof_collection_mark_clean,
.foreach = qof_collection_foreach,
.printable = _gncVendorPrintable,
.version_cmp = (int (*)(gpointer, gpointer)) qof_instance_version_cmp,
DI(.interface_version =) QOF_OBJECT_VERSION,
DI(.e_type =) _GNC_MOD_NAME,
DI(.type_label =) "Vendor",
DI(.create =) (gpointer)gncVendorCreate,
DI(.book_begin =) NULL,
DI(.book_end =) NULL,
DI(.is_dirty =) qof_collection_is_dirty,
DI(.mark_clean =) qof_collection_mark_clean,
DI(.foreach =) qof_collection_foreach,
DI(.printable =) _gncVendorPrintable,
DI(.version_cmp =) (int (*)(gpointer, gpointer)) qof_instance_version_cmp,
};
gboolean gncVendorRegister (void)