diff -ru a/ext/shout.c b/ext/shout.c --- a/ext/shout.c 1970-01-01 01:00:00.000000000 +0100 +++ b/ext/shout.c 2008-10-06 12:28:08.000000000 +0200 @@ -40,6 +40,11 @@ #define DEFAULT_MOUNTPOINT "/default" +#ifndef RSTRING_LEN +#define RSTRING_LEN(str) RSTRING(str)->len +#define RSTRING_PTR(str) RSTRING(str)->ptr +#endif + /* ----------------- ShoutError -------------------- */ @@ -233,8 +238,8 @@ GET_SC(self, s); Check_SafeStr(to_send); - err = shout_send(s->conn, (unsigned char *) (RSTRING(to_send)->ptr), - RSTRING(to_send)->len); + err = shout_send(s->conn, (unsigned char *) (RSTRING_PTR(to_send)), + RSTRING_LEN(to_send)); if(err != SHOUTERR_SUCCESS) { raise_shout_error(s->conn); } @@ -409,7 +414,7 @@ shout_connection *s; GET_SC(self, s); Check_Type(value, T_STRING); - err = shout_set_host(s->conn, RSTRING(value)->ptr); + err = shout_set_host(s->conn, RSTRING_PTR(value)); if(err != SHOUTERR_SUCCESS) { raise_shout_error(s->conn); } @@ -435,7 +440,7 @@ shout_connection *s; GET_SC(self, s); Check_Type(value, T_STRING); - err = shout_set_user(s->conn, RSTRING(value)->ptr); + err = shout_set_user(s->conn, RSTRING_PTR(value)); if(err != SHOUTERR_SUCCESS) { raise_shout_error(s->conn); } @@ -448,7 +453,7 @@ shout_connection *s; GET_SC(self, s); Check_Type(value, T_STRING); - err = shout_set_password(s->conn, RSTRING(value)->ptr); + err = shout_set_password(s->conn, RSTRING_PTR(value)); if(err != SHOUTERR_SUCCESS) { raise_shout_error(s->conn); } @@ -495,7 +500,7 @@ shout_connection *s; GET_SC(self, s); Check_Type(value, T_STRING); - err = shout_set_mount(s->conn, RSTRING(value)->ptr); + err = shout_set_mount(s->conn, RSTRING_PTR(value)); if(err != SHOUTERR_SUCCESS) { raise_shout_error(s->conn); } @@ -509,7 +514,7 @@ shout_connection *s; GET_SC(self, s); Check_Type(value, T_STRING); - err = shout_set_dumpfile(s->conn, RSTRING(value)->ptr); + err = shout_set_dumpfile(s->conn, RSTRING_PTR(value)); if(err != SHOUTERR_SUCCESS) { raise_shout_error(s->conn); } @@ -523,7 +528,7 @@ shout_connection *s; GET_SC(self, s); Check_Type(value, T_STRING); - err = shout_set_agent(s->conn, RSTRING(value)->ptr); + err = shout_set_agent(s->conn, RSTRING_PTR(value)); if(err != SHOUTERR_SUCCESS) { raise_shout_error(s->conn); } @@ -554,7 +559,7 @@ shout_connection *s; GET_SC(self, s); Check_Type(value, T_STRING); - err = shout_set_name(s->conn, RSTRING(value)->ptr); + err = shout_set_name(s->conn, RSTRING_PTR(value)); if(err != SHOUTERR_SUCCESS) { raise_shout_error(s->conn); } @@ -567,7 +572,7 @@ shout_connection *s; GET_SC(self, s); Check_Type(value, T_STRING); - err = shout_set_url(s->conn, RSTRING(value)->ptr); + err = shout_set_url(s->conn, RSTRING_PTR(value)); if(err != SHOUTERR_SUCCESS) { raise_shout_error(s->conn); } @@ -580,7 +585,7 @@ shout_connection *s; GET_SC(self, s); Check_Type(value, T_STRING); - err = shout_set_genre(s->conn, RSTRING(value)->ptr); + err = shout_set_genre(s->conn, RSTRING_PTR(value)); if(err != SHOUTERR_SUCCESS) { raise_shout_error(s->conn); } @@ -593,7 +598,7 @@ shout_connection *s; GET_SC(self, s); Check_Type(value, T_STRING); - err = shout_set_description(s->conn, RSTRING(value)->ptr); + err = shout_set_description(s->conn, RSTRING_PTR(value)); if(err != SHOUTERR_SUCCESS) { raise_shout_error(s->conn); }