Author: joes
Date: Tue Apr 19 14:04:45 2005
New Revision: 161977

URL: http://svn.apache.org/viewcvs?view=rev&rev=161977
Log:
Add a boot-time apr version check for all the xs modules.

Added:
    httpd/apreq/trunk/glue/perl/xsbuilder/APR/Request/Apache2/Apache2.xs
Modified:
    httpd/apreq/trunk/glue/perl/xsbuilder/APR/Request/CGI/CGI.xs
    
httpd/apreq/trunk/glue/perl/xsbuilder/APR/Request/Cookie/APR__Request__Cookie.h
    httpd/apreq/trunk/glue/perl/xsbuilder/APR/Request/Cookie/Cookie.xs
    httpd/apreq/trunk/glue/perl/xsbuilder/APR/Request/Error/Error.xs
    
httpd/apreq/trunk/glue/perl/xsbuilder/APR/Request/Param/APR__Request__Param.h
    httpd/apreq/trunk/glue/perl/xsbuilder/APR/Request/Param/Param.xs
    httpd/apreq/trunk/glue/perl/xsbuilder/APR/Request/Request.xs

Added: httpd/apreq/trunk/glue/perl/xsbuilder/APR/Request/Apache2/Apache2.xs
URL: 
http://svn.apache.org/viewcvs/httpd/apreq/trunk/glue/perl/xsbuilder/APR/Request/Apache2/Apache2.xs?view=auto&rev=161977
==============================================================================
--- httpd/apreq/trunk/glue/perl/xsbuilder/APR/Request/Apache2/Apache2.xs (added)
+++ httpd/apreq/trunk/glue/perl/xsbuilder/APR/Request/Apache2/Apache2.xs Tue 
Apr 19 14:04:45 2005
@@ -0,0 +1,12 @@
+MODULE = APR::Request::Apache2    PACKAGE = APR::Request::Apache2
+
+BOOT:
+    {
+        apr_version_t version;
+        apr_version(&version);
+        if (version.major != APR_MAJOR_VERSION)
+            Perl_croak(aTHX_ "Can't load module APR::Request::Apache2 : "
+                             "wrong libapr major version "
+                             "(expected %d, saw %d)",
+                              APR_MAJOR_VERSION, version.major);
+    }

Modified: httpd/apreq/trunk/glue/perl/xsbuilder/APR/Request/CGI/CGI.xs
URL: 
http://svn.apache.org/viewcvs/httpd/apreq/trunk/glue/perl/xsbuilder/APR/Request/CGI/CGI.xs?view=diff&r1=161976&r2=161977
==============================================================================
--- httpd/apreq/trunk/glue/perl/xsbuilder/APR/Request/CGI/CGI.xs (original)
+++ httpd/apreq/trunk/glue/perl/xsbuilder/APR/Request/CGI/CGI.xs Tue Apr 19 
14:04:45 2005
@@ -3,5 +3,14 @@
 MODULE = APR::Request::CGI   PACKAGE = APR::Request::CGI
 
 BOOT:
+    {
+        apr_version_t version;
+        apr_version(&version);
+        if (version.major != APR_MAJOR_VERSION)
+            Perl_croak(aTHX_ "Can't load module APR::Request::CGI : "
+                             "wrong libapr major version "
+                             "(expected %d, saw %d)",
+                              APR_MAJOR_VERSION, version.major);
+    }
     apr_pool_create(&apreq_xs_cgi_global_pool, NULL);
     apreq_initialize(apreq_xs_cgi_global_pool);

Modified: 
httpd/apreq/trunk/glue/perl/xsbuilder/APR/Request/Cookie/APR__Request__Cookie.h
URL: 
http://svn.apache.org/viewcvs/httpd/apreq/trunk/glue/perl/xsbuilder/APR/Request/Cookie/APR__Request__Cookie.h?view=diff&r1=161976&r2=161977
==============================================================================
--- 
httpd/apreq/trunk/glue/perl/xsbuilder/APR/Request/Cookie/APR__Request__Cookie.h 
(original)
+++ 
httpd/apreq/trunk/glue/perl/xsbuilder/APR/Request/Cookie/APR__Request__Cookie.h 
Tue Apr 19 14:04:45 2005
@@ -1,3 +1,4 @@
+#include "apreq_xs_tables.h"
 
 #if (PERL_VERSION >= 8) /* MAGIC ITERATOR REQUIRES 5.8 */
 

Modified: httpd/apreq/trunk/glue/perl/xsbuilder/APR/Request/Cookie/Cookie.xs
URL: 
http://svn.apache.org/viewcvs/httpd/apreq/trunk/glue/perl/xsbuilder/APR/Request/Cookie/Cookie.xs?view=diff&r1=161976&r2=161977
==============================================================================
--- httpd/apreq/trunk/glue/perl/xsbuilder/APR/Request/Cookie/Cookie.xs 
(original)
+++ httpd/apreq/trunk/glue/perl/xsbuilder/APR/Request/Cookie/Cookie.xs Tue Apr 
19 14:04:45 2005
@@ -1,4 +1,3 @@
-#include "apreq_xs_tables.h"
 #define TABLE_CLASS "APR::Request::Cookie::Table"
 
 static int apreq_xs_table_keys(void *data, const char *key, const char *val)
