include: Add align() helper function.

This commit is contained in:
Józef Kucia 2017-06-16 22:38:21 +02:00
parent ba713c9b37
commit 995720f5f5
2 changed files with 5 additions and 5 deletions

View File

@ -24,6 +24,11 @@
#define ARRAY_SIZE(x) (sizeof(x) / sizeof(*(x))) #define ARRAY_SIZE(x) (sizeof(x) / sizeof(*(x)))
static inline size_t align(size_t addr, size_t alignment)
{
return (addr + (alignment - 1)) & ~(alignment - 1);
}
#ifdef __GNUC__ #ifdef __GNUC__
# define VKD3D_PRINTF_FUNC(fmt, args) __attribute__((format(printf, fmt, args))) # define VKD3D_PRINTF_FUNC(fmt, args) __attribute__((format(printf, fmt, args)))
# define VKD3D_UNUSED __attribute__((unused)) # define VKD3D_UNUSED __attribute__((unused))

View File

@ -50,11 +50,6 @@ typedef int HRESULT;
# include "vkd3d_utils.h" # include "vkd3d_utils.h"
#endif #endif
static size_t align(size_t addr, unsigned int alignment)
{
return (addr + (alignment - 1)) & ~(alignment - 1);
}
static ULONG get_refcount(void *iface) static ULONG get_refcount(void *iface)
{ {
IUnknown *unk = iface; IUnknown *unk = iface;