~ubuntu-branches/ubuntu/maverick/dbus/maverick-proposed

« back to all changes in this revision

Viewing changes to dbus/dbus-marshal-basic.h

  • Committer: Bazaar Package Importer
  • Author(s): Jonathan Riddell
  • Date: 2010-09-27 13:06:32 UTC
  • mfrom: (1.1.23 upstream)
  • Revision ID: james.westby@ubuntu.com-20100927130632-bqs145trvchd2lmf
Tags: 1.4.0-0ubuntu1
* New upstream release
 - Fixes https://bugs.freedesktop.org/show_bug.cgi?id=17754 Race condition in protected_change_timeout
 - Requested by various upstream KDE developers http://lists.kde.org/?t=128514970000004&r=1&w=2

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
#ifndef DBUS_MARSHAL_BASIC_H
26
26
#define DBUS_MARSHAL_BASIC_H
27
27
 
28
 
#include <config.h>
 
28
#ifdef HAVE_BYTESWAP_H
 
29
#include <byteswap.h>
 
30
#endif
 
31
 
29
32
#include <dbus/dbus-protocol.h>
30
33
#include <dbus/dbus-types.h>
31
34
#include <dbus/dbus-arch-deps.h>
32
35
#include <dbus/dbus-string.h>
33
36
 
34
 
#ifndef PACKAGE
35
 
#error "config.h not included here"
36
 
#endif
37
 
 
38
37
#ifdef WORDS_BIGENDIAN
39
38
#define DBUS_COMPILER_BYTE_ORDER DBUS_BIG_ENDIAN
40
39
#else
41
40
#define DBUS_COMPILER_BYTE_ORDER DBUS_LITTLE_ENDIAN
42
41
#endif
43
42
 
 
43
#ifdef HAVE_BYTESWAP_H
 
44
#define DBUS_UINT16_SWAP_LE_BE_CONSTANT(val) bswap_16(val)
 
45
#define DBUS_UINT32_SWAP_LE_BE_CONSTANT(val) bswap_32(val)
 
46
#else /* HAVE_BYTESWAP_H */
 
47
 
44
48
#define DBUS_UINT16_SWAP_LE_BE_CONSTANT(val)    ((dbus_uint16_t) (      \
45
49
    (dbus_uint16_t) ((dbus_uint16_t) (val) >> 8) |                      \
46
50
    (dbus_uint16_t) ((dbus_uint16_t) (val) << 8)))
51
55
    (((dbus_uint32_t) (val) & (dbus_uint32_t) 0x00ff0000U) >>  8) |     \
52
56
    (((dbus_uint32_t) (val) & (dbus_uint32_t) 0xff000000U) >> 24)))
53
57
 
 
58
#endif /* HAVE_BYTESWAP_H */
 
59
 
54
60
#ifdef DBUS_HAVE_INT64
55
61
 
 
62
#ifdef HAVE_BYTESWAP_H
 
63
#define DBUS_UINT64_SWAP_LE_BE_CONSTANT(val) bswap_64(val)
 
64
#else /* HAVE_BYTESWAP_H */
 
65
 
56
66
#define DBUS_UINT64_SWAP_LE_BE_CONSTANT(val)    ((dbus_uint64_t) (              \
57
67
      (((dbus_uint64_t) (val) &                                                 \
58
68
        (dbus_uint64_t) DBUS_UINT64_CONSTANT (0x00000000000000ff)) << 56) |    \
72
82
        (dbus_uint64_t) DBUS_UINT64_CONSTANT (0xff00000000000000)) >> 56)))
73
83
#endif /* DBUS_HAVE_INT64 */
74
84
 
 
85
#endif /* HAVE_BYTESWAP_H */
 
86
 
75
87
#define DBUS_UINT16_SWAP_LE_BE(val) (DBUS_UINT16_SWAP_LE_BE_CONSTANT (val))
76
88
#define DBUS_INT16_SWAP_LE_BE(val)  ((dbus_int16_t)DBUS_UINT16_SWAP_LE_BE_CONSTANT (val))
77
89