summaryrefslogtreecommitdiffstats
path: root/dbus/dbus-internals.h
diff options
context:
space:
mode:
authorHavoc Pennington <hp@redhat.com>2005-01-28 03:06:56 +0000
committerHavoc Pennington <hp@redhat.com>2005-01-28 03:06:56 +0000
commit3ed9db546e1143bc9aa2d83a6f423fdd81227352 (patch)
tree6ba7a785ddeff02224072cc51faf108482dfb0c7 /dbus/dbus-internals.h
parent4506b6594b4a86557fad7850f56b5fdabd3108de (diff)
2005-01-27 Havoc Pennington <hp@redhat.com>
* dbus/dbus-arch-deps.h.in: add 16/32-bit types * configure.in: find the right type for 16 and 32 bit ints as well as 64 * dbus/dbus-protocol.h (DBUS_TYPE_INT16, DBUS_TYPE_UINT16): add the 16-bit types so people don't have to stuff them in 32-bit or byte arrays.
Diffstat (limited to 'dbus/dbus-internals.h')
-rw-r--r--dbus/dbus-internals.h15
1 files changed, 11 insertions, 4 deletions
diff --git a/dbus/dbus-internals.h b/dbus/dbus-internals.h
index 2ffd2341..3f0a34fe 100644
--- a/dbus/dbus-internals.h
+++ b/dbus/dbus-internals.h
@@ -183,11 +183,18 @@ dbus_bool_t _dbus_string_array_contains (const char **array,
const char *str);
char** _dbus_dup_string_array (const char **array);
-#define _DBUS_INT_MIN (-_DBUS_INT_MAX - 1)
-#define _DBUS_INT_MAX 2147483647
-#define _DBUS_UINT_MAX 0xffffffff
+#define _DBUS_INT16_MIN ((dbus_int16_t) 0x8000)
+#define _DBUS_INT16_MAX ((dbus_int16_t) 0x7fff)
+#define _DBUS_UINT16_MAX ((dbus_uint16_t)0xffff)
+#define _DBUS_INT32_MIN ((dbus_int32_t) 0x80000000)
+#define _DBUS_INT32_MAX ((dbus_int32_t) 0x7fffffff)
+#define _DBUS_UINT32_MAX ((dbus_uint32_t)0xffffffff)
+/* using 32-bit here is sort of bogus */
+#define _DBUS_INT_MIN _DBUS_INT32_MIN
+#define _DBUS_INT_MAX _DBUS_INT32_MAX
+#define _DBUS_UINT_MAX _DBUS_UINT32_MAX
#ifdef DBUS_HAVE_INT64
-#define _DBUS_INT64_MAX DBUS_INT64_CONSTANT (9223372036854775807)
+#define _DBUS_INT64_MAX DBUS_INT64_CONSTANT (0x7fffffffffffffff)
#define _DBUS_UINT64_MAX DBUS_UINT64_CONSTANT (0xffffffffffffffff)
#endif
#define _DBUS_ONE_KILOBYTE 1024