+#ifdef DBUS_HAVE_INT64
+static dbus_int64_t
+int64_from_seed (int seed)
+{
+ dbus_int32_t v32;
+ dbus_int64_t v;
+
+ v32 = int32_from_seed (seed);
+
+ v = (((dbus_int64_t)v32) << 32) | (~v32);
+
+ return v;
+}
+#endif
+
+static dbus_bool_t
+int64_write_value (TestTypeNode *node,
+ DataBlock *block,
+ DBusTypeWriter *writer,
+ int seed)
+{
+#ifdef DBUS_HAVE_INT64
+ /* also used for uint64 */
+ dbus_int64_t v;
+
+ v = int64_from_seed (seed);
+
+ return _dbus_type_writer_write_basic (writer,
+ node->klass->typecode,
+ &v);
+#else
+ return TRUE;
+#endif
+}
+
+static dbus_bool_t
+int64_read_value (TestTypeNode *node,
+ DataBlock *block,
+ DBusTypeReader *reader,
+ int seed)
+{
+#ifdef DBUS_HAVE_INT64
+ /* also used for uint64 */
+ dbus_int64_t v;
+
+ check_expected_type (reader, node->klass->typecode);
+
+ _dbus_type_reader_read_basic (reader,
+ (dbus_int64_t*) &v);
+
+ _dbus_assert (v == int64_from_seed (seed));
+
+ return TRUE;
+#else
+ return TRUE;
+#endif
+}
+