[geos-commits] r3772 - in trunk: macros swig/ruby

svn_geos at osgeo.org svn_geos at osgeo.org
Mon Feb 25 03:41:19 PST 2013


Author: strk
Date: 2013-02-25 03:41:19 -0800 (Mon, 25 Feb 2013)
New Revision: 3772

Modified:
   trunk/macros/ruby.m4
   trunk/swig/ruby/geos_wrap.cxx
Log:
Update macros/ruby.m4 for ruby 1.9.x

Used RbConfig instead of obsolete and deprecated Config.
Updated SWIG generated files.

Patch by Kashif Rasul <kashif.rasul at gmail.com>

Modified: trunk/macros/ruby.m4
===================================================================
--- trunk/macros/ruby.m4	2013-02-25 11:11:22 UTC (rev 3771)
+++ trunk/macros/ruby.m4	2013-02-25 11:41:19 UTC (rev 3772)
@@ -23,25 +23,25 @@
 		RUBY_VERSION=`$RUBY -e "puts RUBY_VERSION"`
 
 		dnl Get Ruby bin directory
-		RUBY_BIN_DIR=`$RUBY -rrbconfig -e 'puts Config::CONFIG[["bindir"]]'`
+		RUBY_BIN_DIR=`$RUBY -rrbconfig -e 'puts RbConfig::CONFIG[["bindir"]] || Config::CONFIG[["bindir"]]'`
 
     dnl Get Ruby site arch
-		RUBY_SITE_ARCH=`$RUBY -rrbconfig -e 'puts Config::CONFIG[["sitearch"]]'`
+		RUBY_SITE_ARCH=`$RUBY -rrbconfig -e 'puts RbConfig::CONFIG[["sitearch"]] || Config::CONFIG[["sitearch"]]'`
 
 		dnl Get Ruby include directory
-		RUBY_INCLUDE_DIR=`$RUBY -rrbconfig -e 'puts Config::CONFIG[["rubyhdrdir"]] || Config::CONFIG[["archdir"]]'`
+		RUBY_INCLUDE_DIR=`$RUBY -rrbconfig -e 'puts RbConfig::CONFIG[["rubyhdrdir"]] || Config::CONFIG[["archdir"]]'`
 	
 		dnl Get Ruby lib directory
-		RUBY_LIB_DIR=`$RUBY -rrbconfig -e 'puts Config::CONFIG[["libdir"]]'`
+		RUBY_LIB_DIR=`$RUBY -rrbconfig -e 'puts RbConfig::CONFIG[["libdir"]] || Config::CONFIG[["libdir"]]'`
 
 		dnl Get Ruby extensions directory
-		RUBY_EXTENSION_DIR=`$RUBY -rrbconfig -e 'puts Config::CONFIG[["sitearchdir"]]'`
+		RUBY_EXTENSION_DIR=`$RUBY -rrbconfig -e 'puts RbConfig::CONFIG[["sitearchdir"]] || Config::CONFIG[["sitearchdir"]]'`
 
 		dnl Get Ruby shared library name, this does not include the lib prefix or extension name
-		RUBY_SO_NAME=`$RUBY -rrbconfig -e 'puts Config::CONFIG[["RUBY_SO_NAME"]]'`
+		RUBY_SO_NAME=`$RUBY -rrbconfig -e 'puts puts RbConfig::CONFIG[["LIBRUBY_SO"]] || Config::CONFIG[["RUBY_SO_NAME"]]'`
 		
 		dnl Get Ruby shared libary name
-		RUBY_SHARED_LIB=`$RUBY -rrbconfig -e 'puts Config::CONFIG[["LIBRUBY"]]'`
+		RUBY_SHARED_LIB=`$RUBY -rrbconfig -e 'puts RbConfig::CONFIG[["LIBRUBY"]] || Config::CONFIG[["LIBRUBY"]]'`
 		
     AC_MSG_NOTICE([Ruby executable is '$RUBY'])
     AC_MSG_NOTICE([Ruby version is '$RUBY_VERSION'])

