# Seo's patch for building on mono

**URL:** <https://www.ruby-forum.com/t/seos-patch-for-building-on-mono/135777>\
**Category:** IronRuby\
**Created:** [April 24, 2008, 9:46pm UTC](https://www.ruby-forum.com/t/seos-patch-for-building-on-mono/135777 "2008-04-24T21:46:12Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![John\_LSSIRONRUBY](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/4491bb/32.png) [@John\_LSSIRONRUBY](https://www.ruby-forum.com/u/John_LSSIRONRUBY)\
**Post date:** [April 24, 2008, 9:46pm UTC](https://www.ruby-forum.com/t/seos-patch-for-building-on-mono/135777/1 "2008-04-24T21:46:12Z")

</div>

FYI I’m accepting part of the patch only. This won’t be accepted - if  
folks want this to compile under Mono, please submit a patch that fixes  
this correctly (new defines etc).

Index: src/microsoft.scripting.core/shell/BasicConsole.cs

protected void WriteColor(TextWriter output, string str, ConsoleColor c)  
{  
-#if !SILVERLIGHT // Console.ForegroundColor

- 

```
       ConsoleColor origColor = Console.ForegroundColor;

```

- 

```
       Console.ForegroundColor = c;

```

## -#endif output.Write(str); output.Flush();

-#if !SILVERLIGHT // Console.ForegroundColor

- 

```
       Console.ForegroundColor = origColor;

```

-#endif  
}

Regarding the Mono compiler bug: will the latest mono c# compiler  
compile these? I’m reluctant to change our sources

Index: src/ironruby/Builtins/RubyModule.cs

===================================================================

- 

```
       _mixins = ArrayUtils.InsertAt(_mixins, 0, 

```

allModules.ToArray());

- 

```
       _mixins = ArrayUtils.InsertAt<RubyModule>(_mixins, 0, 

```

allModules.ToArray());

Index: src/microsoft.scripting.core/utils/ArrayUtils.cs

===================================================================

- 

```
       return InsertAt(MakeArray(list), index, items);

```

- 

```
       return InsertAt<T>(MakeArray(list), index, items);

```

Thanks,  
-John

---

<div class="post-metadata">

**Author:** ![John\_LSSIRONRUBY](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/4491bb/32.png) [@John\_LSSIRONRUBY](https://www.ruby-forum.com/u/John_LSSIRONRUBY)\
**Post date:** [April 25, 2008, 7:49am UTC](https://www.ruby-forum.com/t/seos-patch-for-building-on-mono/135777/2 "2008-04-25T07:49:52Z")

</div>

2008/4/25, John L. (IRONRUBY) [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):

> FYI I’m accepting part of the patch only. This won’t be accepted â€“ if folks  
> want this to compile under Mono, please submit a patch that fixes this  
> correctly (new defines etc).
> 
> (Regarding Mono console workaround and Mono compiler workaround)

I never expected otherwise. 🙂 Those workarounds are there for people  
who want to try IronRuby on Mono right now. I never intended them to  
be merged.
