1 diff -ur mingw32-dbus-1.2.4.orig/dbuscxx/examples/echo/echo-server.cpp mingw32-dbus-1.2.4.mingw/dbuscxx/examples/echo/echo-server.cpp
2 --- mingw32-dbus-1.2.4.orig/dbuscxx/examples/echo/echo-server.cpp 2008-10-31 10:01:59.000000000 +0000
3 +++ mingw32-dbus-1.2.4.mingw/dbuscxx/examples/echo/echo-server.cpp 2008-10-31 16:43:45.000000000 +0000
5 #include "echo-server.h"
9 +#include <Winsock2.h.>
10 +#define HOST_NAME_MAX 256
20 DBus::Int32 EchoServer::Random()
25 gethostname(hostname, sizeof(hostname));
26 info["hostname"] = hostname;
28 info["username"] = getlogin();
30 + info["username"] = "username not available";
36 signal(SIGTERM, niam);
39 + DBus::_init_threading();
40 DBus::default_dispatcher = &dispatcher;
42 DBus::Connection conn = DBus::Connection::SessionBus();
43 diff -ur mingw32-dbus-1.2.4.orig/dbuscxx/examples/properties/Makefile.am mingw32-dbus-1.2.4.mingw/dbuscxx/examples/properties/Makefile.am
44 --- mingw32-dbus-1.2.4.orig/dbuscxx/examples/properties/Makefile.am 2008-10-31 10:01:58.000000000 +0000
45 +++ mingw32-dbus-1.2.4.mingw/dbuscxx/examples/properties/Makefile.am 2008-10-31 16:59:31.000000000 +0000
47 noinst_PROGRAMS = props-server
49 props_server_SOURCES = props-glue.h props-server.h props-server.cpp
50 -props_server_LDADD = $(top_builddir)/src/libdbus-c++-1.la
51 +props_server_LDADD = $(top_builddir)/src/libdbus-c++-1.la \
52 + -L$(top_srcdir)/../trunk/dbus/.libs
54 props-glue.h: props-introspect.xml
55 $(top_builddir)/tools/dbusxx-xml2cpp $^ --adaptor=$@
56 diff -ur mingw32-dbus-1.2.4.orig/dbuscxx/include/dbus-c++/interface.h mingw32-dbus-1.2.4.mingw/dbuscxx/include/dbus-c++/interface.h
57 --- mingw32-dbus-1.2.4.orig/dbuscxx/include/dbus-c++/interface.h 2008-10-31 10:01:57.000000000 +0000
58 +++ mingw32-dbus-1.2.4.mingw/dbuscxx/include/dbus-c++/interface.h 2008-10-31 16:43:45.000000000 +0000
61 typedef std::map<std::string, PropertyData> PropertyTable;
63 -class IntrospectedInterface;
64 +struct IntrospectedInterface;
67 class InterfaceAdaptor;
68 diff -ur mingw32-dbus-1.2.4.orig/dbuscxx/src/eventloop.cpp mingw32-dbus-1.2.4.mingw/dbuscxx/src/eventloop.cpp
69 --- mingw32-dbus-1.2.4.orig/dbuscxx/src/eventloop.cpp 2008-10-31 10:01:55.000000000 +0000
70 +++ mingw32-dbus-1.2.4.mingw/dbuscxx/src/eventloop.cpp 2008-10-31 16:53:59.000000000 +0000
72 #include <dbus-c++/eventloop.h>
73 #include <dbus-c++/debug.h>
79 +/** There is data to read */
80 +#define POLLIN 0x0001
81 +/** There is urgent data to read */
82 +#define POLLPRI 0x0002
83 +/** Writing now will not block */
84 +#define POLLOUT 0x0004
85 +/** Error condition */
86 +#define POLLERR 0x0008
88 +#define POLLHUP 0x0010
89 +/** Invalid request: fd not open */
90 +#define POLLNVAL 0x0020
93 + * A portable struct pollfd wrapper.
97 + int fd; /**< File descriptor */
98 + short events; /**< Events to poll for */
99 + short revents; /**< Events that occurred */
100 +} DBusPollFD,pollfd;
102 +extern "C" int _dbus_poll (DBusPollFD *fds,
104 + int timeout_milliseconds);
105 +#define poll _dbus_poll
110 #include <sys/time.h>
113 #include <dbus/dbus.h>
115 using namespace DBus;
119 +#include <windows.h>
120 +typedef long tv_sec;
121 +typedef long tv_usec;
123 +#define POLLIN 0x0001 /* There is data to read */
124 +#define POLLPRI 0x0002 /* There is urgent data to read */
125 +#define POLLOUT 0x0004 /* Writing now will not block */
126 +#define POLLERR 0x0008 /* Error condition */
127 +#define POLLHUP 0x0010 /* Hung up */
128 +#define POLLNVAL 0x0020 /* Invalid request: fd not open */
136 +// http://man.cx/poll(2)
137 +int poll(pollfd *fds, unsigned int nfd, int wait_min)
139 + // convert to select parameter structure and call select
141 + /* on return set revent structure
142 + either of the type requested, or of one of the types POLLERR or POLLHUP
143 + or POLLNVAL. (These three bits are meaningless in the events field,
148 + On success, a positive number is returned, where the number returned is
149 + the number of structures which have non-zero revents fields (in other
150 + words, those descriptors with events or errors reported). A value of 0
151 + indicates that the call timed out and no file descriptors have been
152 + selected. On error, -1 is returned, and errno is set appropriately.
159 +void gettimeofday (struct timeval *t, void *)
162 + dbus_uint64_t *time64 = (dbus_uint64_t *) &ft;
164 + GetSystemTimeAsFileTime (&ft);
166 + /* Convert from 100s of nanoseconds since 1601-01-01
167 + * to Unix epoch. Yes, this is Y2038 unsafe.
169 + *time64 -= DBUS_INT64_CONSTANT (116444736000000000);
173 + t->tv_sec = *time64 / 1000000;
174 + t->tv_usec = *time64 % 1000000;
181 static double millis( timeval tv )
183 return (tv.tv_sec*1000.0 + tv.tv_usec/1000.0);
186 int nfd = _watches.size();
189 + pollfd *fds = new pollfd[nfd];
191 Watches::iterator wi = _watches.begin();
201 diff -ur mingw32-dbus-1.2.4.orig/dbuscxx/src/internalerror.h mingw32-dbus-1.2.4.mingw/dbuscxx/src/internalerror.h
202 --- mingw32-dbus-1.2.4.orig/dbuscxx/src/internalerror.h 2008-10-31 10:01:55.000000000 +0000
203 +++ mingw32-dbus-1.2.4.mingw/dbuscxx/src/internalerror.h 2008-10-31 16:43:45.000000000 +0000
208 -struct InternalError
215 diff -ur mingw32-dbus-1.2.4.orig/dbuscxx/src/Makefile.am mingw32-dbus-1.2.4.mingw/dbuscxx/src/Makefile.am
216 --- mingw32-dbus-1.2.4.orig/dbuscxx/src/Makefile.am 2008-10-31 10:01:55.000000000 +0000
217 +++ mingw32-dbus-1.2.4.mingw/dbuscxx/src/Makefile.am 2008-10-31 16:50:28.000000000 +0000
223 -I$(top_srcdir)/include
226 diff -ur mingw32-dbus-1.2.4.orig/dbuscxx/src/message.cpp mingw32-dbus-1.2.4.mingw/dbuscxx/src/message.cpp
227 --- mingw32-dbus-1.2.4.orig/dbuscxx/src/message.cpp 2008-10-31 10:01:55.000000000 +0000
228 +++ mingw32-dbus-1.2.4.mingw/dbuscxx/src/message.cpp 2008-10-31 16:44:31.000000000 +0000
235 #include <dbus-c++/message.h>
237 #include <dbus/dbus.h>
238 diff -ur mingw32-dbus-1.2.4.orig/dbuscxx/src/object.cpp mingw32-dbus-1.2.4.mingw/dbuscxx/src/object.cpp
239 --- mingw32-dbus-1.2.4.orig/dbuscxx/src/object.cpp 2008-10-31 10:01:55.000000000 +0000
240 +++ mingw32-dbus-1.2.4.mingw/dbuscxx/src/object.cpp 2008-10-31 16:42:28.000000000 +0000
242 #include <dbus-c++/object.h>
243 #include "internalerror.h"
248 #include <dbus/dbus.h>
250 diff -ur mingw32-dbus-1.2.4.orig/dbuscxx/src/types.cpp mingw32-dbus-1.2.4.mingw/dbuscxx/src/types.cpp
251 --- mingw32-dbus-1.2.4.orig/dbuscxx/src/types.cpp 2008-10-31 10:01:55.000000000 +0000
252 +++ mingw32-dbus-1.2.4.mingw/dbuscxx/src/types.cpp 2008-10-31 16:44:17.000000000 +0000
259 #include <dbus-c++/types.h>
260 #include <dbus-c++/object.h>
261 #include <dbus/dbus.h>
262 diff -ur mingw32-dbus-1.2.4.orig/dbuscxx/tools/introspect.cpp mingw32-dbus-1.2.4.mingw/dbuscxx/tools/introspect.cpp
263 --- mingw32-dbus-1.2.4.orig/dbuscxx/tools/introspect.cpp 2008-10-31 10:01:56.000000000 +0000
264 +++ mingw32-dbus-1.2.4.mingw/dbuscxx/tools/introspect.cpp 2008-10-31 16:50:41.000000000 +0000
274 #include "introspect.h"
280 DBus::BusDispatcher dispatcher;
281 static bool systembus;
285 int main( int argc, char** argv )
288 signal(SIGTERM, niam);
289 signal(SIGINT, niam);
290 signal(SIGALRM, niam);
297 DBus::default_dispatcher = &dispatcher;
305 diff -ur mingw32-dbus-1.2.4.orig/dbuscxx/tools/Makefile.am mingw32-dbus-1.2.4.mingw/dbuscxx/tools/Makefile.am
306 --- mingw32-dbus-1.2.4.orig/dbuscxx/tools/Makefile.am 2008-10-31 10:01:56.000000000 +0000
307 +++ mingw32-dbus-1.2.4.mingw/dbuscxx/tools/Makefile.am 2008-10-31 16:59:53.000000000 +0000
313 -I$(top_srcdir)/include
318 dbusxx_xml2cpp_SOURCES = xml2cpp.h xml2cpp.cpp
319 dbusxx_xml2cpp_LDADD = $(libdbus_cxx_la)
320 +dbusxx_xml2cpp_LDFLAGS = -L../../trunk/dbus/.libs
322 dbusxx_introspect_SOURCES = introspect.h introspect.cpp
323 dbusxx_introspect_LDADD = $(libdbus_cxx_la)
324 +dbusxx_introspect_LDFLAGS = -L../../trunk/dbus/.libs
326 MAINTAINERCLEANFILES = \
328 diff -ur mingw32-dbus-1.2.4.orig/dbuscxx/tools/xml2cpp.cpp mingw32-dbus-1.2.4.mingw/dbuscxx/tools/xml2cpp.cpp
329 --- mingw32-dbus-1.2.4.orig/dbuscxx/tools/xml2cpp.cpp 2008-10-31 10:01:56.000000000 +0000
330 +++ mingw32-dbus-1.2.4.mingw/dbuscxx/tools/xml2cpp.cpp 2008-10-31 16:45:02.000000000 +0000
338 #include <dbus/dbus.h>