Top Level Namespace
Defined Under Namespace
Modules: Curl
Instance Method Summary collapse
- #define(s) ⇒ Object
- #have_constant(name) ⇒ Object
-
#test_for(name, const, src) ⇒ Object
do some checking to detect ruby 1.8 hash.c vs ruby 1.9 hash.c.
Instance Method Details
#define(s) ⇒ Object
17 18 19 |
# File 'ext/extconf.rb', line 17 def define(s) $defs.push( format("-D HAVE_%s", s.to_s.upcase) ) end |
#have_constant(name) ⇒ Object
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'ext/extconf.rb', line 21 def have_constant(name) checking_for name do src = %{ #include <curl/curl.h> int main() { int test = (int)#{name.upcase}; return 0; } } if try_compile(src,"#{$CFLAGS} #{$LIBS}") define name true else false end end end |
#test_for(name, const, src) ⇒ Object
do some checking to detect ruby 1.8 hash.c vs ruby 1.9 hash.c
104 105 106 107 108 109 110 111 112 113 |
# File 'ext/extconf.rb', line 104 def test_for(name, const, src) checking_for name do if try_compile(src,"#{$CFLAGS} #{$LIBS}") define const true else false end end end |