[libmarpa-r2-perl] 11/14: Work 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 3261a8aa57bc85233f62cf70c422879e39650bf0
Author: Jeffrey Kegler <JKEGL at cpan.org>
Date:   Fri May 2 19:46:14 2014 -0700

    Work on Github issue #139
---
 bump_version                  |  6 +++---
 cpan/libmarpa/ac/configure.ac |  7 +++++++
 cpan/libmarpa/dev/marpa.w     | 22 +++++++++++-----------
 cpan/xs/R2.xs                 | 10 +++++-----
 4 files changed, 26 insertions(+), 19 deletions(-)

diff --git a/bump_version b/bump_version
index c2eebfc..ef405c7 100644
--- a/bump_version
+++ b/bump_version
@@ -113,9 +113,9 @@ for my $configure_ac_file (
 
 {
     open my $out, '>', 'cpan/libmarpa/public/marpa.h-version';
-    say $out join " ", q{#define MARPA_H_MAJOR_VERSION}, $libmarpa_major;
-    say $out join " ", q{#define MARPA_H_MINOR_VERSION}, $libmarpa_minor;
-    say $out join " ", q{#define MARPA_H_MICRO_VERSION}, $libmarpa_micro;
+    say $out join " ", q{#define MARPA_MAJOR_VERSION}, $libmarpa_major;
+    say $out join " ", q{#define MARPA_MINOR_VERSION}, $libmarpa_minor;
+    say $out join " ", q{#define MARPA_MICRO_VERSION}, $libmarpa_micro;
     close $out;
 }
 
diff --git a/cpan/libmarpa/ac/configure.ac b/cpan/libmarpa/ac/configure.ac
index b38dfa3..ef27ba8 100644
--- a/cpan/libmarpa/ac/configure.ac
+++ b/cpan/libmarpa/ac/configure.ac
@@ -104,6 +104,13 @@ fi
 
 AC_SUBST(WARNING_CFLAGS)
 AC_SUBST(WARNING_CPPFLAGS)
+
+# There are two sets of version numbers, one that travels as
+# a define with the public headers, and this one, which is compiled
+# into the library.  Both *should* be the same.
+# We use these duplicate headers to make sure applications match the
+# right headers to the right library, and also for some sanity checking
+# at build and development time.
 AC_SUBST(MARPA_LIB_MAJOR_VERSION, [marpa_major_version])
 AC_SUBST(MARPA_LIB_MINOR_VERSION, [marpa_minor_version])
 AC_SUBST(MARPA_LIB_MICRO_VERSION, [marpa_micro_version])
diff --git a/cpan/libmarpa/dev/marpa.w b/cpan/libmarpa/dev/marpa.w
index 27b6b6b..ee0bee8 100644
--- a/cpan/libmarpa/dev/marpa.w
+++ b/cpan/libmarpa/dev/marpa.w
@@ -587,17 +587,21 @@ prototypes, look at
 @** The public header file.
 @*0 Version constants.
 @ This macro checks that the header version numbers
-and the library version numbers are identical.
+(MARPA_xxx_VERSION)
+and the library version numbers
+(MARPA_LIB_xxx_VERSION)
+are identical.
 It is a sanity check.
 The best argument for the cost-effectiveness here
-is that it should be free --
+is that the check is almost certainly cost-free at
+runtime --
 it is all compile-time constants,
-which I can expected to be
-optimized out completely at compile time.
+which I can reasonably expect to be
+optimized out.
 @d HEADER_VERSION_MISMATCH (
-   MARPA_LIB_MAJOR_VERSION != MARPA_H_MAJOR_VERSION
-   || MARPA_LIB_MINOR_VERSION != MARPA_H_MINOR_VERSION
-   || MARPA_LIB_MICRO_VERSION != MARPA_H_MICRO_VERSION
+   MARPA_LIB_MAJOR_VERSION != MARPA_MAJOR_VERSION
+   || MARPA_LIB_MINOR_VERSION != MARPA_MINOR_VERSION
+   || MARPA_LIB_MICRO_VERSION != MARPA_MICRO_VERSION
 )
 @ Set globals to the library version numbers,
 so that they can be found at runtime.
@@ -15921,10 +15925,6 @@ extern const int marpa_major_version;
 extern const int marpa_minor_version;
 extern const int marpa_micro_version;
 
-#define MARPA_MAJOR_VERSION MARPA_H_MAJOR_VERSION
-#define MARPA_MINOR_VERSION MARPA_H_MINOR_VERSION
-#define MARPA_MICRO_VERSION MARPA_H_MICRO_VERSION
-
 @<Public defines@>@;
 @<Public incomplete structures@>@;
 @<Public typedefs@>@;
diff --git a/cpan/xs/R2.xs b/cpan/xs/R2.xs
index 865eed6..93d81a3 100644
--- a/cpan/xs/R2.xs
+++ b/cpan/xs/R2.xs
@@ -2507,16 +2507,16 @@ PPCODE:
     }
 
   /* Make sure the header is from the version we want */
-  if (MARPA_H_MAJOR_VERSION != EXPECTED_LIBMARPA_MAJOR
-      || MARPA_H_MINOR_VERSION != EXPECTED_LIBMARPA_MINOR
-      || MARPA_H_MICRO_VERSION != EXPECTED_LIBMARPA_MICRO)
+  if (MARPA_MAJOR_VERSION != EXPECTED_LIBMARPA_MAJOR
+      || MARPA_MINOR_VERSION != EXPECTED_LIBMARPA_MINOR
+      || MARPA_MICRO_VERSION != EXPECTED_LIBMARPA_MICRO)
     {
       croak
 	("Problem in $g->new(): want Libmarpa %d.%d.%d, header was from Libmarpa %d.%d.%d",
 	 EXPECTED_LIBMARPA_MAJOR, EXPECTED_LIBMARPA_MINOR,
 	 EXPECTED_LIBMARPA_MICRO,
-	 MARPA_H_MAJOR_VERSION, MARPA_H_MINOR_VERSION,
-	 MARPA_H_MICRO_VERSION);
+	 MARPA_MAJOR_VERSION, MARPA_MINOR_VERSION,
+	 MARPA_MICRO_VERSION);
     }
 
   {

-- 
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