diff --git a/telepathy-glib/debug.c b/telepathy-glib/debug.c index 51e20ae..edc2c10 100755 --- a/telepathy-glib/debug.c +++ b/telepathy-glib/debug.c @@ -71,6 +71,12 @@ #include "debug-internal.h" +#ifdef WIN32 +#define STDIN_FILENO 0 /* standard input file descriptor */ +#define STDOUT_FILENO 1 /* standard output file descriptor */ +#define STDERR_FILENO 2 /* standard error file descriptor */ +#endif + #ifdef ENABLE_DEBUG static TpDebugFlags flags = 0; @@ -457,13 +463,28 @@ tp_debug_timestamped_log_handler (const gchar *log_domain, GTimeVal now; gchar now_str[32]; gchar *tmp; - struct tm tm; +#ifdef WIN32 + struct tm* tm; +#else + struct tm tm; +#endif + time_t sec; g_get_current_time (&now); sec = now.tv_sec; - localtime_r (&sec, &tm); - strftime (now_str, 32, "%Y-%m-%d %H:%M:%S", &tm); +#ifdef WIN32 + tm = localtime(&(sec)); +#else + localtime_r (&sec, &tm); +#endif + +#ifdef WIN32 + strftime (now_str, 32, "%Y-%m-%d %H:%M:%S", tm); +#else + strftime (now_str, 32, "%Y-%m-%d %H:%M:%S", &tm); +#endif + tmp = g_strdup_printf ("%s.%06ld: %s", now_str, now.tv_usec, message); message = tmp; #endif diff --git a/telepathy-glib/proxy.h b/telepathy-glib/proxy.h index bd6b3a9..8bb3027 100755 --- a/telepathy-glib/proxy.h +++ b/telepathy-glib/proxy.h @@ -25,8 +25,18 @@ #include #include +#ifdef WIN32 +#include +#endif + G_BEGIN_DECLS +#ifdef WIN32 +#ifdef interface +#undef interface +#endif +#endif + /* Forward declaration of a subclass - from dbus.h */ typedef struct _TpDBusDaemon TpDBusDaemon; diff --git a/telepathy-glib/dbus-properties-mixin.h b/telepathy-glib/dbus-properties-mixin.h index fa1d013..e097344 100755 --- a/telepathy-glib/dbus-properties-mixin.h +++ b/telepathy-glib/dbus-properties-mixin.h @@ -54,6 +54,9 @@ void tp_svc_interface_set_dbus_properties_info (GType g_interface, TpDBusPropertiesMixinIfaceInfo *info); /* ---- Concrete implementation (in GObject subclasses) ------------- */ +#if WIN32 +#undef interface; +#endif typedef void (*TpDBusPropertiesMixinGetter) (GObject *object, GQuark interface, GQuark name, GValue *value, gpointer getter_data);