Created
June 6, 2012 19:08
-
-
Save djberg96/2883992 to your computer and use it in GitHub Desktop.
Ruby 1.9.3 is driving me insane
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# extconf.rb | |
require 'mkmf' | |
$CFLAGS += " -std=c99" # Doesn't help | |
create_makefile('foo') | |
# foo.c | |
#include "ruby.h" | |
static VALUE foo_bar(VALUE self){ | |
const char* bar = "bar"; | |
printf("We here?\n"); | |
VALUE val = rb_str_new2(bar); | |
return val; | |
} | |
void Init_foo(){ | |
VALUE cFoo = rb_define_class("Foo", rb_cObject); | |
rb_define_method(cFoo, "bar", foo_bar, 0); | |
} | |
# Output of ruby-1.9.3-p194 when I run "ruby extconf.rb" | |
foo.c: In function ‘foo_bar’: | |
foo.c:6: warning: ISO C90 forbids mixed declarations and code |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment