diff options
author | agronholm <none@none> | 2009-10-20 01:56:50 +0300 |
---|---|---|
committer | agronholm <none@none> | 2009-10-20 01:56:50 +0300 |
commit | b2c722a3a23d81a02ec0bd58b91c26e7b9b2fedf (patch) | |
tree | 65d128ef2d0ce45838f6d72eb33cdde1d1306171 /launcher.c | |
parent | 7572da337f94c328f00100dc55f494c9d811f4bd (diff) | |
parent | e6e0e5add9321df50c5da9ee2f1650740024c8ed (diff) | |
download | external_python_setuptools-b2c722a3a23d81a02ec0bd58b91c26e7b9b2fedf.tar.gz external_python_setuptools-b2c722a3a23d81a02ec0bd58b91c26e7b9b2fedf.tar.bz2 external_python_setuptools-b2c722a3a23d81a02ec0bd58b91c26e7b9b2fedf.zip |
Merge with aadeea4644ffb5e0ba24865151dd9315fb961cf1
--HG--
branch : distribute
extra : rebase_source : 71d476c0c54e5cb49de8308f658983f6343bb2d3
Diffstat (limited to 'launcher.c')
-rwxr-xr-x | launcher.c | 25 |
1 files changed, 9 insertions, 16 deletions
@@ -25,9 +25,8 @@ #include <stdlib.h> #include <stdio.h> -#include <process.h> +#include <unistd.h> #include <fcntl.h> -#include "tchar.h" #include "windows.h" int fail(char *format, char *data) { @@ -82,17 +81,18 @@ char *quoted(char *data) { char *loadable_exe(char *exename) { - HINSTANCE hPython; /* DLL handle for python executable */ + /* HINSTANCE hPython; DLL handle for python executable */ char *result; - hPython = LoadLibraryEx(exename, NULL, LOAD_WITH_ALTERED_SEARCH_PATH); - if (!hPython) return NULL; + /* hPython = LoadLibraryEx(exename, NULL, LOAD_WITH_ALTERED_SEARCH_PATH); + if (!hPython) return NULL; */ /* Return the absolute filename for spawnv */ result = calloc(MAX_PATH, sizeof(char)); - if (result) GetModuleFileName(hPython, result, MAX_PATH); + strncpy(result, exename, MAX_PATH); + /*if (result) GetModuleFileName(hPython, result, MAX_PATH); - FreeLibrary(hPython); + FreeLibrary(hPython); */ return result; } @@ -237,18 +237,11 @@ int run(int argc, char **argv, int is_gui) { } /* We *do* need to wait for a CLI to finish, so use spawn */ - return _spawnv(_P_WAIT, ptr, (const char * const *)(newargs)); + return spawnv(P_WAIT, ptr, (const char * const *)(newargs)); } -/* + int WINAPI WinMain(HINSTANCE hI, HINSTANCE hP, LPSTR lpCmd, int nShow) { return run(__argc, __argv, GUI); } -*/ - -int _tmain(int argc, _TCHAR* argv[]) -{ - return run(argc, argv, GUI); -} - |