[libmarpa-r2-perl] 08/14: Working on Github issue #139

Jonas Smedegaard dr at jones.dk
Sat May 17 21:24:23 UTC 2014


This is an automated email from the git hooks/post-receive script.

js pushed a commit to annotated tag Marpa-R2-2.085_006
in repository libmarpa-r2-perl.

commit 9b5c2bdcab646bac1e48a49605404ad6704c42af
Author: Jeffrey Kegler <JKEGL at cpan.org>
Date:   Fri May 2 11:52:29 2014 -0700

    Working on Github issue #139
---
 cpan/inc/Marpa/R2/Build_Me.pm      |  9 +++------
 cpan/libmarpa/dev/marpa.w          | 33 ++++++++++++++++++++++-----------
 cpan/libmarpa/win32/do_config_h.pl |  9 +++------
 3 files changed, 28 insertions(+), 23 deletions(-)

diff --git a/cpan/inc/Marpa/R2/Build_Me.pm b/cpan/inc/Marpa/R2/Build_Me.pm
index be2678b..1988ed8 100644
--- a/cpan/inc/Marpa/R2/Build_Me.pm
+++ b/cpan/inc/Marpa/R2/Build_Me.pm
@@ -574,12 +574,9 @@ INLINEHOOK
             }
 
             # Config::Autoconf mistakes 0 for undef, so these must be done explicitly
-            say {$config_fh} join q{ }, '#define MARPA_MAJOR_VERSION', $libmarpa_version[0];
-            say {$config_fh} join q{ }, '#define MARPA_MINOR_VERSION', $libmarpa_version[1];
-            say {$config_fh} join q{ }, '#define MARPA_MICRO_VERSION', $libmarpa_version[2];
-            say {$config_fh} join q{ }, '#define MARPA_H_MAJOR_VERSION', $libmarpa_version[0];
-            say {$config_fh} join q{ }, '#define MARPA_H_MINOR_VERSION', $libmarpa_version[1];
-            say {$config_fh} join q{ }, '#define MARPA_H_MICRO_VERSION', $libmarpa_version[2];
+            say {$config_fh} join q{ }, '#define MARPA_LIB_MAJOR_VERSION', $libmarpa_version[0];
+            say {$config_fh} join q{ }, '#define MARPA_LIB_MINOR_VERSION', $libmarpa_version[1];
+            say {$config_fh} join q{ }, '#define MARPA_LIB_MICRO_VERSION', $libmarpa_version[2];
 
             close($config_fh);
             $ac = Config::AutoConf->new();
diff --git a/cpan/libmarpa/dev/marpa.w b/cpan/libmarpa/dev/marpa.w
index 9d48143..27b6b6b 100644
--- a/cpan/libmarpa/dev/marpa.w
+++ b/cpan/libmarpa/dev/marpa.w
@@ -588,9 +588,12 @@ prototypes, look at
 @*0 Version constants.
 @ This macro checks that the header version numbers
 and the library version numbers are identical.
-It is all compile-time constants,
-so it is expected that
-it will be optimized out completely at compile time.
+It is a sanity check.
+The best argument for the cost-effectiveness here
+is that it should be free --
+it is all compile-time constants,
+which I can expected to be
+optimized out completely at compile time.
 @d HEADER_VERSION_MISMATCH (
    MARPA_LIB_MAJOR_VERSION != MARPA_H_MAJOR_VERSION
    || MARPA_LIB_MINOR_VERSION != MARPA_H_MINOR_VERSION
@@ -603,29 +606,37 @@ const int marpa_major_version = MARPA_LIB_MAJOR_VERSION;
 const int marpa_minor_version = MARPA_LIB_MINOR_VERSION;
 const int marpa_micro_version = MARPA_LIB_MICRO_VERSION;
 
-@ @<Function definitions@> =
+@ Check the arguments, which will usually be
+the version numbers from macros in the public
+header file,
+against the compiled-in version number.
+Currently, we don't support any kind of
+backward or forward compatibility here.
+@<Function definitions@> =
 Marpa_Error_Code
 marpa_check_version (int required_major,
                     int required_minor,
                     int required_micro)
 {
-  if (required_major != MARPA_LIB_MAJOR_VERSION)
+  if (required_major != marpa_major_version)
     return MARPA_ERR_MAJOR_VERSION_MISMATCH;
-  if (required_minor != MARPA_LIB_MINOR_VERSION)
+  if (required_minor != marpa_minor_version)
     return MARPA_ERR_MINOR_VERSION_MISMATCH;
-  if (required_micro != MARPA_LIB_MICRO_VERSION)
+  if (required_micro != marpa_minor_version)
     return MARPA_ERR_MICRO_VERSION_MISMATCH;
   return MARPA_ERR_NONE;
 }
 
-@ Always succeeds at this point.
+@ Returns the compiled-in version --
+not the one in the headers.
+Always succeeds at this point.
 @<Function definitions@> =
 Marpa_Error_Code
 marpa_version (int* version)
 {
-  *version++ = MARPA_LIB_MAJOR_VERSION;
-  *version++ = MARPA_LIB_MINOR_VERSION;
-  *version = MARPA_LIB_MICRO_VERSION;
+  *version++ = marpa_major_version;
+  *version++ = marpa_minor_version;
+  *version = marpa_micro_version;
   return 0;
 }
 
diff --git a/cpan/libmarpa/win32/do_config_h.pl b/cpan/libmarpa/win32/do_config_h.pl
index 25d015b..9df6e82 100644
--- a/cpan/libmarpa/win32/do_config_h.pl
+++ b/cpan/libmarpa/win32/do_config_h.pl
@@ -201,12 +201,9 @@ INLINEHOOK
             }
 
             # Config::Autoconf mistakes 0 for undef, so these must be done explicitly
-            say {$config_fh} join q{ }, '#define MARPA_MAJOR_VERSION', $libmarpa_version[0];
-            say {$config_fh} join q{ }, '#define MARPA_MINOR_VERSION', $libmarpa_version[1];
-            say {$config_fh} join q{ }, '#define MARPA_MICRO_VERSION', $libmarpa_version[2];
-            say {$config_fh} join q{ }, '#define MARPA_H_MAJOR_VERSION', $libmarpa_version[0];
-            say {$config_fh} join q{ }, '#define MARPA_H_MINOR_VERSION', $libmarpa_version[1];
-            say {$config_fh} join q{ }, '#define MARPA_H_MICRO_VERSION', $libmarpa_version[2];
+            say {$config_fh} join q{ }, '#define MARPA_LIB_MAJOR_VERSION', $libmarpa_version[0];
+            say {$config_fh} join q{ }, '#define MARPA_LIB_MINOR_VERSION', $libmarpa_version[1];
+            say {$config_fh} join q{ }, '#define MARPA_LIB_MICRO_VERSION', $libmarpa_version[2];
 
             close($config_fh);
             $ac = Config::AutoConf->new();

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/libmarpa-r2-perl.git



More information about the Pkg-perl-cvs-commits mailing list