@@ -232,6 +231,16 @@
 
 
 BOOT:
+    {
+        apr_version_t version;
+        apr_version(&version);
+        if (version.major != APR_MAJOR_VERSION)
+            Perl_croak(aTHX_ "Can't load module APR::Request::Cookie : "
+                             "wrong libapr major version "
+                             "(expected %d, saw %d)",
+                              APR_MAJOR_VERSION, version.major);
+    }
+
     /* register the overloading (type 'A') magic */
     PL_amagic_generation++;
     /* The magic for overload gets a GV* via gv_fetchmeth as */

Modified: httpd/apreq/trunk/glue/perl/xsbuilder/APR/Request/Error/Error.xs
URL: 
http://svn.apache.org/viewcvs/httpd/apreq/trunk/glue/perl/xsbuilder/APR/Request/Error/Error.xs?view=diff&r1=161976&r2=161977
==============================================================================
--- httpd/apreq/trunk/glue/perl/xsbuilder/APR/Request/Error/Error.xs (original)
+++ httpd/apreq/trunk/glue/perl/xsbuilder/APR/Request/Error/Error.xs Tue Apr 19 
14:04:45 2005
@@ -32,6 +32,15 @@
     RETVAL
 
 BOOT:
+    {
+        apr_version_t version;
+        apr_version(&version);
+        if (version.major != APR_MAJOR_VERSION)
+            Perl_croak(aTHX_ "Can't load module APR::Request::Error : "
+                             "wrong libapr major version "
+                             "(expected %d, saw %d)",
+                              APR_MAJOR_VERSION, version.major);
+    }
     /* register the overloading (type 'A') magic */
     PL_amagic_generation++;
     /* The magic for overload gets a GV* via gv_fetchmeth as */

Modified: 
httpd/apreq/trunk/glue/perl/xsbuilder/APR/Request/Param/APR__Request__Param.h
URL: 
http://svn.apache.org/viewcvs/httpd/apreq/trunk/glue/perl/xsbuilder/APR/Request/Param/APR__Request__Param.h?view=diff&r1=161976&r2=161977
==============================================================================
--- 
httpd/apreq/trunk/glue/perl/xsbuilder/APR/Request/Param/APR__Request__Param.h 
(original)
+++ 
httpd/apreq/trunk/glue/perl/xsbuilder/APR/Request/Param/APR__Request__Param.h 
Tue Apr 19 14:04:45 2005
@@ -1,3 +1,4 @@
+#include "apreq_xs_tables.h"
 
 #if (PERL_VERSION >= 8) /* MAGIC ITERATOR REQUIRES 5.8 */
 

Modified: httpd/apreq/trunk/glue/perl/xsbuilder/APR/Request/Param/Param.xs
URL: 
http://svn.apache.org/viewcvs/httpd/apreq/trunk/glue/perl/xsbuilder/APR/Request/Param/Param.xs?view=diff&r1=161976&r2=161977
==============================================================================
--- httpd/apreq/trunk/glue/perl/xsbuilder/APR/Request/Param/Param.xs (original)
+++ httpd/apreq/trunk/glue/perl/xsbuilder/APR/Request/Param/Param.xs Tue Apr 19 
14:04:45 2005
@@ -1,4 +1,3 @@
-#include "apreq_xs_tables.h"
 #define TABLE_CLASS "APR::Request::Param::Table"
 
 #ifdef AP_DEBUG
@@ -394,6 +393,16 @@
 
 
 BOOT:
+    {
+        apr_version_t version;
+        apr_version(&version);
+        if (version.major != APR_MAJOR_VERSION)
+            Perl_croak(aTHX_ "Can't load module APR::Request::Param : "
+                             "wrong libapr major version "
+                             "(expected %d, saw %d)",
+                              APR_MAJOR_VERSION, version.major);
+    }
+
     /* register the overloading (type 'A') magic */
     PL_amagic_generation++;
     /* The magic for overload gets a GV* via gv_fetchmeth as */

Modified: httpd/apreq/trunk/glue/perl/xsbuilder/APR/Request/Request.xs
URL: 
http://svn.apache.org/viewcvs/httpd/apreq/trunk/glue/perl/xsbuilder/APR/Request/Request.xs?view=diff&r1=161976&r2=161977
==============================================================================
--- httpd/apreq/trunk/glue/perl/xsbuilder/APR/Request/Request.xs (original)
+++ httpd/apreq/trunk/glue/perl/xsbuilder/APR/Request/Request.xs Tue Apr 19 
14:04:45 2005
@@ -224,3 +224,14 @@
 
   OUTPUT:
     RETVAL
+
+BOOT:
+    {
+        apr_version_t version;
+        apr_version(&version);
+        if (version.major != APR_MAJOR_VERSION)
+            Perl_croak(aTHX_ "Can't load module APR::Request : "
+                             "wrong libapr major version "
+                             "(expected %d, saw %d)",
+                              APR_MAJOR_VERSION, version.major);
+    }


Reply via email to