From: "Iñaki Baz Castillo" Date: 2012-05-28T19:57:06+09:00 Subject: [C exten] extconf.rg and #ifdef Hi, depending whether my Ruby C extension is being compiled on *nix or Windows, I need some #defines (i.e: OS_UNIX or OS_WIN). I see no way in MKMF documentation to generate a #define (based on RbConfig["host_os"] for example). I've seen some "hacks" in extconf.rb like this: --------------------------------------- def add_define(name) $defs.push("-D#{name}") end # If I'm on *nix: add_define "OS_UNIX" --------------------------------------- Is this the most ellegant way? any other solution? Thanks a lot. -- Iñaki Baz Castillo