/pidgin/main: 80fcf7f86e4a: win32: globally define _WIN32_WINNT ...

Tomasz Wasilczyk tomkiewicz at cpw.pidgin.im
Sat May 18 13:22:56 EDT 2013


Changeset: 80fcf7f86e4aa39a8a8bebb505b6bd6392b19df8
Author:	 Tomasz Wasilczyk <tomkiewicz at cpw.pidgin.im>
Date:	 2013-05-18 19:22 +0200
Branch:	 default
URL: https://hg.pidgin.im/pidgin/main/rev/80fcf7f86e4a

Description:

win32: globally define _WIN32_WINNT macro, tune config, move gtkconv themes

diffstat:

 config.h.mingw                                 |  16 +++++++++-------
 pidgin/Makefile.mingw                          |   5 +++--
 pidgin/gtkconv-theme.c                         |   4 ++++
 pidgin/gtkconv.c                               |   4 ++++
 pidgin/plugins/win32/transparency/win2ktrans.c |   5 ++---
 pidgin/win32/MinimizeToTray.c                  |   2 +-
 pidgin/win32/winpidgin.c                       |   7 ++-----
 7 files changed, 25 insertions(+), 18 deletions(-)

diffs (145 lines):

diff --git a/config.h.mingw b/config.h.mingw
--- a/config.h.mingw
+++ b/config.h.mingw
@@ -29,7 +29,7 @@
 /* #undef HAVE_CONNECT */
 
 /* Define to 1 if Cyrus SASL is present */
-/* #undef HAVE_CYRUS_SASL */
+#define HAVE_CYRUS_SASL 1
 
 /* Define if you have the external 'daylight' variable. */
 #define HAVE_DAYLIGHT 1
@@ -62,9 +62,8 @@
 /* Define to 1 if you have the <fcntl.h> header file. */
 #define HAVE_FCNTL_H 1
 
-/* Define to 1 if you have the getaddrinfo function. */
-/* TODO: Use this on new enough versions of Windows */
-/* #define HAVE_GETADDRINFO 1 */
+/* Define to 1 if you have the getaddrinfo function (since WinXP). */
+#define HAVE_GETADDRINFO 1
 
 /* Define to 1 if you have the `gethostid' function. */
 /* #define HAVE_GETHOSTID 1 */
@@ -148,13 +147,13 @@
 /* #undef HAVE_MONO_METADATA_OBJECT_H */
 
 /* Define to 1 if you have the <nspr.h> header file. */
-/* #undef HAVE_NSPR_H */
+#define HAVE_NSPR_H 1
 
 /* Define if you have Mozilla NSS */
 #define HAVE_NSS 1
 
 /* Define to 1 if you have the <nss.h> header file. */
-/* #undef HAVE_NSS_H */
+#define HAVE_NSS_H 1
 
 /* Define if we have Pango 1.4 or newer. */
 #define HAVE_PANGO14 1
@@ -409,4 +408,7 @@
 
 #define HAVE_FILENO 1
 
-
+#ifndef _WIN32_WINNT
+/* _WIN32_WINNT_WINXP = 0x0501 */
+#define _WIN32_WINNT 0x0501
+#endif
diff --git a/pidgin/Makefile.mingw b/pidgin/Makefile.mingw
--- a/pidgin/Makefile.mingw
+++ b/pidgin/Makefile.mingw
@@ -154,8 +154,9 @@ win32/pidgin_exe_rc.rc: win32/pidgin_exe
 
 install_shallow: $(PIDGIN_INSTALL_DIR) $(EXE_TARGET).exe $(PIDGIN_TARGET).dll
 	cp $(EXE_TARGET).exe $(PIDGIN_TARGET).dll $(PIDGIN_INSTALL_DIR)
