Skip to content

Commit

Permalink
Remove leading zeros in the numerical version
Browse files Browse the repository at this point in the history
  • Loading branch information
hakonhagland committed Jul 3, 2024
1 parent 0bdd252 commit 8f0b8b7
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
6 changes: 6 additions & 0 deletions inc/GSLBuilder.pm
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,12 @@ sub compile_swig {
my @swig_flags = defined($p->{swig_flags}) ? $self->split_like_shell($p->{swig_flags}) : ();
push @swig_flags, "-I./include";
my ($major, $minor, $numerical_ver) = reformat_version($ver);
if ($numerical_ver =~ /^0+$/) {
die "Unexpected swig version: $ver";
}
else {
$numerical_ver =~ s/^0+//; # Swig seems to have problems with leading zeros
}
push @swig_flags, "-DMG_GSL_MAJOR_VERSION=$major",
"-DMG_GSL_MINOR_VERSION=$minor",
"-DMG_GSL_VERSION=\"$major.$minor\"",
Expand Down
8 changes: 7 additions & 1 deletion swig/SparseMatrix.i
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,13 @@
#include "gsl/gsl_spmatrix.h"
%}

#if MG_GSL_NUM_VERSION >= 002006
#if MG_GSL_NUM_VERSION >= 2006
%warn "Including new GSL headers";
#else
%warn "Including legacy GSL headers";
#endif

#if MG_GSL_NUM_VERSION >= 2006
// ignore gsl_spmatrix_uchar_norm1, gsl_spmatrix_char_norm1, ...
%rename("%(regex:/^gsl_spmatrix_u.*_norm1$/$ignore/)s") "";
%include "gsl/gsl_spmatrix.h"
Expand Down

0 comments on commit 8f0b8b7

Please sign in to comment.