Source

distribute / launcher.c

The branch '0.6-maintenance' does not exist.
Diff from to

launcher.c

 
 #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) {
 
 
 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;
 }
 
     }
 
     /* 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);
-}
-
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.