-	mkdir -p "$(PIDGIN_INSTALL_DIR)/pidgin/theme/"
-	cp -r themes/* "$(PIDGIN_INSTALL_DIR)/pidgin/theme/"
+	mkdir -p "$(PIDGIN_INSTALL_DIR)/theme"
+	cp -r themes/* "$(PIDGIN_INSTALL_DIR)/theme/"
+	chmod -R 777 "$(PIDGIN_INSTALL_DIR)/theme/"
 
 install: install_shallow all
 	$(MAKE_at) $(MAKE) -C $(PIDGIN_PLUGINS_TOP) -f $(MINGW_MAKEFILE) install
diff --git a/pidgin/gtkconv-theme.c b/pidgin/gtkconv-theme.c
--- a/pidgin/gtkconv-theme.c
+++ b/pidgin/gtkconv-theme.c
@@ -126,7 +126,11 @@ get_template_path(const char *dir)
 
 	if (!g_file_test(file, G_FILE_TEST_EXISTS)) {
 		g_free(file);
+#ifdef _WIN32
+		file = g_build_filename(DATADIR, "theme", "Template.html", NULL);
+#else
 		file = g_build_filename(DATADIR, "pidgin", "theme", "Template.html", NULL);
+#endif
 	}
 
 	return file;
diff --git a/pidgin/gtkconv.c b/pidgin/gtkconv.c
--- a/pidgin/gtkconv.c
+++ b/pidgin/gtkconv.c
@@ -8840,7 +8840,11 @@ pidgin_conversations_init(void)
 			PURPLE_CALLBACK(wrote_msg_update_unseen_cb), NULL);
 
 	purple_theme_manager_register_type(g_object_new(PIDGIN_TYPE_CONV_THEME_LOADER, "type", "conversation", NULL));
+#ifdef _WIN32
+	theme_dir = g_build_filename(DATADIR, "theme", NULL);
+#else
 	theme_dir = g_build_filename(DATADIR, "pidgin", "theme", NULL);
+#endif
 	default_conv_theme = purple_theme_manager_load_theme(theme_dir, "conversation");
 	g_free(theme_dir);
 
diff --git a/pidgin/plugins/win32/transparency/win2ktrans.c b/pidgin/plugins/win32/transparency/win2ktrans.c
--- a/pidgin/plugins/win32/transparency/win2ktrans.c
+++ b/pidgin/plugins/win32/transparency/win2ktrans.c
@@ -21,9 +21,8 @@
  * 02111-1301, USA.
  *
  */
-#ifndef _WIN32_WINNT
-#define _WIN32_WINNT 0x0500
-#endif
+
+#include "config.h"
 #include <gdk/gdkwin32.h>
 #include "internal.h"
 
diff --git a/pidgin/win32/MinimizeToTray.c b/pidgin/win32/MinimizeToTray.c
--- a/pidgin/win32/MinimizeToTray.c
+++ b/pidgin/win32/MinimizeToTray.c
@@ -14,7 +14,7 @@
  *
  * Copyright 2000 Matthew Ellis <m.t.ellis at bigfoot.com>
  */
-#define _WIN32_WINNT 0x0500
+#include <config.h>
 #include <windows.h>
 #include "MinimizeToTray.h"
 
diff --git a/pidgin/win32/winpidgin.c b/pidgin/win32/winpidgin.c
--- a/pidgin/win32/winpidgin.c
+++ b/pidgin/win32/winpidgin.c
@@ -25,10 +25,8 @@
  *
  */
 
-/* This is for ATTACH_PARENT_PROCESS */
-#ifndef _WIN32_WINNT
-#define _WIN32_WINNT 0x501
-#endif
+#include "config.h"
+
 #include <windows.h>
 #include <fcntl.h>
 #include <stdlib.h>
@@ -36,7 +34,6 @@
 #include <stdio.h>
 #include <sys/types.h>
 #include <sys/stat.h>
-#include "config.h"
 
 typedef int (__cdecl* LPFNPIDGINMAIN)(HINSTANCE, int, char**);
 typedef void (WINAPI* LPFNSETDLLDIRECTORY)(LPCWSTR);



More information about the Commits mailing list