summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Lillqvist <tml@iki.fi>2000-07-22 23:50:19 +0000
committerTor Lillqvist <tml@src.gnome.org>2000-07-22 23:50:19 +0000
commit773aacf9b63551cd198944bf5d9c7812a14b1c76 (patch)
treecba8c14163f3bcd3f268ada701c13023a6cd41b8
parenta338544d1ab74133ec0973b99b05bdea78329275 (diff)
downloadgtk+-773aacf9b63551cd198944bf5d9c7812a14b1c76.tar.gz
Win32 build setup:
2000-07-23 Tor Lillqvist <tml@iki.fi> Win32 build setup: * makefile.mingw.in * pixops/makefile.mingw.in * pixbuf_*.def: New files. * Makefile.am * pixops/Makefile.am: Add them. Add rule to generate makefile.mingw. * gdk-pixbuf-io.c (gtk_win32_get_installation_directory): New function, to get the GTK+ installation directory from the Windows Registry, where the installation program for whatever software includes GTK+ has stored it. Used to avoid having hardcoding the directory where to look for loaders. This function is needed by gtk, too, so it should really be just in one place. Maybe a small static library one level up from here? * gdk-pixbuf-animation.c (gdk_pixbuf_animation_new_from_file) * gdk-pixbuf-io.c (gdk_pixbuf_new_from_file): Open file in binary mode. This *is* standard C. (No-op on Unix, of course.) * io-jpeg.c: If we don't HAVE_SIGSETJMP, use normal setjmp(). * io-tiff.c: Use g_get_tmp_dir(). If we don't HAVE_MKSTEMP, use mktemp() and open(). (gdk_pixbuf__tiff_image_stop_load): g_free() also the tempname. * pixops/*.S: The Gas from mingw32 doesn't like the .type pseudo-op. Conditionalise on __MINGW32__, but probably should conditionalise on Gas version instead? Or could we do without .type on all systems? * pixops/timescale.c: Use g_get_current_time() instead of gettimeofday().
-rw-r--r--gdk-pixbuf/ChangeLog40
-rw-r--r--gdk-pixbuf/Makefile.am17
-rw-r--r--gdk-pixbuf/gdk-pixbuf-animation.c2
-rw-r--r--gdk-pixbuf/gdk-pixbuf-io.c66
-rw-r--r--gdk-pixbuf/gdk_pixbuf.def42
-rw-r--r--gdk-pixbuf/io-jpeg.c5
-rw-r--r--gdk-pixbuf/io-tiff.c17
-rw-r--r--gdk-pixbuf/makefile.mingw.in109
-rw-r--r--gdk-pixbuf/pixbufloader_bmp.def5
-rw-r--r--gdk-pixbuf/pixbufloader_gif.def6
-rw-r--r--gdk-pixbuf/pixbufloader_ico.def5
-rw-r--r--gdk-pixbuf/pixbufloader_jpeg.def5
-rw-r--r--gdk-pixbuf/pixbufloader_png.def5
-rw-r--r--gdk-pixbuf/pixbufloader_pnm.def5
-rw-r--r--gdk-pixbuf/pixbufloader_ras.def5
-rw-r--r--gdk-pixbuf/pixbufloader_tiff.def5
-rw-r--r--gdk-pixbuf/pixbufloader_xpm.def3
-rw-r--r--gdk-pixbuf/pixops/Makefile.am8
-rw-r--r--gdk-pixbuf/pixops/composite_line_22_4a4_mmx.S12
-rw-r--r--gdk-pixbuf/pixops/composite_line_color_22_4a4_mmx.S13
-rw-r--r--gdk-pixbuf/pixops/have_mmx.S12
-rw-r--r--gdk-pixbuf/pixops/makefile.mingw.in40
-rw-r--r--gdk-pixbuf/pixops/scale_line_22_33_mmx.S13
-rw-r--r--gdk-pixbuf/pixops/timescale.c12
24 files changed, 438 insertions, 14 deletions
diff --git a/gdk-pixbuf/ChangeLog b/gdk-pixbuf/ChangeLog
index db25c41080..bc064c67ff 100644
--- a/gdk-pixbuf/ChangeLog
+++ b/gdk-pixbuf/ChangeLog
@@ -1,3 +1,43 @@
+2000-07-23 Tor Lillqvist <tml@iki.fi>
+
+ Win32 build setup:
+
+ * makefile.mingw.in
+ * pixops/makefile.mingw.in
+ * pixbuf_*.def: New files.
+
+ * Makefile.am
+ * pixops/Makefile.am: Add them. Add rule to generate makefile.mingw.
+
+ * gdk-pixbuf-io.c (gtk_win32_get_installation_directory):
+ New function, to get the GTK+ installation directory from
+ the Windows Registry, where the installation program
+ for whatever software includes GTK+ has stored it.
+
+ Used to avoid having hardcoding the directory where to look for
+ loaders. This function is needed by gtk, too, so it should
+ really be just in one place. Maybe a small static library
+ one level up from here?
+
+ * gdk-pixbuf-animation.c (gdk_pixbuf_animation_new_from_file)
+ * gdk-pixbuf-io.c (gdk_pixbuf_new_from_file):
+ Open file in binary mode. This *is* standard C. (No-op on Unix,
+ of course.)
+
+ * io-jpeg.c: If we don't HAVE_SIGSETJMP, use normal setjmp().
+
+ * io-tiff.c: Use g_get_tmp_dir(). If we don't HAVE_MKSTEMP, use
+ mktemp() and open().
+ (gdk_pixbuf__tiff_image_stop_load): g_free() also the tempname.
+
+ * pixops/*.S: The Gas from mingw32 doesn't like the .type
+ pseudo-op. Conditionalise on __MINGW32__, but probably
+ should conditionalise on Gas version instead? Or could we
+ do without .type on all systems?
+
+ * pixops/timescale.c: Use g_get_current_time()
+ instead of gettimeofday().
+
Sat Jul 22 10:57:22 2000 Owen Taylor <otaylor@redhat.com>
* Makefile.am (test_gdk_pixbuf_LDADD): Remove -lgmodule
diff --git a/gdk-pixbuf/Makefile.am b/gdk-pixbuf/Makefile.am
index c15c1b0bd7..9b1e5956f1 100644
--- a/gdk-pixbuf/Makefile.am
+++ b/gdk-pixbuf/Makefile.am
@@ -167,3 +167,20 @@ libgdk_pixbufinclude_HEADERS = \
noinst_HEADERS = \
gdk-pixbuf-io.h \
gdk-pixbuf-private.h
+
+EXTRA_DIST = \
+ makefile.mingw \
+ makefile.mingw.in \
+ gdk_pixbuf.def \
+ pixbuf_ico.def \
+ pixbuf_pnm.def \
+ pixbuf_xpm.def \
+ pixbuf_bmp.def \
+ pixbuf_jpeg.def \
+ pixbuf_ras.def \
+ pixbuf_gif.def \
+ pixbuf_png.def \
+ pixbuf_tiff.def
+
+makefile.mingw: $(top_builddir)/config.status $(top_srcdir)/gdk-pixbuf/makefile.mingw.in
+ cd $(top_builddir) && CONFIG_FILES=gdk-pixbuf/$@ CONFIG_HEADERS= $(SHELL) ./config.status
diff --git a/gdk-pixbuf/gdk-pixbuf-animation.c b/gdk-pixbuf/gdk-pixbuf-animation.c
index 858becf69e..f6741d9387 100644
--- a/gdk-pixbuf/gdk-pixbuf-animation.c
+++ b/gdk-pixbuf/gdk-pixbuf-animation.c
@@ -113,7 +113,7 @@ gdk_pixbuf_animation_new_from_file (const char *filename)
g_return_val_if_fail (filename != NULL, NULL);
- f = fopen (filename, "r");
+ f = fopen (filename, "rb");
if (!f)
return NULL;
diff --git a/gdk-pixbuf/gdk-pixbuf-io.c b/gdk-pixbuf/gdk-pixbuf-io.c
index 5991010393..f795343469 100644
--- a/gdk-pixbuf/gdk-pixbuf-io.c
+++ b/gdk-pixbuf/gdk-pixbuf-io.c
@@ -27,6 +27,11 @@
#include "gdk-pixbuf-private.h"
#include "gdk-pixbuf-io.h"
+#ifdef G_OS_WIN32
+#define STRICT
+#include <windows.h>
+#endif
+
static gboolean
@@ -194,6 +199,65 @@ pixbuf_module_symbol (GModule *module, const char *module_name, const char *symb
return return_value;
}
+#ifdef G_OS_WIN32
+
+/* What would be the right place for this function? Also
+ * gtk needs this function (to find the gtkrc and themes).
+ * But it seems stupid for the gdk-pixbuf DLL to depend
+ * on the gtk DLL. Should it be in the gdk DLL? Or should we
+ * have a small static library at the top gtk+ level?
+ */
+
+static gchar *
+gtk_win32_get_installation_directory (void)
+{
+ static gboolean been_here = FALSE;
+ static gchar gtk_installation_dir[200];
+ gchar win_dir[100];
+ HKEY reg_key = NULL;
+ DWORD type;
+ DWORD nbytes = sizeof (gtk_installation_dir);
+
+ if (been_here)
+ return gtk_installation_dir;
+
+ been_here = TRUE;
+
+ if (RegOpenKeyEx (HKEY_LOCAL_MACHINE, "Software\\GNU\\GTk+", 0,
+ KEY_QUERY_VALUE, &reg_key) != ERROR_SUCCESS
+ || RegQueryValueEx (reg_key, "InstallationDirectory", 0,
+ &type, gtk_installation_dir, &nbytes) != ERROR_SUCCESS
+ || type != REG_SZ)
+ {
+ /* Uh oh. Use hard-coded %WinDir%\gtk+ value */
+ GetWindowsDirectory (win_dir, sizeof (win_dir));
+ sprintf (gtk_installation_dir, "%s\\gtk+", win_dir);
+ }
+
+ if (reg_key != NULL)
+ RegCloseKey (reg_key);
+
+ return gtk_installation_dir;
+}
+
+static char *
+get_libdir (void)
+{
+ static char *libdir = NULL;
+
+ if (libdir == NULL)
+ libdir = g_strdup_printf (gtk_win32_get_installation_directory (),
+ G_DIR_SEPARATOR_S,
+ "loaders",
+ NULL);
+
+ return libdir;
+}
+
+#define PIXBUF_LIBDIR get_libdir ()
+
+#endif
+
/* actually load the image handler - gdk_pixbuf_get_module only get a */
/* reference to the module to load, it doesn't actually load it */
/* perhaps these actions should be combined in one function */
@@ -422,7 +486,7 @@ gdk_pixbuf_new_from_file (const char *filename)
g_return_val_if_fail (filename != NULL, NULL);
- f = fopen (filename, "r");
+ f = fopen (filename, "rb");
if (!f)
return NULL;
diff --git a/gdk-pixbuf/gdk_pixbuf.def b/gdk-pixbuf/gdk_pixbuf.def
new file mode 100644
index 0000000000..546e3bc9f2
--- /dev/null
+++ b/gdk-pixbuf/gdk_pixbuf.def
@@ -0,0 +1,42 @@
+EXPORTS
+ gdk_pixbuf_add_alpha
+ gdk_pixbuf_animation_get_frames
+ gdk_pixbuf_animation_get_height
+ gdk_pixbuf_animation_get_num_frames
+ gdk_pixbuf_animation_get_type
+ gdk_pixbuf_animation_get_width
+ gdk_pixbuf_animation_new_from_file
+ gdk_pixbuf_animation_ref
+ gdk_pixbuf_animation_unref
+ gdk_pixbuf_composite
+ gdk_pixbuf_composite_color
+ gdk_pixbuf_composite_color_simple
+ gdk_pixbuf_copy
+ gdk_pixbuf_copy_area
+ gdk_pixbuf_frame_get_action
+ gdk_pixbuf_frame_get_delay_time
+ gdk_pixbuf_frame_get_pixbuf
+ gdk_pixbuf_frame_get_x_offset
+ gdk_pixbuf_frame_get_y_offset
+ gdk_pixbuf_get_bits_per_sample
+ gdk_pixbuf_get_colorspace
+ gdk_pixbuf_get_has_alpha
+ gdk_pixbuf_get_height
+ gdk_pixbuf_get_module
+ gdk_pixbuf_get_n_channels
+ gdk_pixbuf_get_pixels
+ gdk_pixbuf_get_rowstride
+ gdk_pixbuf_get_type
+ gdk_pixbuf_get_width
+ gdk_pixbuf_init
+ gdk_pixbuf_load_module
+ gdk_pixbuf_new
+ gdk_pixbuf_new_from_data
+ gdk_pixbuf_new_from_file
+ gdk_pixbuf_new_from_xpm_data
+ gdk_pixbuf_postinit
+ gdk_pixbuf_preinit
+ gdk_pixbuf_ref
+ gdk_pixbuf_scale
+ gdk_pixbuf_scale_simple
+ gdk_pixbuf_unref
diff --git a/gdk-pixbuf/io-jpeg.c b/gdk-pixbuf/io-jpeg.c
index ed3ee2ac8e..6a9ffe7d30 100644
--- a/gdk-pixbuf/io-jpeg.c
+++ b/gdk-pixbuf/io-jpeg.c
@@ -50,6 +50,11 @@
#include "gdk-pixbuf-private.h"
#include "gdk-pixbuf-io.h"
+#ifndef HAVE_SIGSETJMP
+#define sigjmp_buf jmp_buf
+#define sigsetjmp(jb, x) setjmp(jb)
+#define siglongjmp longjmp
+#endif
/* we are a "source manager" as far as libjpeg is concerned */
diff --git a/gdk-pixbuf/io-tiff.c b/gdk-pixbuf/io-tiff.c
index 602adb8468..3dd397fda2 100644
--- a/gdk-pixbuf/io-tiff.c
+++ b/gdk-pixbuf/io-tiff.c
@@ -33,6 +33,10 @@
#include "gdk-pixbuf-private.h"
#include "gdk-pixbuf-io.h"
+#ifdef G_OS_WIN32
+#include <fcntl.h>
+#define O_RDWR _O_RDWR
+#endif
typedef struct _TiffData TiffData;
@@ -146,14 +150,24 @@ gdk_pixbuf__tiff_image_begin_load (ModulePreparedNotifyFunc prepare_func,
{
TiffData *context;
gint fd;
+ gchar *tmp = g_get_tmp_dir ();
context = g_new (TiffData, 1);
context->prepare_func = prepare_func;
context->update_func = update_func;
context->user_data = user_data;
context->all_okay = TRUE;
- context->tempname = g_strdup ("/tmp/gdkpixbuf-tif-tmp.XXXXXX");
+ context->tempname =
+ g_strconcat (tmp,
+ tmp[strlen (tmp)] == G_DIR_SEPARATOR ? G_DIR_SEPARATOR_S : "",
+ "gdkpixbuf-tif-tmp.XXXXXX",
+ NULL);
+#ifdef HAVE_MKSTEMP
fd = mkstemp (context->tempname);
+#else
+ mktemp (context->tempname);
+ fd = open (context->tempname, O_RDWR);
+#endif
if (fd < 0) {
g_free (context);
return NULL;
@@ -182,6 +196,7 @@ gdk_pixbuf__tiff_image_stop_load (gpointer data)
fclose (context->file);
unlink (context->tempname);
+ g_free (context->tempname);
g_free ((TiffData *) context);
}
diff --git a/gdk-pixbuf/makefile.mingw.in b/gdk-pixbuf/makefile.mingw.in
new file mode 100644
index 0000000000..08944ec079
--- /dev/null
+++ b/gdk-pixbuf/makefile.mingw.in
@@ -0,0 +1,109 @@
+## Makefile for building the gdk_pixbuf DLL with gcc on Win32
+## Use: make -f makefile.mingw
+
+TOP = ../..
+
+include ../build/win32/make.mingw
+
+# Possibly override GTK+ version from build/win32/module.defs
+GTK_VER = @GTK_MAJOR_VERSION@.@GTK_MINOR_VERSION@
+
+OPTIMIZE = -g
+
+INCLUDES = -I . -I ..
+DEPCFLAGS = $(GLIB_CFLAGS)
+
+all : \
+ ../config.h \
+ gdk_pixbuf-$(GTK_VER).dll \
+ pixbufloader_png.dll \
+ pixbufloader_jpeg.dll \
+ pixbufloader_gif.dll \
+ pixbufloader_ico.dll \
+ pixbufloader_ras.dll \
+ pixbufloader_tiff.dll \
+ pixbufloader_xpm.dll \
+ pixbufloader_pnm.dll \
+ pixbufloader_bmp.dll \
+ test-gdk-pixbuf.exe
+
+gdk_pixbuf_OBJECTS = \
+ gdk-pixbuf.o \
+ gdk-pixbuf-animation.o \
+ gdk-pixbuf-data.o \
+ gdk-pixbuf-io.o \
+ gdk-pixbuf-scale.o \
+ gdk-pixbuf-util.o \
+ pixops/libpixops.a
+
+../config.h : ../config.h.win32
+ cp $< $@
+
+gdk_pixbuf-$(GTK_VER).dll : $(gdk_pixbuf_OBJECTS) gdk_pixbuf.def
+ $(GLIB)/build-dll gdk_pixbuf $(GTK_VER) gdk_pixbuf.def $(gdk_pixbuf_OBJECTS) -L ../gdk -lgdk-$(GTK_VER) $(GLIB_LIBS)
+
+pixops/libpixops.a :
+ cd pixops && $(MAKE) -f makefile.mingw libpixops.a
+
+pixbufloader_png_OBJECTS = io-png.o
+
+pixbufloader_png.dll : $(pixbufloader_png_OBJECTS) pixbufloader_png.def
+ $(GLIB)/build-dll pixbufloader_png - pixbuf_png.def $(pixbufloader_png_OBJECTS) -L . -lgdk_pixbuf-$(GTK_VER) $(GLIB_LIBS) $(PNG_LIBS)
+
+io-png.o : io-png.c
+ $(CC) $(CFLAGS) $(PNG_CFLAGS) -c $<
+
+pixbufloader_jpeg_OBJECTS = io-jpeg.o
+
+pixbufloader_jpeg.dll : $(pixbufloader_jpeg_OBJECTS) pixbufloader_jpeg.def
+ $(GLIB)/build-dll pixbufloader_jpeg - pixbuf_jpeg.def $(pixbufloader_jpeg_OBJECTS) -L . -lgdk_pixbuf-$(GTK_VER) $(GLIB_LIBS) $(JPEG_LIBS)
+
+io-jpeg.o : io-jpeg.c
+ $(CC) $(CFLAGS) $(JPEG_CFLAGS) -c $<
+
+pixbufloader_gif_OBJECTS = io-gif.o
+
+pixbufloader_gif.dll : $(pixbufloader_gif_OBJECTS) pixbufloader_gif.def
+ $(GLIB)/build-dll pixbufloader_gif - pixbuf_gif.def $(pixbufloader_gif_OBJECTS) -L . -lgdk_pixbuf-$(GTK_VER) $(GLIB_LIBS)
+
+pixbufloader_ico_OBJECTS = io-ico.o
+
+pixbufloader_ico.dll : $(pixbufloader_ico_OBJECTS) pixbufloader_ico.def
+ $(GLIB)/build-dll pixbufloader_ico - pixbuf_ico.def $(pixbufloader_ico_OBJECTS) -L . -lgdk_pixbuf-$(GTK_VER) $(GLIB_LIBS)
+
+pixbufloader_ras_OBJECTS = io-ras.o
+
+pixbufloader_ras.dll : $(pixbufloader_ras_OBJECTS) pixbufloader_ras.def
+ $(GLIB)/build-dll pixbufloader_ras - pixbuf_ras.def $(pixbufloader_ras_OBJECTS) -L . -lgdk_pixbuf-$(GTK_VER) $(GLIB_LIBS)
+
+pixbufloader_tiff_OBJECTS = io-tiff.o
+
+pixbufloader_tiff.dll : $(pixbufloader_tiff_OBJECTS) pixbufloader_tiff.def
+ $(GLIB)/build-dll pixbufloader_tiff - pixbuf_tiff.def $(pixbufloader_tiff_OBJECTS) -L . -lgdk_pixbuf-$(GTK_VER) $(GLIB_LIBS) $(TIFF_LIBS) $(JPEG_LIBS) $(ZLIB_LIBS)
+
+io-tiff.o : io-tiff.c
+ $(CC) $(CFLAGS) $(TIFF_CFLAGS) -c $<
+
+pixbufloader_xpm_OBJECTS = io-xpm.o
+
+pixbufloader_xpm.dll : $(pixbufloader_xpm_OBJECTS) pixbufloader_xpm.def
+ $(GLIB)/build-dll pixbufloader_xpm - pixbuf_xpm.def $(pixbufloader_xpm_OBJECTS) -L . -lgdk_pixbuf-$(GTK_VER) $(GLIB_LIBS)
+
+pixbufloader_pnm_OBJECTS = io-pnm.o
+
+pixbufloader_pnm.dll : $(pixbufloader_pnm_OBJECTS) pixbufloader_pnm.def
+ $(GLIB)/build-dll pixbufloader_pnm - pixbuf_pnm.def $(pixbufloader_pnm_OBJECTS) -L . -lgdk_pixbuf-$(GTK_VER) $(GLIB_LIBS)
+
+pixbufloader_bmp_OBJECTS = io-bmp.o
+
+pixbufloader_bmp.dll : $(pixbufloader_bmp_OBJECTS) pixbufloader_bmp.def
+ $(GLIB)/build-dll pixbufloader_bmp - pixbuf_bmp.def $(pixbufloader_bmp_OBJECTS) -L . -lgdk_pixbuf-$(GTK_VER) $(GLIB_LIBS)
+
+test-gdk-pixbuf.exe : test-gdk-pixbuf.o gdk_pixbuf-$(GTK_VER).dll
+ $(CC) $(CFLAGS) -o $@ test-gdk-pixbuf.o -L . -lgdk_pixbuf-$(GTK_VER) $(GTK_LIBS) $(GLIB_LIBS)
+
+# Hack to get an updated makefile.mingw automatically after updating
+# makefile.mingw.in. Only for developer use.
+makefile.mingw: makefile.mingw.in
+ sed -e 's,@GTK_MAJOR[_]VERSION@,@GTK_MAJOR_VERSION@,' \
+ -e 's,@GTK_MINOR[_]VERSION@,@GTK_MINOR_VERSION@,' <$< >$@
diff --git a/gdk-pixbuf/pixbufloader_bmp.def b/gdk-pixbuf/pixbufloader_bmp.def
new file mode 100644
index 0000000000..f11d3f3d2a
--- /dev/null
+++ b/gdk-pixbuf/pixbufloader_bmp.def
@@ -0,0 +1,5 @@
+EXPORTS
+ gdk_pixbuf__bmp_image_load
+ gdk_pixbuf__bmp_image_begin_load
+ gdk_pixbuf__bmp_image_stop_load
+ gdk_pixbuf__bmp_image_load_increment
diff --git a/gdk-pixbuf/pixbufloader_gif.def b/gdk-pixbuf/pixbufloader_gif.def
new file mode 100644
index 0000000000..28ed9b7105
--- /dev/null
+++ b/gdk-pixbuf/pixbufloader_gif.def
@@ -0,0 +1,6 @@
+EXPORTS
+ gdk_pixbuf__gif_image_load
+ gdk_pixbuf__gif_image_begin_load
+ gdk_pixbuf__gif_image_stop_load
+ gdk_pixbuf__gif_image_load_increment
+ gdk_pixbuf__gif_image_load_animation
diff --git a/gdk-pixbuf/pixbufloader_ico.def b/gdk-pixbuf/pixbufloader_ico.def
new file mode 100644
index 0000000000..6bc5257a84
--- /dev/null
+++ b/gdk-pixbuf/pixbufloader_ico.def
@@ -0,0 +1,5 @@
+EXPORTS
+ gdk_pixbuf__ico_image_load
+ gdk_pixbuf__ico_image_begin_load
+ gdk_pixbuf__ico_image_stop_load
+ gdk_pixbuf__ico_image_load_increment
diff --git a/gdk-pixbuf/pixbufloader_jpeg.def b/gdk-pixbuf/pixbufloader_jpeg.def
new file mode 100644
index 0000000000..ee673b3272
--- /dev/null
+++ b/gdk-pixbuf/pixbufloader_jpeg.def
@@ -0,0 +1,5 @@
+EXPORTS
+ gdk_pixbuf__jpeg_image_load
+ gdk_pixbuf__jpeg_image_begin_load
+ gdk_pixbuf__jpeg_image_stop_load
+ gdk_pixbuf__jpeg_image_load_increment
diff --git a/gdk-pixbuf/pixbufloader_png.def b/gdk-pixbuf/pixbufloader_png.def
new file mode 100644
index 0000000000..424737016e
--- /dev/null
+++ b/gdk-pixbuf/pixbufloader_png.def
@@ -0,0 +1,5 @@
+EXPORTS
+ gdk_pixbuf__png_image_load
+ gdk_pixbuf__png_image_begin_load
+ gdk_pixbuf__png_image_stop_load
+ gdk_pixbuf__png_image_load_increment
diff --git a/gdk-pixbuf/pixbufloader_pnm.def b/gdk-pixbuf/pixbufloader_pnm.def
new file mode 100644
index 0000000000..b708d1cfc3
--- /dev/null
+++ b/gdk-pixbuf/pixbufloader_pnm.def
@@ -0,0 +1,5 @@
+EXPORTS
+ gdk_pixbuf__pnm_image_load
+ gdk_pixbuf__pnm_image_begin_load
+ gdk_pixbuf__pnm_image_stop_load
+ gdk_pixbuf__pnm_image_load_increment
diff --git a/gdk-pixbuf/pixbufloader_ras.def b/gdk-pixbuf/pixbufloader_ras.def
new file mode 100644
index 0000000000..a4e3e043bc
--- /dev/null
+++ b/gdk-pixbuf/pixbufloader_ras.def
@@ -0,0 +1,5 @@
+EXPORTS
+ gdk_pixbuf__ras_image_load
+ gdk_pixbuf__ras_image_begin_load
+ gdk_pixbuf__ras_image_stop_load
+ gdk_pixbuf__ras_image_load_increment
diff --git a/gdk-pixbuf/pixbufloader_tiff.def b/gdk-pixbuf/pixbufloader_tiff.def
new file mode 100644
index 0000000000..264d50ae4b
--- /dev/null
+++ b/gdk-pixbuf/pixbufloader_tiff.def
@@ -0,0 +1,5 @@
+EXPORTS
+ gdk_pixbuf__tiff_image_load
+ gdk_pixbuf__tiff_image_begin_load
+ gdk_pixbuf__tiff_image_stop_load
+ gdk_pixbuf__tiff_image_load_increment
diff --git a/gdk-pixbuf/pixbufloader_xpm.def b/gdk-pixbuf/pixbufloader_xpm.def
new file mode 100644
index 0000000000..45bf96ce25
--- /dev/null
+++ b/gdk-pixbuf/pixbufloader_xpm.def
@@ -0,0 +1,3 @@
+EXPORTS
+ gdk_pixbuf__xpm_image_load
+ gdk_pixbuf__xpm_image_load_xpm_data
diff --git a/gdk-pixbuf/pixops/Makefile.am b/gdk-pixbuf/pixops/Makefile.am
index 5fe5fd5464..f799f42ffc 100644
--- a/gdk-pixbuf/pixops/Makefile.am
+++ b/gdk-pixbuf/pixops/Makefile.am
@@ -22,4 +22,10 @@ libpixops_la_SOURCES = \
$(mmx_sources)
EXTRA_DIST = \
- DETAILS \ No newline at end of file
+ DETAILS \
+ makefile.mingw \
+ makefile.mingw.in
+
+makefile.mingw: $(top_builddir)/config.status $(top_srcdir)/gdk-pixbuf/pixops/makefile.mingw.in
+ cd $(top_builddir) && CONFIG_FILES=gdk-pixbuf/pixops/$@ CONFIG_HEADERS= $(SHELL) ./config.status
+
diff --git a/gdk-pixbuf/pixops/composite_line_22_4a4_mmx.S b/gdk-pixbuf/pixops/composite_line_22_4a4_mmx.S
index f3edc8ab08..3b3c2c472b 100644
--- a/gdk-pixbuf/pixops/composite_line_22_4a4_mmx.S
+++ b/gdk-pixbuf/pixops/composite_line_22_4a4_mmx.S
@@ -3,8 +3,19 @@
gcc2_compiled.:
.text
.align 16
+
+#ifndef __MINGW32__
+
.globl pixops_composite_line_22_4a4_mmx
.type pixops_composite_line_22_4a4_mmx,@function
+pixops_composite_line_22_4a4_mmx:
+
+#else
+
+.globl _pixops_composite_line_22_4a4_mmx
+_pixops_composite_line_22_4a4_mmx:
+
+#endif
/*
* Arguments
*
@@ -17,7 +28,6 @@ gcc2_compiled.:
* xinit: 32(%ebp)
*
*/
-pixops_composite_line_22_4a4_mmx:
/*
* Function call entry
*/
diff --git a/gdk-pixbuf/pixops/composite_line_color_22_4a4_mmx.S b/gdk-pixbuf/pixops/composite_line_color_22_4a4_mmx.S
index e3fd640d65..28d2c8b852 100644
--- a/gdk-pixbuf/pixops/composite_line_color_22_4a4_mmx.S
+++ b/gdk-pixbuf/pixops/composite_line_color_22_4a4_mmx.S
@@ -3,8 +3,19 @@
gcc2_compiled.:
.text
.align 16
+
+#ifndef __MINGW32__
+
.globl pixops_composite_line_color_22_4a4_mmx
.type pixops_composite_line_color_22_4a4_mmx,@function
+pixops_composite_line_color_22_4a4_mmx:
+
+#else
+
+.globl _pixops_composite_line_color_22_4a4_mmx
+_pixops_composite_line_color_22_4a4_mmx:
+
+#endif
/*
* Arguments
*
@@ -20,7 +31,7 @@ gcc2_compiled.:
* colors: 44(%ebp)
*
*/
-pixops_composite_line_color_22_4a4_mmx:
+
/*
* Function call entry
*/
diff --git a/gdk-pixbuf/pixops/have_mmx.S b/gdk-pixbuf/pixops/have_mmx.S
index da222500fe..f777fb89cd 100644
--- a/gdk-pixbuf/pixops/have_mmx.S
+++ b/gdk-pixbuf/pixops/have_mmx.S
@@ -3,10 +3,20 @@
gcc2_compiled.:
.text
.align 16
+
+#ifndef __MINGW32__
+
.globl pixops_have_mmx
.type pixops_have_mmx,@function
-
pixops_have_mmx:
+
+#else
+
+.globl _pixops_have_mmx
+_pixops_have_mmx:
+
+#endif
+
push %ebx
# Check if bit 21 in flags word is writeable
diff --git a/gdk-pixbuf/pixops/makefile.mingw.in b/gdk-pixbuf/pixops/makefile.mingw.in
new file mode 100644
index 0000000000..42e8fae48a
--- /dev/null
+++ b/gdk-pixbuf/pixops/makefile.mingw.in
@@ -0,0 +1,40 @@
+## Makefile for building libpixops.a with gcc on Win32
+## Use: make -f makefile.mingw
+
+TOP = ../../..
+
+include $(TOP)/build/win32/make.mingw
+
+# Possibly override GTK+ version from build/win32/module.defs
+GTK_VER = @GTK_MAJOR_VERSION@.@GTK_MINOR_VERSION@
+
+OPTIMIZE = -g
+
+INCLUDES = -I .. -I ../..
+DEPCFLAGS = $(GLIB_CFLAGS) $(PNG_CFLAGS) $(ZLIB_CFLAGS) $(JPEG_CLFAGS) $(TIFF_CFLAGS)
+
+all : \
+ ../../config.h \
+ libpixops.a \
+ timescale.exe
+
+libpixops_OBJECTS = \
+ pixops.o \
+ have_mmx.o \
+ scale_line_22_33_mmx.o \
+ composite_line_22_4a4_mmx.o \
+ composite_line_color_22_4a4_mmx.o
+
+../../config.h : ../../config.h.win32
+ cp $< $@
+
+libpixops.a : $(libpixops_OBJECTS)
+ ar rv $@ $?
+
+timescale.exe : timescale.o libpixops.a
+ $(CC) $(CFLAGS) -o $@ timescale.o libpixops.a $(GLIB_LIBS)
+
+makefile.mingw: makefile.mingw.in
+ sed -e 's,@GTK_MAJOR[_]VERSION@,@GTK_MAJOR_VERSION@,' \
+ -e 's,@GTK_MINOR[_]VERSION@,@GTK_MINOR_VERSION@,' <$< >$@
+
diff --git a/gdk-pixbuf/pixops/scale_line_22_33_mmx.S b/gdk-pixbuf/pixops/scale_line_22_33_mmx.S
index e253fc1889..40dec48d3e 100644
--- a/gdk-pixbuf/pixops/scale_line_22_33_mmx.S
+++ b/gdk-pixbuf/pixops/scale_line_22_33_mmx.S
@@ -3,8 +3,19 @@
gcc2_compiled.:
.text
.align 16
+
+#ifndef __MINGW32__
+
.globl pixops_scale_line_22_33_mmx
.type pixops_scale_line_22_33_mmx,@function
+pixops_scale_line_22_33_mmx:
+
+#else
+
+.globl _pixops_scale_line_22_33_mmx
+_pixops_scale_line_22_33_mmx:
+
+#endif
/*
* Arguments
*
@@ -17,7 +28,7 @@ gcc2_compiled.:
* xinit: 32(%ebp)
*
*/
-pixops_scale_line_22_33_mmx:
+
/*
* Function call entry
*/
diff --git a/gdk-pixbuf/pixops/timescale.c b/gdk-pixbuf/pixops/timescale.c
index b835ff5424..f3c9045667 100644
--- a/gdk-pixbuf/pixops/timescale.c
+++ b/gdk-pixbuf/pixops/timescale.c
@@ -1,24 +1,24 @@
-#include <unistd.h>
+#include <glib.h>
#include <string.h>
-#include <sys/time.h>
#include <stdlib.h>
#include <stdio.h>
+
#include "pixops.h"
-struct timeval start_time;
+static GTimeVal start_time;
void start_timing (void)
{
- gettimeofday (&start_time, NULL);
+ g_get_current_time (&start_time);
}
double
stop_timing (const char *test, int iterations, int bytes)
{
- struct timeval stop_time;
+ GTimeVal stop_time;
double msecs;
- gettimeofday (&stop_time, NULL);
+ g_get_current_time (&stop_time);
if (stop_time.tv_usec < start_time.tv_usec)
{
stop_time.tv_usec += 1000000;