summaryrefslogtreecommitdiff
path: root/amount.cc
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2004-08-17 03:09:46 -0400
committerJohn Wiegley <johnw@newartisans.com>2004-08-17 03:09:46 -0400
commitb00999893006891affccc15cfd5d60b9adb7af8c (patch)
tree3cc5383dc127cd3a187a8e830cd8fa3c72ce455a /amount.cc
parentc0d7feac7f4af1b3535834f511e2e9ef2c2f7cb0 (diff)
downloadfork-ledger-b00999893006891affccc15cfd5d60b9adb7af8c.tar.gz
fork-ledger-b00999893006891affccc15cfd5d60b9adb7af8c.tar.bz2
fork-ledger-b00999893006891affccc15cfd5d60b9adb7af8c.zip
if NO_CLEANUP is defined in the Makefile (now default), no cleanup is done
Diffstat (limited to 'amount.cc')
-rw-r--r--amount.cc8
1 files changed, 5 insertions, 3 deletions
diff --git a/amount.cc b/amount.cc
index 8499348c..c2bc6465 100644
--- a/amount.cc
+++ b/amount.cc
@@ -13,19 +13,19 @@ namespace ledger {
static mpz_t full_divisor;
static mpz_t true_value;
-static class init_amounts
-{
- public:
+static struct init_amounts {
init_amounts() {
mpz_init(full_divisor);
mpz_init(true_value);
mpz_ui_pow_ui(full_divisor, 10, MAX_PRECISION);
mpz_mul_ui(true_value, full_divisor, 1);
}
+#ifndef NO_CLEANUP
~init_amounts() {
mpz_clear(full_divisor);
mpz_clear(true_value);
}
+#endif
} initializer;
static void mpz_round(mpz_t out, mpz_t value, int precision)
@@ -781,6 +781,7 @@ commodities_map commodity_t::commodities;
commodity_t * commodity_t::null_commodity =
commodity_t::find_commodity("", true);
+#ifndef NO_CLEANUP
static struct cleanup_commodities
{
~cleanup_commodities() {
@@ -794,6 +795,7 @@ static struct cleanup_commodities
delete (*i).second;
}
} _cleanup;
+#endif
commodity_t * commodity_t::find_commodity(const std::string& symbol,
bool auto_create)