Skip to content

Commit

Permalink
Update macros/ruby.m4 for ruby 1.9.x
Browse files Browse the repository at this point in the history
Used RbConfig instead of obsolete and deprecated Config.
Updated SWIG generated files.

Patch by Kashif Rasul <[email protected]>

git-svn-id: http://svn.osgeo.org/geos/trunk@3772 5242fede-7e19-0410-aef8-94bd7d2200fb
  • Loading branch information
Sandro Santilli committed Feb 25, 2013
1 parent a8c7043 commit 238f475
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 46 deletions.
14 changes: 7 additions & 7 deletions macros/ruby.m4
Original file line number Diff line number Diff line change
Expand Up @@ -23,25 +23,25 @@ AC_DEFUN([AC_RUBY_DEVEL],
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'])
Expand Down
72 changes: 33 additions & 39 deletions swig/ruby/geos_wrap.cxx
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -305,7 +305,7 @@ template <typename T> T SwigValueInit() {
/*
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).

Expand Down Expand Up @@ -855,6 +855,15 @@ SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name) {

#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
Expand Down Expand Up @@ -1013,7 +1022,7 @@ static VALUE _mSWIG = Qnil;

/* 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) {
Expand Down Expand Up @@ -1158,9 +1167,6 @@ void Ruby_Format_OverloadedError(
}

/* -----------------------------------------------------------------------------
* 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
Expand Down Expand Up @@ -1356,9 +1362,6 @@ SWIG_Ruby_AppendOutput(VALUE target, VALUE o) {


/* -----------------------------------------------------------------------------
* 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
Expand Down Expand Up @@ -1402,7 +1405,7 @@ SWIG_Ruby_AppendOutput(VALUE target, VALUE o) {
/* 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


Expand Down Expand Up @@ -1457,7 +1460,7 @@ static ID swig_call_id = 0;
++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;

Expand Down Expand Up @@ -1832,12 +1835,12 @@ int SWIG_Ruby_arity( VALUE proc, int minimal )
#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)
Expand All @@ -1854,7 +1857,7 @@ static VALUE mGeos;
#define SWIG_RUBY_THREAD_END_BLOCK


#define SWIGVERSION 0x010340
#define SWIGVERSION 0x020004
#define SWIG_VERSION SWIGVERSION


Expand Down Expand Up @@ -2150,6 +2153,7 @@ namespace swig {

#include <string>
#include <stdexcept>
#include <stddef.h>


namespace swig {
Expand Down Expand Up @@ -2415,7 +2419,7 @@ SWIG_ruby_failed(void)
}


/*@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];
Expand Down Expand Up @@ -2461,7 +2465,7 @@ SWIG_From_bool (bool value)
}


/*@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];
Expand Down Expand Up @@ -2644,7 +2648,7 @@ SWIGINTERN GeosCoordinateSequence *GeosCoordinateSequence_clone(GeosCoordinateSe
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];
Expand Down Expand Up @@ -3346,19 +3350,14 @@ Inspect class and its contents.
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;
Expand All @@ -3379,19 +3378,14 @@ Convert class to a String representation.
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;
Expand Down Expand Up @@ -9316,12 +9310,12 @@ static swig_type_info _swigt__p_GeosWktReader = {"_p_GeosWktReader", "GeosWktRea
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,
Expand All @@ -9343,12 +9337,12 @@ static swig_type_info *swig_type_initial[] = {
&_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}};
Expand All @@ -9370,12 +9364,12 @@ static swig_cast_info _swigc__p_GeosWktReader[] = { {&_swigt__p_GeosWktReader,
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,
Expand All @@ -9397,12 +9391,12 @@ static swig_cast_info *swig_cast_initial[] = {
_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,
};


Expand Down

0 comments on commit 238f475

Please sign in to comment.