]> git.proxmox.com Git - qemu.git/commit - include/qemu-common.h
qemu-common: add QEMU_ALIGN_DOWN() and QEMU_ALIGN_UP() macros
authorStefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Thu, 17 Nov 2011 13:40:25 +0000 (13:40 +0000)
committerKevin Wolf <kwolf@redhat.com>
Mon, 5 Dec 2011 13:51:37 +0000 (14:51 +0100)
commit3951690a4a29e031492090131d001e5047938631
tree25204de77bfa6f3333c5af2e4861021ac6727abc
parent060f51c9dee3c58e2748c773ef1f7142047a4a2f
qemu-common: add QEMU_ALIGN_DOWN() and QEMU_ALIGN_UP() macros

Add macros for aligning a number to a multiple, for example:

QEMU_ALIGN_DOWN(500, 2000) = 0
QEMU_ALIGN_UP(500, 2000) = 2000

Since ALIGN_UP() is a common macro name use the QEMU_* namespace prefix.
Hopefully this will protect us from included headers that leak something
with a similar name.

Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
qemu-common.h