MSVC compatiblity: Struct initialization doesn't work as expected.

Somehow, the struct initialization containing a gnc_numeric
doesn't work. As an exception, we hand-initialize that member
afterwards.

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@18754 57a11ea4-9604-0410-9ed3-97b8803252fd
pull/1/head
Christian Stimming 16 years ago
parent 1383ccae9e
commit 9d6160cfd4

@ -3311,7 +3311,15 @@ xaccAccountGetXxxBalanceInCurrencyRecursive (const Account *acc,
/* If needed, sum up the children converting to the *requested*
commodity. */
if (include_children) {
#ifdef _MSC_VER
/* MSVC compiler: Somehow, the struct initialization containing a
gnc_numeric doesn't work. As an exception, we hand-initialize
that member afterwards. */
CurrencyBalance cb = { report_commodity, { 0 }, fn, NULL, 0 };
cb.balance = balance;
#else
CurrencyBalance cb = { report_commodity, balance, fn, NULL, 0 };
#endif
gnc_account_foreach_descendant (acc, xaccAccountBalanceHelper, &cb);
balance = cb.balance;
@ -3339,7 +3347,15 @@ xaccAccountGetXxxBalanceAsOfDateInCurrencyRecursive (
/* If needed, sum up the children converting to the *requested*
commodity. */
if (include_children) {
#ifdef _MSC_VER
/* MSVC compiler: Somehow, the struct initialization containing a
gnc_numeric doesn't work. As an exception, we hand-initialize
that member afterwards. */
CurrencyBalance cb = { report_commodity, 0, NULL, fn, date };
cb.balance = balance;
#else
CurrencyBalance cb = { report_commodity, balance, NULL, fn, date };
#endif
gnc_account_foreach_descendant (acc, xaccAccountBalanceAsOfDateHelper, &cb);
balance = cb.balance;

Loading…
Cancel
Save