? autogen.sh.win32
? configure.in.win32
? err
? gp-patch.diff.htm
? gp-win32.patch
? po/po2tbl.sed.in
? tests/popt.h
? tests/tools/popt.h
Index: configure.in
===================================================================
RCS file: /cvs/gnome/libgnomeprint/configure.in,v
retrieving revision 1.309
diff -u -r1.309 configure.in
--- configure.in	30 Nov 2004 14:33:09 -0000	1.309
+++ configure.in	3 Dec 2004 16:34:00 -0000
@@ -40,6 +40,8 @@
 dnl ====================================================
 AC_CHECK_FUNC(bind_textdomain_codeset,,[AC_CHECK_LIB(intl,bind_textdomain_codeset)])
 
+AC_CHECK_FUNCS(popen pclose)
+
 AC_FUNC_MMAP
 
 dnl =============
Index: libgnomeprint/gnome-font-face.c
===================================================================
RCS file: /cvs/gnome/libgnomeprint/libgnomeprint/gnome-font-face.c,v
retrieving revision 1.84
diff -u -r1.84 gnome-font-face.c
--- libgnomeprint/gnome-font-face.c	18 Nov 2004 17:14:40 -0000	1.84
+++ libgnomeprint/gnome-font-face.c	3 Dec 2004 16:34:00 -0000
@@ -29,7 +29,9 @@
 
 #include <config.h>
 #include <stdlib.h>
+#ifdef HAVE_UNISTD_H
 #include <unistd.h>
+#endif
 #include <string.h>
 #include <stdarg.h>
 #include <locale.h>
