88
99VALUE rb_cLDAP_Entry ;
1010
11- #if RUBY_VERSION_CODE >= 190
11+ #if defined( RB_LDAP_RVC ) && RB_LDAP_RVC >= 10900
1212static void
1313rb_ldap_entry_mark (RB_LDAPENTRY_DATA * edata )
1414{
@@ -88,11 +88,11 @@ rb_ldap_entry_new (LDAP * ldap, LDAPMessage * msg)
8888{
8989 VALUE val ;
9090 RB_LDAPENTRY_DATA * edata ;
91- #if RUBY_VERSION_CODE >= 190
91+ #if defined( RB_LDAP_RVC ) && RB_LDAP_RVC >= 10900
9292 char * c_dn ;
9393#endif
9494
95- #if RUBY_VERSION_CODE >= 190
95+ #if defined( RB_LDAP_RVC ) && RB_LDAP_RVC >= 10900
9696 val = Data_Make_Struct (rb_cLDAP_Entry , RB_LDAPENTRY_DATA ,
9797 rb_ldap_entry_mark , rb_ldap_entry_free , edata );
9898#else
@@ -102,7 +102,7 @@ rb_ldap_entry_new (LDAP * ldap, LDAPMessage * msg)
102102 edata -> ldap = ldap ;
103103 edata -> msg = msg ;
104104
105- #if RUBY_VERSION_CODE >= 190
105+ #if defined( RB_LDAP_RVC ) && RB_LDAP_RVC >= 10900
106106 /* get dn */
107107 c_dn = ldap_get_dn (ldap , msg );
108108 if (c_dn ) {
@@ -128,14 +128,14 @@ VALUE
128128rb_ldap_entry_get_dn (VALUE self )
129129{
130130 RB_LDAPENTRY_DATA * edata ;
131- #if RUBY_VERSION_CODE < 190
131+ #if defined( RB_LDAP_RVC ) && RB_LDAP_RVC < 10900
132132 char * cdn ;
133133 VALUE dn ;
134134#endif
135135
136136 GET_LDAPENTRY_DATA (self , edata );
137137
138- #if RUBY_VERSION_CODE < 190
138+ #if defined( RB_LDAP_RVC ) && RB_LDAP_RVC < 10900
139139 cdn = ldap_get_dn (edata -> ldap , edata -> msg );
140140 if (cdn )
141141 {
@@ -166,7 +166,7 @@ VALUE
166166rb_ldap_entry_get_values (VALUE self , VALUE attr )
167167{
168168 RB_LDAPENTRY_DATA * edata ;
169- #if RUBY_VERSION_CODE < 190
169+ #if defined( RB_LDAP_RVC ) && RB_LDAP_RVC < 10900
170170 char * c_attr ;
171171 struct berval * * c_vals ;
172172 int i ;
@@ -175,7 +175,7 @@ rb_ldap_entry_get_values (VALUE self, VALUE attr)
175175#endif
176176
177177 GET_LDAPENTRY_DATA (self , edata );
178- #if RUBY_VERSION_CODE < 190
178+ #if defined( RB_LDAP_RVC ) && RB_LDAP_RVC < 10900
179179 c_attr = StringValueCStr (attr );
180180
181181 c_vals = ldap_get_values_len (edata -> ldap , edata -> msg , c_attr );
@@ -213,7 +213,7 @@ VALUE
213213rb_ldap_entry_get_attributes (VALUE self )
214214{
215215 RB_LDAPENTRY_DATA * edata ;
216- #if RUBY_VERSION_CODE < 190
216+ #if defined( RB_LDAP_RVC ) && RB_LDAP_RVC < 10900
217217 VALUE vals ;
218218 char * attr ;
219219 BerElement * ber = NULL ;
@@ -223,7 +223,7 @@ rb_ldap_entry_get_attributes (VALUE self)
223223
224224 GET_LDAPENTRY_DATA (self , edata );
225225
226- #if RUBY_VERSION_CODE < 190
226+ #if defined( RB_LDAP_RVC ) && RB_LDAP_RVC < 10900
227227 vals = rb_ary_new ();
228228 for (attr = ldap_first_attribute (edata -> ldap , edata -> msg , & ber );
229229 attr != NULL ;
@@ -259,7 +259,7 @@ rb_ldap_entry_get_attributes (VALUE self)
259259VALUE
260260rb_ldap_entry_to_hash (VALUE self )
261261{
262- #if RUBY_VERSION_CODE < 190
262+ #if defined( RB_LDAP_RVC ) && RB_LDAP_RVC < 10900
263263 VALUE attrs = rb_ldap_entry_get_attributes (self );
264264 VALUE hash = rb_hash_new ();
265265 VALUE attr , vals ;
@@ -269,7 +269,7 @@ rb_ldap_entry_to_hash (VALUE self)
269269 VALUE hash , dn_ary ;
270270#endif
271271
272- #if RUBY_VERSION_CODE < 190
272+ #if defined( RB_LDAP_RVC ) && RB_LDAP_RVC < 10900
273273 Check_Type (attrs , T_ARRAY );
274274 rb_hash_aset (hash , rb_tainted_str_new2 ("dn" ),
275275 rb_ary_new3 (1 , rb_ldap_entry_get_dn (self )));
@@ -305,7 +305,7 @@ rb_ldap_entry_inspect (VALUE self)
305305 str = rb_str_new (0 , strlen (c ) + 10 + 16 + 1 ); /* 10:tags 16:addr 1:nul */
306306 sprintf (RSTRING_PTR (str ), "#<%s:0x%lx\n" , c , self );
307307
308- #if RUBY_VERSION_CODE < 190
308+ #if defined( RB_LDAP_RVC ) && RB_LDAP_RVC < 10900
309309 RSTRING (str )-> len = strlen (RSTRING_PTR (str ));
310310#else
311311 rb_str_set_len (str , strlen (RSTRING_PTR (str )));
0 commit comments