From bceb2ce9427a340273ba3418fcd75392cf6ab4fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Enrico=20Tr=C3=B6ger?= Date: Fri, 2 Nov 2007 12:58:38 +0000 Subject: [PATCH] Add exit code detection for Windows. git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@2007 ea778897-0a13-0410-b9d1-a72fbfd435f5 --- ChangeLog | 5 +++++ src/build.c | 11 ++++++----- src/makefile.win32 | 7 ++++--- 3 files changed, 15 insertions(+), 8 deletions(-) diff --git a/ChangeLog b/ChangeLog index a825c373..6c634d75 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2007-11-02 Enrico Tröger + + * src/build.c, src/makefile.win32: Add exit code detection for Windows. + + 2007-11-01 Nick Treleaven * src/win32.c: diff --git a/src/build.c b/src/build.c index 21068702..63f523aa 100644 --- a/src/build.c +++ b/src/build.c @@ -39,6 +39,8 @@ # include # include # include +#else +# include #endif #include "prefs.h" @@ -908,11 +910,7 @@ static void show_build_result_message(gboolean failure) } else { -#ifdef G_OS_UNIX msg = _("Compilation finished successfully."); -#else - msg = _("Compilation finished."); // we don't know what the result was on Windows -#endif msgwin_compiler_add(COLOR_BLUE, msg); if (! ui_prefs.msgwindow_visible || gtk_notebook_get_current_page(GTK_NOTEBOOK(msgwindow.notebook)) != MSG_COMPILER) @@ -942,7 +940,10 @@ static void build_exit_cb(GPid child_pid, gint status, gpointer user_data) } show_build_result_message(failure); #else - show_build_result_message(FALSE); + DWORD exit_code; + GetExitCodeProcess(child_pid, &exit_code); + // not sure whether the cast to int is necessary, no idea what DWORD really is (seems like int) + show_build_result_message((int) exit_code); #endif utils_beep(); diff --git a/src/makefile.win32 b/src/makefile.win32 index ff0a17f3..4b09eccb 100644 --- a/src/makefile.win32 +++ b/src/makefile.win32 @@ -36,6 +36,7 @@ ALL_GTK_LIBS= \ -L"$(PREFIX)/lib" \ -lgtk-win32-2.0 -lgdk-win32-2.0 -latk-1.0 -lgdk_pixbuf-2.0 -lpangowin32-1.0 -lgdi32 \ -lpango-1.0 -lgobject-2.0 -lgmodule-2.0 -lgthread-2.0 -lglib-2.0 -lintl -liconv + #-lcairo -lpangocairo-1.0 # these things are for GTK >= 2.8 # (should be same as with MSYS: pkg-config --libs gtk+-2.0 gthread-2.0) #"$(PREFIX)/lib/libcairo.dll.a" \ @@ -46,8 +47,8 @@ CCFLAGS=-Wall -O2 -g -mms-bitfields $(DEFINES) $(INCLUDEDIRS) OBJS = about.o build.o callbacks.o dialogs.o document.o editor.o encodings.o filetypes.o \ geanyobject.o highlighting.o interface.o keybindings.o keyfile.o main.o msgwindow.o \ - navqueue.o notebook.o plugins.o prefs.o project.o sciwrappers.o search.o socket.o \ - support.o symbols.o templates.o treeviews.o tools.o ui_utils.o utils.o win32.o + navqueue.o notebook.o plugins.o prefs.o project.o sciwrappers.o search.o \ + socket.o support.o symbols.o templates.o treeviews.o tools.o ui_utils.o utils.o win32.o .c.o: $(CC) $(CCFLAGS) -c $< @@ -72,7 +73,7 @@ binclean: $(TARGET): $(OBJS) $(RES) ../scintilla/scintilla.a ../tagmanager/tagmanager.a $(CXX) $(OBJS) $(RES) -o $(TARGET) \ ../scintilla/scintilla.a ../tagmanager/tagmanager.a $(ALL_GTK_LIBS) \ - -mwindows -limm32 -lshell32 -lole32 -luuid -lcomdlg32 -lcomctl32 -liberty -lwsock32 + -mwindows -lkernel32 -limm32 -lshell32 -lole32 -luuid -lcomdlg32 -lcomctl32 -liberty -lwsock32 deps.mak: $(CC) -MM $(CCFLAGS) *.c >deps.mak