Modified: trunk/swig/ruby/geos_wrap.cxx
===================================================================
--- trunk/swig/ruby/geos_wrap.cxx	2013-02-25 11:11:22 UTC (rev 3771)
+++ trunk/swig/ruby/geos_wrap.cxx	2013-02-25 11:41:19 UTC (rev 3772)
@@ -1,6 +1,6 @@
 /* ----------------------------------------------------------------------------
  * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 1.3.40
+ * Version 2.0.4
  * 
  * This file is not intended to be easily readable and contains a number of 
  * coding conventions designed to improve portability and efficiency. Do not make
@@ -305,7 +305,7 @@
 /* 
    Flags/methods for returning states.
    
-   The SWIG conversion methods, as ConvertPtr, return and integer 
+   The SWIG conversion methods, as ConvertPtr, return an integer 
    that tells if the conversion was successful or not. And if not,
    an error code can be returned (see swigerrors.swg for the codes).
    
@@ -855,6 +855,15 @@
 
 #include <ruby.h>
 
+/* Ruby 1.9.1 has a "memoisation optimisation" when compiling with GCC which
+ * breaks using rb_intern as an lvalue, as SWIG does.  We work around this
+ * issue for now by disabling this.
+ * https://sourceforge.net/tracker/?func=detail&aid=2859614&group_id=1645&atid=101645
+ */
+#ifdef rb_intern
+# undef rb_intern
+#endif
+
 /* Remove global macros defined in Ruby's win32.h */
 #ifdef write
 # undef write
@@ -1013,7 +1022,7 @@
 
 /* Define custom exceptions for errors that do not map to existing Ruby
    exceptions.  Note this only works for C++ since a global cannot be
-   initialized by a funtion in C.  For C, fallback to rb_eRuntimeError.*/
+   initialized by a function in C.  For C, fallback to rb_eRuntimeError.*/
 
 SWIGINTERN VALUE 
 getNullReferenceError(void) {
@@ -1158,9 +1167,6 @@
 }
 
 /* -----------------------------------------------------------------------------
- * See the LICENSE file for information on copyright, usage and redistribution
- * of SWIG, and the README file for authors - http://www.swig.org/release.html.
- *
  * rubytracking.swg
  *
  * This file contains support for tracking mappings from 
@@ -1356,9 +1362,6 @@
 
 
 /* -----------------------------------------------------------------------------
- * See the LICENSE file for information on copyright, usage and redistribution
- * of SWIG, and the README file for authors - http://www.swig.org/release.html.
- *
  * rubyrun.swg
  *
  * This file contains the runtime support for Ruby modules
@@ -1402,7 +1405,7 @@
 /* Error manipulation */
 
 #define SWIG_ErrorType(code)                            SWIG_Ruby_ErrorType(code)               
-#define SWIG_Error(code, msg)            		rb_raise(SWIG_Ruby_ErrorType(code), msg)
+#define SWIG_Error(code, msg)            		rb_raise(SWIG_Ruby_ErrorType(code), "%s", msg)
 #define SWIG_fail                        		goto fail				 
 
 
@@ -1457,7 +1460,7 @@
       ++swig_virtual_calls;
 #  define SWIG_RELEASE_STACK --swig_virtual_calls;
 #  define Ruby_DirectorTypeMismatchException(x) \
-          rb_raise( rb_eTypeError, x ); return c_result;
+          rb_raise( rb_eTypeError, "%s", x ); return c_result;
 
       static unsigned int swig_virtual_calls = 0;
 
@@ -1832,12 +1835,12 @@
 #define SWIGTYPE_p_GeosWktWriter swig_types[16]
 #define SWIGTYPE_p_char swig_types[17]
 #define SWIGTYPE_p_p_GeosLinearRing swig_types[18]
-#define SWIGTYPE_p_p_void swig_types[19]
-#define SWIGTYPE_p_size_t swig_types[20]
-#define SWIGTYPE_p_swig__ConstIterator swig_types[21]
-#define SWIGTYPE_p_swig__GC_VALUE swig_types[22]
-#define SWIGTYPE_p_swig__Iterator swig_types[23]
-#define SWIGTYPE_p_unsigned_char swig_types[24]
+#define SWIGTYPE_p_size_t swig_types[19]
+#define SWIGTYPE_p_swig__ConstIterator swig_types[20]
+#define SWIGTYPE_p_swig__GC_VALUE swig_types[21]
+#define SWIGTYPE_p_swig__Iterator swig_types[22]
+#define SWIGTYPE_p_unsigned_char swig_types[23]
+#define SWIGTYPE_p_void swig_types[24]
 static swig_type_info *swig_types[26];
 static swig_module_info swig_module = {swig_types, 25, 0, 0, 0, 0};
 #define SWIG_TypeQuery(name) SWIG_TypeQueryModule(&swig_module, &swig_module, name)
