neovim/neovim — pull request #810 by equalsraf (2014-06-04 21:05:16+00:00)
Title: [WIP] Compiling under Windows (Mingw)

I realise there have been a couple of issues on this (#328), but since I've not been very successful with #696 so far, and over the last couple of days I also found that:

* libuv DOES build with Mingw
* luajit/luarocks also builds with Mingw
* msgpack-c needs some help but it also builds with Mingw (check my personal branch or msgpack-c issue tracker)

It sudently seems more plausible to get Neovim to build on Windows with Mingw than with MSVC. So far I've been able to go further than #696, my last error was

```
[ 12%] Building C object src/nvim/CMakeFiles/nvim.dir/ex_cmds2.c.obj
C:\Users\raf\dev\neovim\src\nvim\ex_cmds2.c: In function 'get_mess_lang':
C:\Users\raf\dev\neovim\src\nvim\ex_cmds2.c:3270:3: error: pointer targets in passing argument 1 of 'os_getenv' d
iffer in signedness [-Werror=pointer-sign]
p = os_getenv((char_u *)"LC_ALL");
^
In file included from C:/Users/raf/dev/neovim/src/nvim/fileio.h:5:0,
from C:\Users\raf\dev\neovim\src\nvim\ex_cmds2.c:25:
C:/Users/raf/dev/neovim/src/nvim/os/os.h:89:13: note: expected 'const char *' but argument is of type 'char_u *'
const char *os_getenv(const char *name);
^
C:\Users\raf\dev\neovim\src\nvim\ex_cmds2.c:3270:5: error: assignment discards 'const' qualifier from pointer tar
get type [-Werror]
p = os_getenv((char_u *)"LC_ALL");
^
C:\Users\raf\dev\neovim\src\nvim\ex_cmds2.c:3272:5: error: pointer targets in passing argument 1 of 'os_getenv' d
iffer in signedness [-Werror=pointer-sign]
p = os_getenv((char_u *)"LC_MESSAGES");
^
In file included from C:/Users/raf/dev/neovim/src/nvim/fileio.h:5:0,
from C:\Users\raf\dev\neovim\src\nvim\ex_cmds2.c:25:
C:/Users/raf/dev/neovim/src/nvim/os/os.h:89:13: note: expected 'const char *' but argument is of type 'char_u *'
const char *os_getenv(const char *name);
^
C:\Users\raf\dev\neovim\src\nvim\ex_cmds2.c:3272:7: error: assignment discards 'const' qualifier from pointer tar
get type [-Werror]
p = os_getenv((char_u *)"LC_MESSAGES");
^
C:\Users\raf\dev\neovim\src\nvim\ex_cmds2.c:3274:7: error: pointer targets in passing argument 1 of 'os_getenv' d
iffer in signedness [-Werror=pointer-sign]
p = os_getenv((char_u *)"LANG");
^
```

If anyone is interested in giving it a shot, some quick details about my setup:

* I'm using mingw-w64 (i686-4.8.2-posix-sjlj-rt_v3-rev4)
* CMake generator is "Mingw Makefiles" just run mingw32-make
* I'm building dependencies by hand - I have a [gist](https://gist.github.com/equalsraf/ca3076a1f67e7a494ba3) with some details
* I am using a build of PDCurses, but if anyone can point me to a prepackaged curses for Mingw I would appreciate it (for some reason I can only find NCurses Wide char variant)

Don't take the attached code commits too seriously I was just trying to go as far as possible, namely I did some things I will regret later:

* Not sure how to typedef **uid_t** used uv_uid_t
* Will have to take a closer look at things like VIMINFO_FILE for windows
* I disabled some code for signals(?) with #ifdef WIN32
* I commented out some lines in config.h.in - but these need to be turned into proper checks