From 9f15bb19fd0171b8fc1aa6d093139b161a958bc3 Mon Sep 17 00:00:00 2001 From: Geert Janssens Date: Tue, 28 Oct 2014 21:22:01 +0100 Subject: [PATCH] Fix a few deprecation warnings when building and testing with guile 2 --- src/gnc-test-env.in | 6 +++++- src/report/report-system/eguile-utilities.scm | 6 +++++- src/report/utility-reports/hello-world.scm | 6 +++++- src/scm/main.scm | 12 ++++++++---- 4 files changed, 23 insertions(+), 7 deletions(-) diff --git a/src/gnc-test-env.in b/src/gnc-test-env.in index 847364dfdf..085fbb6f12 100755 --- a/src/gnc-test-env.in +++ b/src/gnc-test-env.in @@ -7,8 +7,12 @@ exec @GUILE@ -s $0 "$@" ;; library-dirs (use-modules (srfi srfi-13) (srfi srfi-14)) ;; for string-tokenize +;; 'debug is deprecated and unused since guile 2 +(cond-expand + (guile-2 ) + (else + (debug-enable 'debug))) (debug-enable 'backtrace) -(debug-enable 'debug) (read-enable 'positions) ;; Are we on MS Windows here? If yes, make this a #t. diff --git a/src/report/report-system/eguile-utilities.scm b/src/report/report-system/eguile-utilities.scm index e4054cb91b..945f684c28 100644 --- a/src/report/report-system/eguile-utilities.scm +++ b/src/report/report-system/eguile-utilities.scm @@ -34,7 +34,11 @@ (gnc:module-load "gnucash/app-utils" 0) (use-modules (gnucash report standard-reports)) (use-modules (gnucash report business-reports)) -(use-modules (ice-9 syncase)) ; for define-syntax +; Syncase is deprecated and redundant in guile 2 +(cond-expand + (guile-2 ) + (else + (use-modules (ice-9 syncase)))) ; for define-syntax ;(use-modules (srfi srfi-13)) ; for extra string functions diff --git a/src/report/utility-reports/hello-world.scm b/src/report/utility-reports/hello-world.scm index 448db2e14f..12e338623f 100644 --- a/src/report/utility-reports/hello-world.scm +++ b/src/report/utility-reports/hello-world.scm @@ -8,7 +8,11 @@ (use-modules (gnucash main)) ;; FIXME: delete after we finish modularizing. (use-modules (gnucash gnc-module)) -(debug-enable 'debug) +;; 'debug is deprecated and unused since guile 2 +(cond-expand + (guile-2 ) + (else + (debug-enable 'debug))) (debug-enable 'backtrace) (gnc:module-load "gnucash/report/report-system" 0) diff --git a/src/scm/main.scm b/src/scm/main.scm index b29baff860..040f28916b 100644 --- a/src/scm/main.scm +++ b/src/scm/main.scm @@ -62,13 +62,17 @@ ;; Do this stuff very early -- but other than that, don't add any ;; executable code until the end of the file if you can help it. ;; These are needed for a guile 1.3.4 bug -(debug-enable 'debug) (debug-enable 'backtrace) (read-enable 'positions) -;; maxdepth doesn't exist in guile 2 and onwards: -(if (< (string->number (major-version)) 2) - (debug-set! maxdepth 100000)) +;; These options should only be set for guile < 2.0 +;; 'debug (deprecated and unused since guile 2) +;; maxdepth (removed since guile 2) +(cond-expand + (guile-2 ) + (else + (debug-enable 'debug) + (debug-set! maxdepth 100000))) (debug-set! stack 200000) ;; Initalialize localization, otherwise reports may output