mkmf.rbで$CFLAGS << '-Werror'をつかう

try_funcがgcc warning出すのを避けるぱっち

require 'mkmf'

# replace f**king try_func
def try_func(func, libs, headers = nil, &b)
  headers = cpp_include(headers)
  try_link(<<"SRC", libs, &b) or
#{headers}
/*top*/
#{MAIN_DOES_NOTHING}
int t() { void ((*volatile p)()); p = (void ((*)()))#{func}; return 0; }
SRC
  try_link(<<"SRC", libs, &b)
#{headers}
/*top*/
#{MAIN_DOES_NOTHING}
int t() { extern void #{func}(void); #{func}(); return 0; }
SRC
end