]> git.proxmox.com Git - mirror_qemu.git/blobdiff - include/qemu/compiler.h
qemu-thread: optimize QemuLockCnt with futexes on Linux
[mirror_qemu.git] / include / qemu / compiler.h
index 8f1cc7ba674cdbee80f7798ae43415e29b1ee72b..157698bfa952956e585560031953e37093283b60 100644 (file)
@@ -1,8 +1,15 @@
-/* public domain */
+/* compiler.h: macros to abstract away compiler specifics
+ *
+ * This work is licensed under the terms of the GNU GPL, version 2 or later.
+ * See the COPYING file in the top-level directory.
+ */
 
 #ifndef COMPILER_H
 #define COMPILER_H
 
+#if defined __clang_analyzer__ || defined __COVERITY__
+#define QEMU_STATIC_ANALYSIS 1
+#endif
 
 /*----------------------------------------------------------------------------
 | The macro QEMU_GNUC_PREREQ tests for minimum version of the GNU C compiler.
@@ -41,6 +48,8 @@
 # define QEMU_PACKED __attribute__((packed))
 #endif
 
+#define QEMU_ALIGNED(X) __attribute__((aligned(X)))
+
 #ifndef glue
 #define xglue(x, y) x ## y
 #define glue(x, y) xglue(x, y)