fix {u}intptr_t usage on wince with msvc
authorRomain Pokrzywka <romain@kdab.com>
Tue, 4 May 2010 13:41:35 +0000 (15:41 +0200)
committerRalf Habacker <ralf.habacker@freenet.de>
Wed, 5 May 2010 05:57:28 +0000 (07:57 +0200)
cmake/ConfigureChecks.cmake
cmake/config.h.cmake
dbus/dbus-hash.h
dbus/dbus-pipe.h
dbus/dbus-sysdeps-util-win.c
dbus/dbus-sysdeps-wince-glue.h
dbus/dbus-sysdeps.h

index b8b6c77..e48b60d 100644 (file)
@@ -19,6 +19,7 @@ check_include_file(errno.h     HAVE_ERRNO_H)    # dbus-sysdeps.c
 check_include_file(signal.h     HAVE_SIGNAL_H)
 check_include_file(locale.h     HAVE_LOCALE_H)
 check_include_file(inttypes.h     HAVE_INTTYPES_H)   # dbus-pipe.h
+check_include_file(stdint.h     HAVE_STDINT_H)   # dbus-pipe.h
 
 check_symbol_exists(backtrace    "execinfo.h"       HAVE_BACKTRACE)          #  dbus-sysdeps.c, dbus-sysdeps-win.c
 check_symbol_exists(getgrouplist "grp.h"            HAVE_GETGROUPLIST)       #  dbus-sysdeps.c
index 4816db9..956c6d2 100644 (file)
 /* Define to 1 if you have inttypes.h */
 #cmakedefine   HAVE_INTTYPES_H 1
 
+/* Define to 1 if you have stdint.h */
+#cmakedefine   HAVE_STDINT_H 1
+
 // symbols
 /* Define to 1 if you have backtrace */
 #cmakedefine   HAVE_BACKTRACE 1
index 424a946..d1ca246 100644 (file)
@@ -24,8 +24,8 @@
 #ifndef DBUS_HASH_H
 #define DBUS_HASH_H
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
+#ifdef HAVE_STDINT_H
+#include <stdint.h>
 #endif
 
 #ifdef HAVE_INTTYPES_H
@@ -34,6 +34,7 @@
 
 #include <dbus/dbus-memory.h>
 #include <dbus/dbus-types.h>
+#include <dbus/dbus-sysdeps.h>
 
 DBUS_BEGIN_DECLS
 
index 2ec80da..f6eac5f 100644 (file)
@@ -25,8 +25,8 @@
 #ifndef DBUS_PIPE_H
 #define DBUS_PIPE_H
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
+#ifdef HAVE_STDINT_H
+#include <stdint.h>
 #endif
 
 #ifdef HAVE_INTTYPES_H
 #include <dbus/dbus-types.h>
 #include <dbus/dbus-errors.h>
 #include <dbus/dbus-string.h>
+#include <dbus/dbus-sysdeps.h>
 
-typedef struct {
+struct DBusPipe {
   intptr_t fd_or_handle;
-} DBusPipe;
+};
 
 void        _dbus_pipe_init                (DBusPipe         *pipe,
                                             intptr_t          fd);
index 4568fa2..6c101e7 100644 (file)
@@ -34,6 +34,7 @@
 #include "dbus-sysdeps-win.h"
 #include "dbus-sockets-win.h"
 #include "dbus-memory.h"
+#include "dbus-pipe.h"
 
 #include <stdio.h>
 #include <stdlib.h>
index 6d8e3b1..3391be9 100644 (file)
@@ -29,7 +29,6 @@
 #include <stdarg.h>
 
 /* For getaddrinfo.  */
-#define _WIN32_WCE 0x0401 
 #include <windows.h>
 #undef interface
 
@@ -107,10 +106,19 @@ void abort (void);
 #define _S_IREAD        0000400         /* read permission, owner */
 #define _S_IWRITE       0000200         /* write permission, owner */
 #define _S_IEXEC        0000100         /* execute/search permission, owner */
+
 #ifndef __OFF_T_DEFINED
 typedef long off_t;
 #define __OFF_T_DEFINED
 #endif
+#ifndef _INTPTR_T_DEFINED
+typedef int intptr_t;
+#define _INTPTR_T_DEFINED
+#endif
+#ifndef _UINTPTR_T_DEFINED
+typedef unsigned int uintptr_t;
+#define _UINTPTR_T_DEFINED
+#endif
 
 #ifndef _MAX_FNAME
 #define _MAX_FNAME 256
index e00c2f9..b183b1f 100644 (file)
@@ -28,7 +28,6 @@
 #include <dbus/dbus-errors.h>
 #include <dbus/dbus-file.h>
 #include <dbus/dbus-string.h>
-#include <dbus/dbus-pipe.h>
 
 /* this is perhaps bogus, but strcmp() etc. are faster if we use the
  * stuff straight out of string.h, so have this here for now.
@@ -68,6 +67,9 @@ typedef struct DBusList DBusList;
 /** Object that contains a list of credentials such as UNIX or Windows user ID */
 typedef struct DBusCredentials DBusCredentials;
 
+/** A wrapper around a pipe descriptor or handle */
+typedef struct DBusPipe DBusPipe;
+
 /**
  * @addtogroup DBusSysdeps
  *