summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: e29cb04)
raw | patch | inline | side by side (parent: e29cb04)
author | Krzysztof Kosiński <tweenk.pl@gmail.com> | |
Fri, 5 Mar 2010 22:44:33 +0000 (23:44 +0100) | ||
committer | Krzysztof Kosiński <tweenk.pl@gmail.com> | |
Fri, 5 Mar 2010 22:44:33 +0000 (23:44 +0100) |
diff --git a/src/Makefile.am b/src/Makefile.am
index 92e520e5b9e82dff7ade8d193c18028991418678..ff5d20f49d1da7b6e526c8ad997a70161942370c 100644 (file)
--- a/src/Makefile.am
+++ b/src/Makefile.am
if PLATFORM_WIN32
win32_sources = winmain.cpp registrytool.cpp registrytool.h
-win32ldflags = -lcomdlg32
+win32ldflags = -lcomdlg32 -lmscms
+mwindows = -mwindows
endif
if INKJAR
inkscape_SOURCES += main.cpp $(win32_sources)
inkscape_LDADD = $(all_libs)
-inkscape_LDFLAGS = --export-dynamic $(kdeldflags)
+inkscape_LDFLAGS = --export-dynamic $(kdeldflags) $(mwindows)
inkview_SOURCES += inkview.cpp $(win32_sources)
inkview_LDADD = $(all_libs)
+inkview_LDFLAGS = $(mwindows)
# ################################################
# VERSION REPORTING
diff --git a/src/color-profile.cpp b/src/color-profile.cpp
index 310a37356fead70a3c521c44f8d599fed5533b7c..43709793ccfc1cbb343bb04bfdfba7200308a3aa 100644 (file)
--- a/src/color-profile.cpp
+++ b/src/color-profile.cpp
#include "dom/util/digest.h"
#ifdef WIN32
-#include <Icm.h>
+#include <icm.h>
#endif // WIN32
using Inkscape::ColorProfile;
diff --git a/src/dialogs/export.cpp b/src/dialogs/export.cpp
index fa0fa5b6f45741fb5a24ee86b7af7b820f005791..9e8a71c351a56b96c43a5f8023f3def5aa352e05 100644 (file)
--- a/src/dialogs/export.cpp
+++ b/src/dialogs/export.cpp
#ifdef WIN32
#include <windows.h>
-#include <COMMDLG.h>
+#include <commdlg.h>
#include <gdk/gdkwin32.h>
#endif
diff --git a/src/main.cpp b/src/main.cpp
index f55731be825a80060de1b39b90d06ed0e91e35eb..d11222203778b3728d0fec669d76494fae9bec3f 100644 (file)
--- a/src/main.cpp
+++ b/src/main.cpp
#include "gc-core.h"
+#ifdef AND
+#undef AND
+#endif
+
#include "macros.h"
#include "file.h"
#include "document.h"
#include <extension/input.h>
#ifdef WIN32
-//#define REPLACEARGS_ANSI
-//#define REPLACEARGS_DEBUG
-
#include "registrytool.h"
-
#include "extension/internal/win32.h"
using Inkscape::Extension::Internal::PrintWin32;
-
#endif // WIN32
#include "extension/init.h"
diff --git a/src/winmain.cpp b/src/winmain.cpp
index dc6b7e00898cfcf5b48d76779c8dd2550b0ed474..4fde2c5748ade9eefa3483a669e237c9f26ecea6 100644 (file)
--- a/src/winmain.cpp
+++ b/src/winmain.cpp
#include <glib.h>
#ifdef G_OS_WIN32
-
#undef DATADIR
+
+#include <io.h>
+#include <conio.h>
+#define _WIN32_WINNT 0x0501
#include <windows.h>
extern int main (int argc, char **argv);
char *lpszCmdLine,
int nCmdShow)
{
+ if (fileno (stdout) != -1 &&
+ _get_osfhandle (fileno (stdout)) != -1)
+ {
+ /* stdout is fine, presumably redirected to a file or pipe */
+ }
+ else
+ {
+ typedef BOOL (* WINAPI AttachConsole_t) (DWORD);
+
+ AttachConsole_t p_AttachConsole =
+ (AttachConsole_t) GetProcAddress (GetModuleHandle ("kernel32.dll"), "AttachConsole");
+
+ if (p_AttachConsole != NULL && p_AttachConsole (ATTACH_PARENT_PROCESS))
+ {
+ freopen ("CONOUT$", "w", stdout);
+ dup2 (fileno (stdout), 1);
+ freopen ("CONOUT$", "w", stderr);
+ dup2 (fileno (stderr), 2);
+
+ }
+ }
+
int ret;
ret = main (__argc, __argv);
return ret;