ooc-lang / rock

:ocean: self-hosted ooc compiler that generates c99
http://ooc-lang.org/
MIT License
401 stars 40 forks source link

Latest version of rock does not build on windows #976

Open ghost opened 8 years ago

ghost commented 8 years ago

make rescue

/Users/amos/Dev/ooc/rock/sdk/os/native/TerminalWin32.ooc: In function 'os_native_TerminalWin32__TerminalWin32___defaults___impl':
/Users/amos/Dev/ooc/rock/sdk/os/native/TerminalWin32.ooc:85:41: error: '__os_native_TerminalWin32_arrLit1' undeclared (first use in this function)
/Users/amos/Dev/ooc/rock/sdk/os/native/TerminalWin32.ooc:85:41: note: each undeclared identifier is reported only once for each function it appears in
/Users/amos/Dev/ooc/rock/sdk/os/native/TerminalWin32.ooc:85:81: error: '__os_native_TerminalWin32_ptrLit2' undeclared (first use in this function)

error seems to be in rock\build\c-source\ooc\sdk\os\native\TerminalWin32.c , lines 89-98:

void os_native_TerminalWin32__TerminalWin32___defaults___impl(os_native_TerminalWin32__TerminalWin32* this) {
    os_Terminal__TerminalHandler___defaults___impl((os_Terminal__TerminalHandler*) this);
    this->bg = 0;
    this->fg = 8;
    this->colors = (lang_Memory__memcpy(__os_native_TerminalWin32_arrLit1.data, __os_native_TerminalWin32_ptrLit2, 9 * ((lang_types__Class*)lang_Numbers__Int_class())->size), __os_native_TerminalWin32_arrLit1);
    #line 25 "/Users/amos/Dev/ooc/rock/sdk/os/native/TerminalWin32.ooc"
    _lang_array__Array __os_native_TerminalWin32_arrLit1 = _lang_array__Array_new(lang_Numbers__Int, 9);
    #line 25 "/Users/amos/Dev/ooc/rock/sdk/os/native/TerminalWin32.ooc"
    lang_Numbers__Int* __os_native_TerminalWin32_ptrLit2 = (lang_Numbers__Int[]) { 0, 12, 10, 14, 9, 13, 11, 7, 31 };
}

seems like __os_native_TerminalWin32_arrLit1 and __os_native_TerminalWin32_ptrLit2 are used before they are defined.

You can manually fix it and continue with compilation, but it will fail later when compiling TerminalWin32.ooc, so I guess that this file is the real source of the problem.

marcusnaslund commented 8 years ago

This is Windows 10, to be specific, right?

ghost commented 8 years ago

Yes, we have tested on both Windows 10 and Windows 7, with the same reslults.

horasal commented 8 years ago

The same issue: https://github.com/ooc-lang/rock/issues/912 should have been solved by https://github.com/ooc-lang/rock/pull/915 I'm not sure why it appears again. I will take a look at it when I get enough time.