diff --git a/Makefile b/Makefile index 2f4a1ff..6f4497f 100644 --- a/Makefile +++ b/Makefile @@ -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) diff --git a/gvim-wrapper.cc b/gvim-wrapper.cc index 98c21b2..c8c168c 100644 --- a/gvim-wrapper.cc +++ b/gvim-wrapper.cc @@ -1,4 +1,5 @@ #include +#include #include 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; }