mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
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
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user