Get the latest Blender, older versions, or experimental builds.
Stay up-to-date with the new features in the latest Blender releases.
Access production assets and knowledge from the open movies.
Documentation on the usage and features in Blender.
Latest development updates, by Blender developers.
Guidelines, release notes and development docs.
A platform to collect and share results of the Blender Benchmark.
The yearly event that brings the community together.
Support core development with a monthly contribution.
Perform a single donation with more payment options available.
Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.
/* SPDX-License-Identifier: GPL-2.0-or-later
* Copyright 2013 Blender Foundation. All rights reserved. */
#pragma once
/** \file
* \ingroup bli
*/
/* hint to make sure function result is actually used */
#ifdef __GNUC__
# define ATTR_WARN_UNUSED_RESULT __attribute__((warn_unused_result))
#else
# define ATTR_WARN_UNUSED_RESULT
#endif
/* hint to mark function arguments expected to be non-null
* if no arguments are given to the macro, all of pointer
* arguments would be expected to be non-null
# define ATTR_NONNULL(args...) __attribute__((nonnull(args)))
# define ATTR_NONNULL(...)
/* never returns NULL */
# define ATTR_RETURNS_NONNULL __attribute__((returns_nonnull))
# define ATTR_RETURNS_NONNULL
/* hint to mark function as it wouldn't return */
#if defined(__GNUC__) || defined(__clang__)
# define ATTR_NORETURN __attribute__((noreturn))
# define ATTR_NORETURN
/* hint to treat any non-null function return value cannot alias any other pointer */
# define ATTR_MALLOC __attribute__((malloc))
# define ATTR_MALLOC
/* the function return value points to memory (2 args for 'size * tot') */
#if defined(__GNUC__) && !defined(__clang__)
# define ATTR_ALLOC_SIZE(args...) __attribute__((alloc_size(args)))
# define ATTR_ALLOC_SIZE(...)
/* ensures a NULL terminating argument as the n'th last argument of a variadic function */
# define ATTR_SENTINEL(arg_pos) __attribute__((sentinel(arg_pos)))
# define ATTR_SENTINEL(arg_pos)
/* hint to compiler that function uses printf-style format string */
# define ATTR_PRINTF_FORMAT(format_param, dots_param) \
__attribute__((format(printf, format_param, dots_param)))
# define ATTR_PRINTF_FORMAT(format_param, dots_param)
/* Use to suppress '-Wimplicit-fallthrough' (in place of 'break'). */
#ifndef ATTR_FALLTHROUGH
# ifdef __GNUC__
# define ATTR_FALLTHROUGH __attribute__((fallthrough))
# else
# define ATTR_FALLTHROUGH ((void)0)
# endif
/* Declare the memory alignment in Bytes. */
#if defined(_WIN32) && !defined(FREE_WINDOWS)
# define ATTR_ALIGN(x) __declspec(align(x))
# define ATTR_ALIGN(x) __attribute__((aligned(x)))
/* Alignment directive */
#ifdef _WIN64
# define ALIGN_STRUCT __declspec(align(64))
# define ALIGN_STRUCT