@@ -598,7 +600,7 @@
 
 	for (l = map->fonts; l != NULL; l = l->next) {
 		entry = (GPFontEntry *) l->data;
-		if (!strcasecmp (family, entry->familyname)) {
+		if (!g_strcasecmp (family, entry->familyname)) {
 			if (entry->type == GP_FONT_ENTRY_ALIAS)
 				entry = ((GPFontEntryAlias *) entry)->ref;
 			dist = abs (weight - entry->Weight) +
Index: libgnomeprint/gnome-fontmap.c
===================================================================
RCS file: /cvs/gnome/libgnomeprint/libgnomeprint/gnome-fontmap.c,v
retrieving revision 1.46
diff -u -r1.46 gnome-fontmap.c
--- libgnomeprint/gnome-fontmap.c	13 Sep 2004 15:43:54 -0000	1.46
+++ libgnomeprint/gnome-fontmap.c	3 Dec 2004 16:34:01 -0000
@@ -215,15 +215,15 @@
 	c = strrchr ((gchar *) fc_file, '.');
 	if (!c)
 		return NULL;
-	else if (strcasecmp (c, ".pfb") == 0)
+	else if (g_strcasecmp (c, ".pfb") == 0)
 		font_type = GP_FONT_ENTRY_TYPE1;
-	else if (strcasecmp (c, ".pfa") == 0)
+	else if (g_strcasecmp (c, ".pfa") == 0)
 		font_type = GP_FONT_ENTRY_TYPE1;
-	else if (strcasecmp (c, ".ttf") == 0)
+	else if (g_strcasecmp (c, ".ttf") == 0)
 		font_type = GP_FONT_ENTRY_TRUETYPE;
-	else if (strcasecmp (c, ".ttc") == 0)
+	else if (g_strcasecmp (c, ".ttc") == 0)
 		font_type = GP_FONT_ENTRY_TRUETYPE;
-	else if (strcasecmp (c, ".font") == 0) /* See #102400 */
+	else if (g_strcasecmp (c, ".font") == 0) /* See #102400 */
 		font_type = GP_FONT_ENTRY_TRUETYPE;
 	else {
 		return NULL;
@@ -571,7 +571,7 @@
 static gint
 gp_fe_sortname (gconstpointer a, gconstpointer b)
 {
-	return strcasecmp (((GPFontEntry *) a)->name, ((GPFontEntry *) b)->name);
+	return g_strcasecmp (((GPFontEntry *) a)->name, ((GPFontEntry *) b)->name);
 }
 
 static gint
@@ -582,13 +582,13 @@
 	if (((GPFontEntry *)b)->speciesname == NULL)
 		return 1;
 	
-	return strcasecmp (((GPFontEntry *) a)->speciesname, ((GPFontEntry *) b)->speciesname);
+	return g_strcasecmp (((GPFontEntry *) a)->speciesname, ((GPFontEntry *) b)->speciesname);
 }
 
 static gint
 gp_familyentry_sortname (gconstpointer a, gconstpointer b)
 {
-	return strcasecmp (((GPFamilyEntry *) a)->name, ((GPFamilyEntry *) b)->name);
+	return g_strcasecmp (((GPFamilyEntry *) a)->name, ((GPFamilyEntry *) b)->name);
 }
 
 GnomeFontWeight
Index: libgnomeprint/gnome-print-pdf-tt.c
===================================================================
RCS file: /cvs/gnome/libgnomeprint/libgnomeprint/gnome-print-pdf-tt.c,v
retrieving revision 1.10
diff -u -r1.10 gnome-print-pdf-tt.c
--- libgnomeprint/gnome-print-pdf-tt.c	18 Nov 2004 17:14:40 -0000	1.10
+++ libgnomeprint/gnome-print-pdf-tt.c	3 Dec 2004 16:34:01 -0000
@@ -27,7 +27,9 @@
 
 #include <config.h>
 
+#ifdef HAVE_UNISTD_H
 #include <unistd.h>
+#endif
 #include <string.h>
 #include <libgnomeprint/gnome-print.h>
 #include <libgnomeprint/gnome-print-private.h>
Index: libgnomeprint/gnome-print-pdf.c
===================================================================
RCS file: /cvs/gnome/libgnomeprint/libgnomeprint/gnome-print-pdf.c,v
retrieving revision 1.34
diff -u -r1.34 gnome-print-pdf.c
--- libgnomeprint/gnome-print-pdf.c	11 Sep 2004 03:00:01 -0000	1.34
+++ libgnomeprint/gnome-print-pdf.c	3 Dec 2004 16:34:01 -0000
@@ -30,7 +30,9 @@
 #include <math.h>
 #include <string.h>
 #include <time.h>
+#ifdef HAVE_UNISTD_H
 #include <unistd.h>
+#endif
 #include <locale.h>
 
 #include <libart_lgpl/art_affine.h>
Index: libgnomeprint/gnome-print-ps2.c
===================================================================
RCS file: /cvs/gnome/libgnomeprint/libgnomeprint/gnome-print-ps2.c,v
retrieving revision 1.90
diff -u -r1.90 gnome-print-ps2.c
--- libgnomeprint/gnome-print-ps2.c	3 Dec 2004 16:13:39 -0000	1.90
+++ libgnomeprint/gnome-print-ps2.c	3 Dec 2004 16:34:01 -0000
@@ -31,7 +31,9 @@
 #include <math.h>
 #include <string.h>
 #include <time.h>
+#ifdef HAVE_UNISTD_H
 #include <unistd.h>
+#endif
 #include <locale.h>
 
 #include <libart_lgpl/art_affine.h>
@@ -264,7 +266,7 @@
 		g_free (tmp);
 		return GNOME_PRINT_ERROR_UNKNOWN;
 	}
-	ps2->buf = fdopen (fd, "r+");
+	ps2->buf = fdopen (fd, "rb+");
 	ps2->bufname = tmp;
 
 	/* Set bbox to emty practical infinity */
Index: libgnomeprint/gnome-print-svg.c
===================================================================
RCS file: /cvs/gnome/libgnomeprint/libgnomeprint/gnome-print-svg.c,v
retrieving revision 1.1
diff -u -r1.1 gnome-print-svg.c
--- libgnomeprint/gnome-print-svg.c	24 Feb 2004 03:42:58 -0000	1.1
+++ libgnomeprint/gnome-print-svg.c	3 Dec 2004 16:34:02 -0000
@@ -28,7 +28,9 @@
 #include <math.h>
 #include <string.h>
 #include <time.h>
+#ifdef HAVE_UNISTD_H
 #include <unistd.h>
+#endif
 #include <png.h>
 
 #include <libart_lgpl/art_affine.h>
Index: libgnomeprint/gnome-print-transport.c
===================================================================
RCS file: /cvs/gnome/libgnomeprint/libgnomeprint/gnome-print-transport.c,v
retrieving revision 1.24
diff -u -r1.24 gnome-print-transport.c
--- libgnomeprint/gnome-print-transport.c	3 Dec 2004 15:37:33 -0000	1.24
+++ libgnomeprint/gnome-print-transport.c	3 Dec 2004 16:34:02 -0000
@@ -268,9 +268,11 @@
 	module = g_hash_table_lookup (modules, module_name);
 
 	if (!module) {
+		gchar *dir = g_build_filename (GNOME_PRINT_MODULES_DIR, "transports", NULL);
 		insert = TRUE;
-		path = g_module_build_path (GNOME_PRINT_MODULES_DIR "/transports", module_name);
+		path = g_module_build_path (dir, module_name);
 		module = g_module_open (path, G_MODULE_BIND_LAZY);
+		g_free (dir);
 	}
 
 	if (!module) {
@@ -330,12 +332,12 @@
 	gnome_print_config_get_boolean (config, "Settings.Output.Job.PrintToFile", &print_to_file);
 
 	if (print_to_file) {
-		module_name = g_strdup ("libgnomeprint-file.so");
+		module_name = g_strdup ("gnomeprint-file");
 	} else {
 		module_name = gnome_print_config_get (config, "Settings.Transport.Backend.Module");
 		if (!module_name) {
 			g_warning ("Could not find \"Settings.Transport.Backend.Module\" using default");
-			module_name = g_strdup ("libgnomeprint-lpr.so");
+			module_name = g_strdup ("gnomeprint-lpr");
 		}
 	} 
 
Index: libgnomeprint/gnome-print.c
===================================================================
RCS file: /cvs/gnome/libgnomeprint/libgnomeprint/gnome-print.c,v
retrieving revision 1.106
diff -u -r1.106 gnome-print.c
--- libgnomeprint/gnome-print.c	13 Oct 2004 00:28:08 -0000	1.106
+++ libgnomeprint/gnome-print.c	3 Dec 2004 16:34:02 -0000
@@ -62,8 +62,17 @@
 #define HAVE_BROKEN_MMAP
 #endif
 
+#elif defined G_OS_WIN32
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+#include <io.h>
 #endif /* HAVE_MMAP */
 
+#ifndef O_BINARY
+#define O_BINARY 0
+#endif
+
+
 static void gnome_print_context_class_init (GnomePrintContextClass *klass);
 static void gnome_print_context_init (GnomePrintContext *pc);
 static void gnome_print_context_finalize (GObject *object);
@@ -138,7 +147,7 @@
 gnome_print_context_construct (GnomePrintContext *pc, GnomePrintConfig *config)
 {
 	GnomePrintReturnCode retval = GNOME_PRINT_OK;
-	
+
 	g_return_val_if_fail (pc != NULL, GNOME_PRINT_ERROR_UNKNOWN);
 	g_return_val_if_fail (GNOME_IS_PRINT_CONTEXT (pc), GNOME_PRINT_ERROR_UNKNOWN);
 	g_return_val_if_fail (config != NULL, GNOME_PRINT_ERROR_UNKNOWN);
@@ -149,7 +158,7 @@
 
 	if (GNOME_PRINT_CONTEXT_GET_CLASS (pc)->construct)
 		retval = GNOME_PRINT_CONTEXT_GET_CLASS (pc)->construct (pc);
-	
+
 	return retval;
 }
 
@@ -162,7 +171,7 @@
 	g_return_val_if_fail (pc->transport == NULL, GNOME_PRINT_ERROR_UNKNOWN);
 
 	pc->transport = gnome_print_transport_new (pc->config);
-	
+
 	if (pc->transport == NULL) {
 		g_warning ("Could not create transport inside gnome_print_context_create_transport");
 		return GNOME_PRINT_ERROR_UNKNOWN;
@@ -193,7 +202,7 @@
 gnome_print_beginpage (GnomePrintContext *pc, const guchar *name)
 {
 	guchar *real_name;
-	
+
 	g_return_val_if_fail (pc != NULL, GNOME_PRINT_ERROR_BADCONTEXT);
 	g_return_val_if_fail (GNOME_IS_PRINT_CONTEXT (pc), GNOME_PRINT_ERROR_BADCONTEXT);
 	g_return_val_if_fail (pc->gc != NULL, GNOME_PRINT_ERROR_BADCONTEXT);
@@ -205,7 +214,7 @@
 	} else {
 		real_name = (guchar *) name;
 	}
-	
+
 	gp_gc_reset (pc->gc);
 	pc->haspage = TRUE;
 
@@ -257,12 +266,12 @@
  * gnome_print_end_doc:
  * @pc: A #GnomePrintContext
  *
- * to be called at the end of any copy of the document before the next 
+ * to be called at the end of any copy of the document before the next
  * copy starts. It will do such things as ejecting a page in duplex printing.
- * 
- * 
- * 
- * 
+ *
+ *
+ *
+ *
  *
  * Returns: #GNOME_PRINT_OK or positive value on success, negative error
  * code on failure.
@@ -273,7 +282,7 @@
 	gint ret;
 
 	g_return_val_if_fail (pc != NULL, GNOME_PRINT_ERROR_BADCONTEXT);
-	g_return_val_if_fail (GNOME_IS_PRINT_CONTEXT (pc), 
+	g_return_val_if_fail (GNOME_IS_PRINT_CONTEXT (pc),
 			      GNOME_PRINT_ERROR_BADCONTEXT);
 	g_return_val_if_fail (pc->gc != NULL, GNOME_PRINT_ERROR_BADCONTEXT);
 	g_return_val_if_fail (!pc->haspage, GNOME_PRINT_ERROR_NOMATCH);
@@ -511,7 +520,7 @@
 		g_free (drivername);
 		return pc;
 	}
-	
+
 	if (strcmp (drivername, "gnome-print-pdf") == 0) {
 		pc = gnome_print_pdf_new (config);
 		if (pc == NULL)
@@ -547,6 +556,9 @@
 		if (b->was_mmaped)
 			munmap (b->buf, b->buf_size);
 		else
+#elif defined G_OS_WIN32
+		if (b->was_mmaped)
+			UnmapViewOfFile (b->buf);
 #endif
 			g_free (b->buf);
 	}
@@ -574,7 +586,7 @@
 	b->was_mmaped = FALSE;
 	b->fd = -1;
 
-	fh = open (file_name, O_RDONLY);
+	fh = open (file_name, O_RDONLY | O_BINARY);
 	if (fh < 0) {
 		g_warning ("Can't open \"%s\"", file_name);
 		return GNOME_PRINT_ERROR_UNKNOWN;
@@ -584,9 +596,15 @@
 		close (fh);
 		return GNOME_PRINT_ERROR_UNKNOWN;
 	}
-	
+
 #ifdef HAVE_MMAP
 	b->buf = mmap (NULL, s.st_size, PROT_READ, MAP_SHARED, fh, 0);
+#elif defined G_OS_WIN32
+	{
+		HANDLE handle = CreateFileMapping ((HANDLE)_get_osfhandle (fh), NULL, PAGE_READONLY, 0, 0, NULL);
+		b->buf = MapViewOfFile (handle, FILE_MAP_READ, 0, 0, 0);
+		CloseHandle (handle);
+	}
 #endif
 
 	if ((b->buf == NULL) || (b->buf == (void *) -1)) {
@@ -595,10 +613,10 @@
 		b->buf = g_try_malloc (s.st_size);
 		b->buf_size = s.st_size;
 		if (b->buf != NULL) {
-			ssize_t nread, total_read;
-			
+			gssize nread, total_read;
+
 			nread = total_read = 0;
-			
+
 			while (total_read < s.st_size) {
 				nread = read (fh, b->buf + total_read,
 					      MIN (GP_MMAP_BUFSIZ, s.st_size - total_read));
@@ -612,7 +630,7 @@
 						b->buf_size = 0;
 						break; /* failure */
 				}
-				} else 
+				} else
 					total_read += nread;
 			}
 		}
Index: libgnomeprint/gpa/gpa-printer.c
===================================================================
RCS file: /cvs/gnome/libgnomeprint/libgnomeprint/gpa/gpa-printer.c,v
retrieving revision 1.50
diff -u -r1.50 gpa-printer.c
--- libgnomeprint/gpa/gpa-printer.c	21 Jul 2004 02:02:37 -0000	1.50
+++ libgnomeprint/gpa/gpa-printer.c	3 Dec 2004 16:34:02 -0000
@@ -29,10 +29,9 @@
 #include <locale.h>
 #include <string.h>
 #include <sys/types.h>
-#include <dirent.h>
 
 #include <gmodule.h>
-#include <glibconfig.h>
+#include <glib.h>
 #include <libxml/parser.h>
 #include <libxml/xmlmemory.h>
 
@@ -385,8 +384,8 @@
 static gboolean
 gpa_printer_list_load_from_module_dir (GPAList *printers, const gchar *dir_path)
 {
-	struct dirent *entry;
-	DIR *dir;
+	const char *entry;
+	GDir *dir;
 	gint ext_len = strlen (G_MODULE_SUFFIX);
 	g_assert (ext_len > 0);
 
@@ -396,30 +395,30 @@
 		return FALSE;
 	}
 	
-	dir = opendir (dir_path);
+	dir = g_dir_open (dir_path, 0, NULL);
 	if (!dir) {
 		/* Not an error. since modules are optional */
 		return TRUE;
 	}
 
-	while ((entry = readdir (dir)) != NULL) {
+	while ((entry = g_dir_read_name (dir)) != NULL) {
 		gchar *path;
 		gint len;
 
-		len = strlen (entry->d_name);
+		len = strlen (entry);
 
 		if (len < ext_len + 2) /* 2 = one char + 1 for '.'*/
 			continue;
 
-		if (*(entry->d_name + len - ext_len - 1) != '.' || 
-		    strcmp (entry->d_name + len - ext_len, G_MODULE_SUFFIX))
+		if (*(entry + len - ext_len - 1) != '.' || 
+		    strcmp (entry + len - ext_len, G_MODULE_SUFFIX))
 			continue;
 		
-		path = g_build_filename (dir_path, entry->d_name, NULL);
+		path = g_build_filename (dir_path, entry, NULL);
 		gpa_printer_list_load_from_module (printers, path);
 		g_free (path);
 	}
-	closedir (dir);
+	g_dir_close (dir);
 	
 	return TRUE;
 }
@@ -436,26 +435,26 @@
 static gboolean
 gpa_printer_list_load_from_dir (GPAList *printers, const gchar *dir_name)
 {
-	struct dirent *entry;
-	DIR *dir;
+	const char *entry;
+	GDir *dir;
 
-	dir = opendir (dir_name);
+	dir = g_dir_open (dir_name, 0, NULL);
 	if (!dir)
 		return FALSE;
 
-	while ((entry = readdir (dir))) {
+	while ((entry = g_dir_read_name (dir))) {
 		GPANode *printer;
 		gchar *file;
 		gint len;
 
-		len = strlen (entry->d_name);
+		len = strlen (entry);
 		if (len < 5)
 			continue;
 		
-		if (strcmp (entry->d_name + len - 4, ".xml"))
+		if (strcmp (entry + len - 4, ".xml"))
 			continue;
 
-		file = g_build_filename (dir_name, entry->d_name, NULL);
+		file = g_build_filename (dir_name, entry, NULL);
 		printer = gpa_printer_new_from_file (file);
 		g_free (file);
 
@@ -467,7 +466,7 @@
 		if (strcmp (GPA_NODE_ID (printer), "GENERIC") == 0)
 		    gpa_list_set_default (printers, printer);
 	}
-	closedir (dir);
+	g_dir_close (dir);
 
 	return TRUE;
 }
@@ -487,6 +486,7 @@
 {
 	GPAList *printers;
 	GPANode *p;
+	gchar   *path;
 
 	if (gpa_root && gpa_root->printers != NULL) {
 		g_warning ("gpa_printer_list_load should only be called once");
@@ -495,7 +495,9 @@
 
 	printers = gpa_list_new (GPA_TYPE_PRINTER, "Printers", TRUE);
 
-	gpa_printer_list_load_from_dir        (printers, GPA_DATA_DIR "/printers");
+	path = g_build_filename (GPA_DATA_DIR, "printers", NULL);
+	gpa_printer_list_load_from_dir        (printers, path);
+	g_free (path);
 	gpa_printer_list_load_from_module_dir (printers, GPA_MODULES_DIR);
 
 	if (GPA_NODE (printers)->children == NULL) {
Index: libgnomeprint/transports/gp-transport-custom.c
===================================================================
RCS file: /cvs/gnome/libgnomeprint/libgnomeprint/transports/gp-transport-custom.c,v
retrieving revision 1.3
diff -u -r1.3 gp-transport-custom.c
--- libgnomeprint/transports/gp-transport-custom.c	18 Dec 2002 01:56:24 -0000	1.3
+++ libgnomeprint/transports/gp-transport-custom.c	3 Dec 2004 16:34:02 -0000
@@ -30,6 +30,7 @@
 #define __GP_TRANSPORT_CUSTOM_C__
 
 #include "config.h"
+#include <stdio.h>
 #include <libgnomeprint/gnome-print.h>
 #include "gp-transport-custom.h"
 
@@ -145,7 +146,7 @@
 		command = g_strdup ("lpr");
 	}
 
-	tcustom->pipe = popen (command, "w");
+	tcustom->pipe = popen (command, "wb");
 
 	if (tcustom->pipe == NULL) {
 		g_warning ("Opening '%s' for output failed", command);
Index: libgnomeprint/transports/gp-transport-file.c
===================================================================
RCS file: /cvs/gnome/libgnomeprint/libgnomeprint/transports/gp-transport-file.c,v
retrieving revision 1.15
diff -u -r1.15 gp-transport-file.c
--- libgnomeprint/transports/gp-transport-file.c	16 Jun 2004 19:42:53 -0000	1.15
+++ libgnomeprint/transports/gp-transport-file.c	3 Dec 2004 16:34:02 -0000
@@ -32,8 +32,19 @@
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <fcntl.h>
+#ifdef HAVE_UNISTD_H
 #include <unistd.h>
+#endif
 #include <libgnomeprint/gnome-print.h>
+#include <gmodule.h>
+
+#ifdef G_OS_WIN32
+#include <io.h>
+#endif
+
+#ifndef O_BINARY
+#define O_BINARY 0
+#endif
 
 #include "gp-transport-file.h"
 
@@ -47,7 +58,7 @@
 static gint gp_transport_file_close (GnomePrintTransport *transport);
 static gint gp_transport_file_write (GnomePrintTransport *transport, const guchar *buf, gint len);
 
-GType gnome_print__transport_get_type (void);
+G_MODULE_EXPORT GType gnome_print__transport_get_type (void);
 
 static GnomePrintTransportClass *parent_class = NULL;
 
@@ -144,10 +155,10 @@
 
 	g_return_val_if_fail (tf->name != NULL, GNOME_PRINT_ERROR_UNKNOWN);
 
-#if defined(G_OS_WIN32) && defined(__MINGW32__)
-	tf->fd = open (tf->name, O_CREAT | O_TRUNC | O_WRONLY);
+#if defined(G_OS_WIN32) && (defined(__MINGW32__) || defined _MSC_VER)
+	tf->fd = open (tf->name, O_CREAT | O_TRUNC | O_WRONLY | O_BINARY);
 #else
-	tf->fd = open (tf->name, O_CREAT | O_TRUNC | O_WRONLY, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH);
+	tf->fd = open (tf->name, O_CREAT | O_TRUNC | O_WRONLY | O_BINARY, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH);
 #endif
 
 	if (tf->fd < 0) {
@@ -202,7 +213,7 @@
 	return len;
 }
 
-GType
+G_MODULE_EXPORT GType
 gnome_print__transport_get_type (void)
 {
 	return GP_TYPE_TRANSPORT_FILE;
Index: libgnomeprint/transports/gp-transport-lpr.c
===================================================================
RCS file: /cvs/gnome/libgnomeprint/libgnomeprint/transports/gp-transport-lpr.c,v
retrieving revision 1.12
diff -u -r1.12 gp-transport-lpr.c
--- libgnomeprint/transports/gp-transport-lpr.c	30 Nov 2004 14:33:09 -0000	1.12
+++ libgnomeprint/transports/gp-transport-lpr.c	3 Dec 2004 16:34:02 -0000
@@ -30,9 +30,24 @@
 
 #include "config.h"
 #include <libgnomeprint/gnome-print.h>
+#include <gmodule.h>
 
 #include "gp-transport-lpr.h"
 
+#if !defined(HAVE_POPEN)
+#ifdef G_OS_WIN32
+#include <stdio.h>
+#define popen(f,m) _popen(f,m)
+#endif
+#endif
+
+#if !defined(HAVE_CLOSE)
+#ifdef G_OS_WIN32
+#include <stdio.h>
+#define pclose(f) _pclose(f)
+#endif
+#endif
+
 static void gp_transport_lpr_class_init (GPTransportLPRClass *klass);
 static void gp_transport_lpr_init (GPTransportLPR *tlpr);
 
@@ -44,7 +59,7 @@
 static gint gp_transport_lpr_write (GnomePrintTransport *transport, const guchar *buf, gint len);
 static gboolean gp_transport_lpr_exists (GnomePrintTransport const *transport);
 
-GType gnome_print__transport_get_type (void);
+G_MODULE_EXPORT GType gnome_print__transport_get_type (void);
 
 static GnomePrintTransportClass *parent_class = NULL;
 
@@ -226,7 +241,7 @@
 	return TRUE;
 }
 
-GType
+G_MODULE_EXPORT GType
 gnome_print__transport_get_type (void)
 {
 	return GP_TYPE_TRANSPORT_LPR;
Index: libgnomeprint/ttsubset/sft.h
===================================================================
RCS file: /cvs/gnome/libgnomeprint/libgnomeprint/ttsubset/sft.h,v
retrieving revision 1.4
diff -u -r1.4 sft.h
--- libgnomeprint/ttsubset/sft.h	10 Sep 2004 18:59:06 -0000	1.4
+++ libgnomeprint/ttsubset/sft.h	3 Dec 2004 16:34:02 -0000
@@ -77,7 +77,9 @@
 #define __SUBFONT_H
 
 #include <sys/types.h>
+#ifndef _MSC_VER
 #include <unistd.h>
+#endif
 #include <stdio.h>
 #ifndef NO_LIST
 #include "list.h"
@@ -150,6 +152,21 @@
 /*@}*/
 
 #ifndef STSF
+#if 1
+/* glib already deals with different compilers */
+#include <glibconfig.h>
+
+typedef guchar     byte;
+typedef guchar     uint8;
+typedef gchar      int8;
+typedef guint16    uint16;
+typedef gint16     int16;
+
+typedef guint32    uint32;
+typedef gint32     int32;
+typedef guint64    uint64;
+typedef gint64     int64;
+#  else
 /*- XXX These should be dynamically configured */ /*FOLD00*/
     typedef unsigned char         byte;
     typedef unsigned char         uint8;
@@ -161,7 +178,7 @@
     typedef int                   int32;
     typedef unsigned long long    uint64;
     typedef long long             int64;
-
+#  endif
 /*@{*/
     typedef int16       F2Dot14;            /**< fixed: 2.14 */
     typedef int32       F16Dot16;           /**< fixed: 16.16 */
Index: libgnomeprint/ttsubset/ttcr.c
===================================================================
RCS file: /cvs/gnome/libgnomeprint/libgnomeprint/ttsubset/ttcr.c,v
retrieving revision 1.5
diff -u -r1.5 ttcr.c
--- libgnomeprint/ttsubset/ttcr.c	13 Oct 2004 00:28:08 -0000	1.5
+++ libgnomeprint/ttsubset/ttcr.c	3 Dec 2004 16:34:03 -0000
@@ -43,9 +43,12 @@
  * @version 1.3
  *
  */
+#include <config.h>
 
 #include <sys/types.h>
+#ifdef HAVE_UNISTD_H
 #include <unistd.h>
+#endif
 #include <fcntl.h>
 #include <stdlib.h>
 #ifdef sun
@@ -56,6 +59,10 @@
 #include <assert.h>
 #include "ttcr.h"
 
+#ifndef O_BINARY
+#define O_BINARY 0
+#endif
+
 /* These must be #defined so that they can be used in initializers */
 #define T_maxp  0x6D617870
 #define T_glyf  0x676C7966
@@ -407,7 +414,7 @@
     int fd, r;
 
     if (!fname) return SF_BADFILE;
-    if ((fd = open(fname, O_WRONLY | O_CREAT | O_TRUNC, 0644)) == -1) return SF_BADFILE;
+    if ((fd = open(fname, O_WRONLY | O_BINARY | O_CREAT | O_TRUNC, 0644)) == -1) return SF_BADFILE;
 
     if ((r = StreamToMemory(_this, &ptr, &length)) != SF_OK) return r;
 