@@ -1854,7 +1857,7 @@
 #define SWIG_RUBY_THREAD_END_BLOCK
 
 
-#define SWIGVERSION 0x010340 
+#define SWIGVERSION 0x020004 
 #define SWIG_VERSION SWIGVERSION
 
 
@@ -2150,6 +2153,7 @@
 
 #include <string>
 #include <stdexcept>
+#include <stddef.h>
 
   
 namespace swig {
@@ -2415,7 +2419,7 @@
 } 
 
 
-/*@SWIG:/usr/share/swig1.3/ruby/rubyprimtypes.swg,23,%ruby_aux_method@*/
+/*@SWIG:/usr/share/swig2.0/ruby/rubyprimtypes.swg,19,%ruby_aux_method@*/
 SWIGINTERN VALUE SWIG_AUX_NUM2ULONG(VALUE *args)
 {
   VALUE obj = args[0];
@@ -2461,7 +2465,7 @@
 }
 
 
-/*@SWIG:/usr/share/swig1.3/ruby/rubyprimtypes.swg,23,%ruby_aux_method@*/
+/*@SWIG:/usr/share/swig2.0/ruby/rubyprimtypes.swg,19,%ruby_aux_method@*/
 SWIGINTERN VALUE SWIG_AUX_NUM2LONG(VALUE *args)
 {
   VALUE obj = args[0];
@@ -2644,7 +2648,7 @@
         return (GeosCoordinateSequence*) GEOSCoordSeq_clone(coords);
     }
 
-/*@SWIG:/usr/share/swig1.3/ruby/rubyprimtypes.swg,23,%ruby_aux_method@*/
+/*@SWIG:/usr/share/swig2.0/ruby/rubyprimtypes.swg,19,%ruby_aux_method@*/
 SWIGINTERN VALUE SWIG_AUX_NUM2DBL(VALUE *args)
 {
   VALUE obj = args[0];
@@ -3346,19 +3350,14 @@
 SWIGINTERN VALUE
 _wrap_GCVALUE_inspect(int argc, VALUE *argv, VALUE self) {
   swig::GC_VALUE *arg1 = (swig::GC_VALUE *) 0 ;
-  void *argp1 = 0 ;
-  int res1 = 0 ;
+  swig::GC_VALUE r1 ;
   VALUE result;
   VALUE vresult = Qnil;
   
   if ((argc < 0) || (argc > 0)) {
     rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
   }
-  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_swig__GC_VALUE, 0 |  0 );
-  if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "swig::GC_VALUE const *","inspect", 1, self )); 
-  }
-  arg1 = reinterpret_cast< swig::GC_VALUE * >(argp1);
+  r1 = self; arg1 = &r1;
   result = (VALUE)((swig::GC_VALUE const *)arg1)->inspect();
   vresult = result;
   return vresult;
@@ -3379,19 +3378,14 @@
 SWIGINTERN VALUE
 _wrap_GCVALUE_to_s(int argc, VALUE *argv, VALUE self) {
   swig::GC_VALUE *arg1 = (swig::GC_VALUE *) 0 ;
-  void *argp1 = 0 ;
-  int res1 = 0 ;
+  swig::GC_VALUE r1 ;
   VALUE result;
   VALUE vresult = Qnil;
   
   if ((argc < 0) || (argc > 0)) {
     rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
   }
-  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_swig__GC_VALUE, 0 |  0 );
-  if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "swig::GC_VALUE const *","to_s", 1, self )); 
-  }
-  arg1 = reinterpret_cast< swig::GC_VALUE * >(argp1);
+  r1 = self; arg1 = &r1;
   result = (VALUE)((swig::GC_VALUE const *)arg1)->to_s();
   vresult = result;
   return vresult;
@@ -9316,12 +9310,12 @@
 static swig_type_info _swigt__p_GeosWktWriter = {"_p_GeosWktWriter", "GeosWktWriter *", 0, 0, (void*)0, 0};
 static swig_type_info _swigt__p_char = {"_p_char", "char *", 0, 0, (void*)0, 0};
 static swig_type_info _swigt__p_p_GeosLinearRing = {"_p_p_GeosLinearRing", "GeosLinearRing **", 0, 0, (void*)0, 0};
