r19444 - gnucash/trunk/src/import-export/aqbanking - Minor simplification of aqbanking version number check.
Christian Stimming
cstim at code.gnucash.org
Tue Aug 17 16:16:32 EDT 2010
Author: cstim
Date: 2010-08-17 16:16:32 -0400 (Tue, 17 Aug 2010)
New Revision: 19444
Trac: http://svn.gnucash.org/trac/changeset/19444
Modified:
gnucash/trunk/src/import-export/aqbanking/druid-ab-initial.c
gnucash/trunk/src/import-export/aqbanking/gnc-ab-utils.h
Log:
Minor simplification of aqbanking version number check.
Modified: gnucash/trunk/src/import-export/aqbanking/druid-ab-initial.c
===================================================================
--- gnucash/trunk/src/import-export/aqbanking/druid-ab-initial.c 2010-08-17 20:16:18 UTC (rev 19443)
+++ gnucash/trunk/src/import-export/aqbanking/druid-ab-initial.c 2010-08-17 20:16:32 UTC (rev 19444)
@@ -53,10 +53,7 @@
#include "gnc-session.h"
#include "import-account-matcher.h"
-#if (AQBANKING_VERSION_MAJOR > 4) || \
- ((AQBANKING_VERSION_MAJOR == 4) && \
- ((AQBANKING_VERSION_MINOR > 99) || \
- (AQBANKING_VERSION_MINOR == 99 && AQBANKING_VERSION_PATCHLEVEL > 8)))
+#if AQBANKING_VERSION_INT > 49908
/* For aqbanking > 4.99.8. See below. */
# include <aqbanking/dlg_setup.h>
#endif
@@ -237,10 +234,7 @@
return;
}
-#if (AQBANKING_VERSION_MAJOR > 4) || \
- ((AQBANKING_VERSION_MAJOR == 4) && \
- ((AQBANKING_VERSION_MINOR > 99) || \
- (AQBANKING_VERSION_MINOR == 99 && AQBANKING_VERSION_PATCHLEVEL > 8)))
+#if AQBANKING_VERSION_INT > 49908
/* For aqbanking5 > 4.99.8: Use AB_Banking_GetNewUserDialog(). */
{
GWEN_DIALOG *dlg =
Modified: gnucash/trunk/src/import-export/aqbanking/gnc-ab-utils.h
===================================================================
--- gnucash/trunk/src/import-export/aqbanking/gnc-ab-utils.h 2010-08-17 20:16:18 UTC (rev 19443)
+++ gnucash/trunk/src/import-export/aqbanking/gnc-ab-utils.h 2010-08-17 20:16:32 UTC (rev 19444)
@@ -41,21 +41,26 @@
G_BEGIN_DECLS
-#if (AQBANKING_VERSION_MAJOR > 3) || \
- ((AQBANKING_VERSION_MAJOR == 3) && \
- (AQBANKING_VERSION_MINOR >= 99))
-/** Defined if libaqbanking4 as opposed to libaqbanking3 is being used */
+/** A define that combines the aqbanking version number into one single
+ * integer number. Assumption: Both MINOR nor PATCHLEVEL numbers are
+ * in the interval [0..99]. */
+#define AQBANKING_VERSION_INT (10000 * AQBANKING_VERSION_MAJOR + 100 * AQBANKING_VERSION_MINOR + AQBANKING_VERSION_PATCHLEVEL)
+
+#if AQBANKING_VERSION_INT >= 39900
+/** Defined if libaqbanking4 as opposed to libaqbanking3 or earlier is
+ * being used */
# define AQBANKING_VERSION_4_PLUS
#endif
-#if (AQBANKING_VERSION_MAJOR > 4) || \
- ((AQBANKING_VERSION_MAJOR == 4) && \
- (AQBANKING_VERSION_MINOR >= 99))
-/** Defined if libaqbanking5 as opposed to libaqbanking4 is being used */
+#if AQBANKING_VERSION_INT >= 49900
+/** Defined if libaqbanking5 as opposed to libaqbanking4 or earlier is
+ * being used */
# define AQBANKING_VERSION_5_PLUS
#endif
#if defined(AQBANKING_VERSION_4_PLUS) && !defined(AQBANKING_VERSION_5_PLUS)
+/** Defined if libaqbanking4 is used and neither a newer nor an older
+ * version of libaqbanking. */
# define AQBANKING_VERSION_4_EXACTLY
#endif
More information about the gnucash-changes
mailing list