comparison liboctave/util/sparse-util.cc @ 20318:a0fab64685ab

Avoid HAVE_ macro in header file. * sparse-util.h, sparse-util.cc (SparseCholError, SparseCholPrint): Unconditionally declare and define functions.
author John W. Eaton <jwe@octave.org>
date Wed, 24 Jun 2015 17:32:36 -0400
parents 4197fc428c7d
children
comparison
equal deleted inserted replaced
20316:5db7eea18d76 20318:a0fab64685ab
31 #include "oct-sparse.h" 31 #include "oct-sparse.h"
32 #include "sparse-util.h" 32 #include "sparse-util.h"
33 33
34 // FIXME: this overload is here due to API change in SuiteSparse (3.1 -> 3.2) 34 // FIXME: this overload is here due to API change in SuiteSparse (3.1 -> 3.2)
35 35
36 #ifdef HAVE_CHOLMOD
37
38 void 36 void
39 SparseCholError (int status, char *file, int line, char *message) 37 SparseCholError (int status, char *file, int line, char *message)
40 { 38 {
41 SparseCholError (status, file, line, message); 39 SparseCholError (status, file, line, message);
42 } 40 }
41
42 #ifdef HAVE_CHOLMOD
43 43
44 void 44 void
45 SparseCholError (int status, const char *file, int line, const char *message) 45 SparseCholError (int status, const char *file, int line, const char *message)
46 { 46 {
47 47
51 (*current_liboctave_warning_with_id_handler) 51 (*current_liboctave_warning_with_id_handler)
52 ("Octave:cholmod-message", "warning %i, at line %i in file %s: %s", 52 ("Octave:cholmod-message", "warning %i, at line %i in file %s: %s",
53 status, line, file, message); 53 status, line, file, message);
54 } 54 }
55 55
56 #else
57
58 void
59 SparseCholError (int status, const char *, int, const char *)
60 {
61 }
62
63 #endif //HAVE_CHOLMOD
64
56 int 65 int
57 SparseCholPrint (const char *fmt, ...) 66 SparseCholPrint (const char *fmt, ...)
58 { 67 {
59 va_list args; 68 va_list args;
60 va_start (args, fmt); 69 va_start (args, fmt);
61 int ret = gnulib::vfprintf (stderr, fmt, args); 70 int ret = gnulib::vfprintf (stderr, fmt, args);
62 gnulib::fflush (stderr); 71 gnulib::fflush (stderr);
63 va_end (args); 72 va_end (args);
64 return ret; 73 return ret;
65 } 74 }
66
67 #endif //HAVE_CHOLMOD
68 75
69 bool 76 bool
70 sparse_indices_ok (octave_idx_type *r, octave_idx_type *c, 77 sparse_indices_ok (octave_idx_type *r, octave_idx_type *c,
71 octave_idx_type nrows, octave_idx_type ncols, 78 octave_idx_type nrows, octave_idx_type ncols,
72 octave_idx_type nnz) 79 octave_idx_type nnz)