updates for new cygwin gcc's

This commit is contained in:
Josh Holtrop 2013-10-18 15:41:58 -04:00
parent 6bd67c3d1f
commit e959d11cd0
2 changed files with 8 additions and 6 deletions

View File

@ -1,8 +1,9 @@
TARGET := gvim-wrapper
CFLAGS := -mno-cygwin -std=gnu99 -mwindows
LDFLAGS := -mno-cygwin -mwindows
CFLAGS := -std=gnu99 -mwindows
LDFLAGS := -mwindows -static-libgcc -static-libstdc++
INSTALL_DIR ?= /c/apps/bin
CXX := i686-pc-mingw32-g++
all: $(TARGET)

View File

@ -1,4 +1,5 @@
#include <unistd.h>
#include <string.h>
#include <string>
using namespace std;
@ -11,12 +12,12 @@ int main(int argc, char *argv[])
(pos != string::npos)
? program_name.substr(0, pos) + "/gvim-wrapper.py"
: "gvim-wrapper.py";
const char **new_argv = new const char *[argc + 2];
char **new_argv = new char *[argc + 2];
memcpy(&new_argv[2], &argv[1], argc * sizeof(new_argv[0]));
new_argv[0] = "pythonw.exe";
new_argv[1] = script_path.c_str();
new_argv[0] = (char *)"pythonw.exe";
new_argv[1] = (char *)script_path.c_str();
new_argv[argc + 1] = NULL;
argv[0] = "gvim-wrapper.py";
argv[0] = (char *)"gvim-wrapper.py";
execvp("pythonw.exe", new_argv);
return -1;
}