From 0710ad564f97bf0e8aa3460fcb79110623d46544 Mon Sep 17 00:00:00 2001 From: Andy Spencer Date: Tue, 24 May 2011 06:11:28 +0000 Subject: [PATCH] Misc win32 fixes --- data/Makefile.am | 4 ++-- src/Makefile.am | 2 ++ src/main.c | 3 ++- src/plugins/Makefile.am | 7 ++++++- src/plugins/radar.c | 9 +++++++-- 5 files changed, 19 insertions(+), 6 deletions(-) diff --git a/data/Makefile.am b/data/Makefile.am index 9a6dd00..ba5e93e 100644 --- a/data/Makefile.am +++ b/data/Makefile.am @@ -4,8 +4,8 @@ dist_gtkbuilder_DATA = main.ui configdir = $(datadir)/aweather/ dist_config_DATA = defaults.ini -colordir = $(datadir)/aweather/ -dist_color_DATA = colors/ +colordir = $(datadir)/aweather/colors/ +dist_color_DATA = colors/* if WIN32 noinst_DATA = aweather.ico diff --git a/src/Makefile.am b/src/Makefile.am index 9b88037..ca40656 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -23,6 +23,8 @@ wsr88ddec_LDFLAGS = -mwindows aweather_SOURCES += resource.rc aweather_LDFLAGS = -mwindows +aweather_CPPFLAGS += -I$(top_srcdir)/lib +aweather_LDADD += $(top_srcdir)/lib/libgnu.la bin_PROGRAMS += aweather-dbg aweather_dbg_SOURCES = $(aweather_SOURCES) diff --git a/src/main.c b/src/main.c index a398e78..94cf0c7 100644 --- a/src/main.c +++ b/src/main.c @@ -15,11 +15,12 @@ * along with this program. If not, see . */ +#define _XOPEN_SOURCE +#include #include #include #include #include -#include #include diff --git a/src/plugins/Makefile.am b/src/plugins/Makefile.am index 9755b8c..9fe42ae 100644 --- a/src/plugins/Makefile.am +++ b/src/plugins/Makefile.am @@ -16,11 +16,16 @@ radar_la_SOURCES = \ ../aweather-location.c \ ../aweather-location.h radar_la_CPPFLAGS = \ - -DPKGDATADIR="\"$(dots)$(pkgdatadir)\"" + -DPKGDATADIR="\"$(dots)$(pkgdatadir)\"" \ + -I$(top_srcdir)/src -I$(top_srcdir)/lib radar_la_LIBADD = $(RSL_LIBS) $(GRITS_LIBS) \ $(addprefix $(top_srcdir)/lib/,$(gl_LTLIBOBJS)) endif +if WIN32 +dots = .. +endif + test: ( cd ../; make test ) diff --git a/src/plugins/radar.c b/src/plugins/radar.c index 17794e2..1f34fb3 100644 --- a/src/plugins/radar.c +++ b/src/plugins/radar.c @@ -632,9 +632,14 @@ static void _load_colormap(gchar *filename, AWeatherColormap *cm) fgets(cm->name, sizeof(cm->name), file); fscanf(file, "%f\n", &cm->scale); fscanf(file, "%f\n", &cm->shift); - while (fscanf(file, "%hhd %hhd %hhd %hhd\n", - &color[0], &color[1], &color[2], &color[3]) == 4) + int r, g, b, a; + while (fscanf(file, "%d %d %d %d\n", &r, &g, &b, &a) == 4) { + color[0] = r; + color[1] = g; + color[2] = b; + color[3] = a; g_array_append_val(array, color); + } cm->len = (gint )array->len; cm->data = (void*)array->data; g_array_free(array, FALSE); -- 2.43.2