~ubuntu-branches/debian/sid/glusterfs/sid

« back to all changes in this revision

Viewing changes to contrib/qemu/include/qemu/compiler.h

  • Committer: Package Import Robot
  • Author(s): Patrick Matthäi
  • Date: 2014-04-22 10:00:41 UTC
  • mfrom: (1.3.25)
  • Revision ID: package-import@ubuntu.com-20140422100041-6mur2ttyvb8zzpfq
Tags: 3.5.0-1
* New upstream release.
  - Rewrite patch 01-spelling-error.
  - Adjust lintian overrides.
  - Install new files.
  - The offical tarball is not properly generated, hack it around.
  - Add symlink from fusermount-glusterfs manpage to mount.glusterfs.
  - Move gsync-sync-gfid from /usr/share to /usr/lib.
  - Add benchmarking directory.
* Remove old versioned build dependencies and build depend on libglib2.0-dev.
* Add lintian override for possible-gpl-code-linked-with-openssl. It is the
  same false positive like with the gluster-server package.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* public domain */
 
2
 
 
3
#ifndef COMPILER_H
 
4
#define COMPILER_H
 
5
 
 
6
#include "config-host.h"
 
7
 
 
8
/*----------------------------------------------------------------------------
 
9
| The macro QEMU_GNUC_PREREQ tests for minimum version of the GNU C compiler.
 
10
| The code is a copy of SOFTFLOAT_GNUC_PREREQ, see softfloat-macros.h.
 
11
*----------------------------------------------------------------------------*/
 
12
#if defined(__GNUC__) && defined(__GNUC_MINOR__)
 
13
# define QEMU_GNUC_PREREQ(maj, min) \
 
14
         ((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min))
 
15
#else
 
16
# define QEMU_GNUC_PREREQ(maj, min) 0
 
17
#endif
 
18
 
 
19
#define QEMU_NORETURN __attribute__ ((__noreturn__))
 
20
 
 
21
#if QEMU_GNUC_PREREQ(3, 4)
 
22
#define QEMU_WARN_UNUSED_RESULT __attribute__((warn_unused_result))
 
23
#else
 
24
#define QEMU_WARN_UNUSED_RESULT
 
25
#endif
 
26
 
 
27
#if defined(_WIN32)
 
28
# define QEMU_PACKED __attribute__((gcc_struct, packed))
 
29
#else
 
30
# define QEMU_PACKED __attribute__((packed))
 
31
#endif
 
32
 
 
33
#define cat(x,y) x ## y
 
34
#define cat2(x,y) cat(x,y)
 
35
#define QEMU_BUILD_BUG_ON(x) \
 
36
    typedef char cat2(qemu_build_bug_on__,__LINE__)[(x)?-1:1] __attribute__((unused));
 
37
 
 
38
#if defined __GNUC__
 
39
# if !QEMU_GNUC_PREREQ(4, 4)
 
40
   /* gcc versions before 4.4.x don't support gnu_printf, so use printf. */
 
41
#  define GCC_FMT_ATTR(n, m) __attribute__((format(printf, n, m)))
 
42
# else
 
43
   /* Use gnu_printf when supported (qemu uses standard format strings). */
 
44
#  define GCC_FMT_ATTR(n, m) __attribute__((format(gnu_printf, n, m)))
 
45
#  if defined(_WIN32)
 
46
    /* Map __printf__ to __gnu_printf__ because we want standard format strings
 
47
     * even when MinGW or GLib include files use __printf__. */
 
48
#   define __printf__ __gnu_printf__
 
49
#  endif
 
50
# endif
 
51
#else
 
52
#define GCC_FMT_ATTR(n, m)
 
53
#endif
 
54
 
 
55
#endif /* COMPILER_H */