diff options
author | Arnel A. Borja <kyoushuu@yahoo.com> | 2012-09-30 18:33:56 +0800 |
---|---|---|
committer | Jürg Billeter <j@bitron.ch> | 2012-11-03 07:37:02 +0100 |
commit | fd2b222a9ad7382bf0f802d50a9702d455195ef3 (patch) | |
tree | a7bc28bbdd0bd1f6b4268f71fe3899473d70a89b /gobject-introspection | |
parent | 3efecce2f21e0cdc97f4633cfda52eb0d9ea1ab8 (diff) | |
download | vala-fd2b222a9ad7382bf0f802d50a9702d455195ef3.tar.gz |
Fix build for Windows
- Replace POSIX calls for spawning process with functions from Windows
API when compiling for Windows
- Add EXEEXT to valac and vapigen paths
- Remove EXEEXT from scripts
Fixes bug 685180.
Diffstat (limited to 'gobject-introspection')
-rw-r--r-- | gobject-introspection/scanner.c | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/gobject-introspection/scanner.c b/gobject-introspection/scanner.c index dcaa01c1b..ced13f4a6 100644 --- a/gobject-introspection/scanner.c +++ b/gobject-introspection/scanner.c @@ -31,7 +31,6 @@ #include <glib/gstdio.h> #include <glib-object.h> #include <signal.h> -#include <sys/wait.h> /* waitpid */ #include <gmodule.h> #include "scanner.h" #include "gidlparser.h" @@ -40,6 +39,10 @@ #include "gidlwriter.h" #include "grealpath.h" +#ifndef _WIN32 +#include <sys/wait.h> /* waitpid */ +#endif + typedef GType (*TypeFunction) (void); @@ -1600,12 +1603,28 @@ g_igenerator_start_preprocessor (GIGenerator *igenerator, close (cpp_out); +#ifndef _WIN32 if (waitpid (pid, &status, 0) > 0) +#else + /* We don't want to include <windows.h> as it clashes horribly + * with token names from scannerparser.h. So just declare + * WaitForSingleObject, GetExitCodeProcess and INFINITE here. + */ + extern unsigned long __stdcall WaitForSingleObject(void*, int); + extern int __stdcall GetExitCodeProcess(void*, int*); +#define INFINITE 0xffffffff + + WaitForSingleObject (pid, INFINITE); + + if (GetExitCodeProcess (pid, &status)) +#endif { if (status != 0) { g_spawn_close_pid (pid); +#ifndef _WIN32 kill (pid, SIGKILL); +#endif g_error ("cpp returned error code: %d\n", status); unlink (tmpname); |