-#if defined(__CMDMAC__)
- rb_define_const(rb_mMolby, "HasGUI", Qfalse);
-#else
- rb_define_const(rb_mMolby, "HasGUI", Qtrue);
-#endif
-
-#if !__CMDMAC__
-
- /* Create objects for stdout and stderr */
- val = rb_funcall(rb_cObject, rb_intern("new"), 0);
- rb_define_singleton_method(val, "write", s_StandardOutput, 1);
- rb_define_singleton_method(val, "flush", s_FlushConsoleOutput, 0);
- rb_gv_set("$stdout", val);
- val = rb_funcall(rb_cObject, rb_intern("new"), 0);
- rb_define_singleton_method(val, "write", s_StandardErrorOutput, 1);
- rb_define_singleton_method(val, "flush", s_FlushConsoleOutput, 0);
- rb_gv_set("$stderr", val);
-
- /* Create objects for stdin */
- val = rb_funcall(rb_cObject, rb_intern("new"), 0);
- rb_define_singleton_method(val, "gets", s_StandardInputGets, -1);
- rb_define_singleton_method(val, "readline", s_StandardInputGets, -1);
- rb_define_singleton_method(val, "method_missing", s_StandardInputMethodMissing, -1);
- rb_gv_set("$stdin", val);
-
-#endif
+ if (gUseGUI)
+ rb_define_const(rb_mMolby, "HasGUI", Qtrue);
+ else
+ rb_define_const(rb_mMolby, "HasGUI", Qfalse);
+
+ {
+ /* Create objects for stdout and stderr */
+ val = rb_funcall(rb_cObject, rb_intern("new"), 0);
+ rb_define_singleton_method(val, "write", s_StandardOutput, 1);
+ rb_define_singleton_method(val, "flush", s_FlushConsoleOutput, 0);
+ rb_gv_set("$stdout", val);
+ val = rb_funcall(rb_cObject, rb_intern("new"), 0);
+ rb_define_singleton_method(val, "write", s_StandardErrorOutput, 1);
+ rb_define_singleton_method(val, "flush", s_FlushConsoleOutput, 0);
+ rb_gv_set("$stderr", val);
+
+ /* Create objects for stdin */
+ val = rb_funcall(rb_cObject, rb_intern("new"), 0);
+ rb_define_singleton_method(val, "gets", s_StandardInputGets, -1);
+ rb_define_singleton_method(val, "readline", s_StandardInputGets, -1);
+ rb_define_singleton_method(val, "method_missing", s_StandardInputMethodMissing, -1);
+ rb_gv_set("$stdin", val);
+ }