-static swig_type_info _swigt__p_p_void = {"_p_p_void", "void **|VALUE *", 0, 0, (void*)0, 0};
 static swig_type_info _swigt__p_size_t = {"_p_size_t", "size_t *", 0, 0, (void*)0, 0};
 static swig_type_info _swigt__p_swig__ConstIterator = {"_p_swig__ConstIterator", "swig::ConstIterator *", 0, 0, (void*)0, 0};
 static swig_type_info _swigt__p_swig__GC_VALUE = {"_p_swig__GC_VALUE", "swig::GC_VALUE *", 0, 0, (void*)0, 0};
 static swig_type_info _swigt__p_swig__Iterator = {"_p_swig__Iterator", "swig::Iterator *", 0, 0, (void*)0, 0};
 static swig_type_info _swigt__p_unsigned_char = {"_p_unsigned_char", "unsigned char *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_void = {"_p_void", "VALUE|void *", 0, 0, (void*)0, 0};
 
 static swig_type_info *swig_type_initial[] = {
   &_swigt__p_GeosCoordinateSequence,
@@ -9343,12 +9337,12 @@
   &_swigt__p_GeosWktWriter,
   &_swigt__p_char,
   &_swigt__p_p_GeosLinearRing,
-  &_swigt__p_p_void,
   &_swigt__p_size_t,
   &_swigt__p_swig__ConstIterator,
   &_swigt__p_swig__GC_VALUE,
   &_swigt__p_swig__Iterator,
   &_swigt__p_unsigned_char,
+  &_swigt__p_void,
 };
 
 static swig_cast_info _swigc__p_GeosCoordinateSequence[] = {  {&_swigt__p_GeosCoordinateSequence, 0, 0, 0},{0, 0, 0, 0}};
@@ -9370,12 +9364,12 @@
 static swig_cast_info _swigc__p_GeosWktWriter[] = {  {&_swigt__p_GeosWktWriter, 0, 0, 0},{0, 0, 0, 0}};
 static swig_cast_info _swigc__p_char[] = {  {&_swigt__p_char, 0, 0, 0},{0, 0, 0, 0}};
 static swig_cast_info _swigc__p_p_GeosLinearRing[] = {  {&_swigt__p_p_GeosLinearRing, 0, 0, 0},{0, 0, 0, 0}};
-static swig_cast_info _swigc__p_p_void[] = {  {&_swigt__p_p_void, 0, 0, 0},{0, 0, 0, 0}};
 static swig_cast_info _swigc__p_size_t[] = {  {&_swigt__p_size_t, 0, 0, 0},{0, 0, 0, 0}};
 static swig_cast_info _swigc__p_swig__ConstIterator[] = {  {&_swigt__p_swig__ConstIterator, 0, 0, 0},  {&_swigt__p_swig__Iterator, _p_swig__IteratorTo_p_swig__ConstIterator, 0, 0},{0, 0, 0, 0}};
 static swig_cast_info _swigc__p_swig__GC_VALUE[] = {  {&_swigt__p_swig__GC_VALUE, 0, 0, 0},{0, 0, 0, 0}};
 static swig_cast_info _swigc__p_swig__Iterator[] = {  {&_swigt__p_swig__Iterator, 0, 0, 0},{0, 0, 0, 0}};
 static swig_cast_info _swigc__p_unsigned_char[] = {  {&_swigt__p_unsigned_char, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_void[] = {  {&_swigt__p_void, 0, 0, 0},{0, 0, 0, 0}};
 
 static swig_cast_info *swig_cast_initial[] = {
   _swigc__p_GeosCoordinateSequence,
@@ -9397,12 +9391,12 @@
   _swigc__p_GeosWktWriter,
   _swigc__p_char,
   _swigc__p_p_GeosLinearRing,
-  _swigc__p_p_void,
   _swigc__p_size_t,
   _swigc__p_swig__ConstIterator,
   _swigc__p_swig__GC_VALUE,
   _swigc__p_swig__Iterator,
   _swigc__p_unsigned_char,
+  _swigc__p_void,
 };
 
 



More information about the geos-commits mailing list