From: Mark Somerville <mark@scottishclimbs.com>
Date: Wed, 3 Mar 2010 10:36:44 +0000
Subject: [PATCH] Ruby 1.9.2 compatibility: STR2CSTR becomes StringValuePtr.

Origin: https://github.com/Spakman/ruby-gd/commit/eea4275372a53790d74d07d9c2dafc8e7565a0d4
---
 GD.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/GD.c b/GD.c
index 3ccd84f..d019b21 100644
--- a/GD.c
+++ b/GD.c
@@ -86,7 +86,7 @@ img_from_pngfname(klass, fname)
     
     Check_Type(fname, T_STRING);
 
-    f = rb_file_open(STR2CSTR(fname), "r");
+    f = rb_file_open(StringValuePtr(fname), "r");
     rb_io_binmode(f);
     GetOpenFile(f, fptr);
     rb_io_check_readable(fptr);
@@ -129,7 +129,7 @@ img_from_giffname(klass, fname)
     
     Check_Type(fname, T_STRING);
 
-    f = rb_file_open(STR2CSTR(fname), "r");
+    f = rb_file_open(StringValuePtr(fname), "r");
     rb_io_binmode(f);
     GetOpenFile(f, fptr);
     rb_io_check_readable(fptr);
@@ -171,7 +171,7 @@ img_from_gdfname(klass, fname)
     
     Check_Type(fname, T_STRING);
 
-    f = rb_file_open(STR2CSTR(fname), "r");
+    f = rb_file_open(StringValuePtr(fname), "r");
     rb_io_binmode(f);
     GetOpenFile(f, fptr);
     rb_io_check_readable(fptr);
@@ -211,7 +211,7 @@ img_from_gd2fname(klass, fname)
     
     Check_Type(fname, T_STRING);
 
-    f = rb_file_open(STR2CSTR(fname), "r");
+    f = rb_file_open(StringValuePtr(fname), "r");
     rb_io_binmode(f);
     GetOpenFile(f, fptr);
     rb_io_check_readable(fptr);
@@ -252,7 +252,7 @@ img_from_gd2_partfname(klass, fname, srcx, srcy, w, h)
     
     Check_Type(fname, T_STRING);
 
-    f = rb_file_open(STR2CSTR(fname), "r");
+    f = rb_file_open(StringValuePtr(fname), "r");
     rb_io_binmode(f);
     GetOpenFile(f, fptr);
     rb_io_check_readable(fptr);
@@ -315,7 +315,7 @@ img_from_xbmfname(klass, fname)
     
     Check_Type(fname, T_STRING);
 
-    f = rb_file_open(STR2CSTR(fname), "r");
+    f = rb_file_open(StringValuePtr(fname), "r");
     rb_io_binmode(f);
     GetOpenFile(f, fptr);
     rb_io_check_readable(fptr);
@@ -358,7 +358,7 @@ img_from_xpmfname(klass, fname)
     
     Check_Type(fname, T_STRING);
 
-    f = rb_file_open(STR2CSTR(fname), "r");
+    f = rb_file_open(StringValuePtr(fname), "r");
     rb_io_binmode(f);
     GetOpenFile(f, fptr);
     rb_io_check_readable(fptr);
@@ -403,7 +403,7 @@ img_from_jpegfname(klass, fname)
     
     Check_Type(fname, T_STRING);
 
-    f = rb_file_open(STR2CSTR(fname), "r");
+    f = rb_file_open(StringValuePtr(fname), "r");
     rb_io_binmode(f);
     GetOpenFile(f, fptr);
     rb_io_check_readable(fptr);
