Listing the "Blender Foundation" as copyright holder implied the Blender Foundation holds copyright to files which may include work from many developers. While keeping copyright on headers makes sense for isolated libraries, Blender's own code may be refactored or moved between files in a way that makes the per file copyright holders less meaningful. Copyright references to the "Blender Foundation" have been replaced with "Blender Authors", with the exception of `./extern/` since these this contains libraries which are more isolated, any changed to license headers there can be handled on a case-by-case basis. Some directories in `./intern/` have also been excluded: - `./intern/cycles/` it's own `AUTHORS` file is planned. - `./intern/opensubdiv/`. An "AUTHORS" file has been added, using the chromium projects authors file as a template. Design task: #110784 Ref !110783.
46 lines
1012 B
C++
46 lines
1012 B
C++
/* SPDX-FileCopyrightText: 2023 Blender Authors
|
|
*
|
|
* SPDX-License-Identifier: GPL-2.0-or-later */
|
|
|
|
/* clang-format off */
|
|
|
|
/* #define typeof() triggers a bug in some clang-format versions, disable format
|
|
* for entire file to keep results consistent. */
|
|
|
|
#pragma once
|
|
|
|
|
|
/** \file
|
|
* \ingroup bli
|
|
*
|
|
* Use to help with cross platform portability.
|
|
*/
|
|
|
|
#if defined(_MSC_VER)
|
|
# define alloca _alloca
|
|
#endif
|
|
|
|
#if (defined(__GNUC__) || defined(__clang__)) && defined(__cplusplus)
|
|
extern "C++" {
|
|
/** Some magic to be sure we don't have reference in the type. */
|
|
template<typename T> static inline T decltype_helper(T x)
|
|
{
|
|
return x;
|
|
}
|
|
#define typeof(x) decltype(decltype_helper(x))
|
|
}
|
|
#endif
|
|
|
|
/* little macro so inline keyword works */
|
|
#if defined(_MSC_VER)
|
|
# define BLI_INLINE static __forceinline
|
|
#else
|
|
# define BLI_INLINE static inline __attribute__((always_inline)) __attribute__((__unused__))
|
|
#endif
|
|
|
|
#if defined(__GNUC__)
|
|
# define BLI_NOINLINE __attribute__((noinline))
|
|
#else
|
|
# define BLI_NOINLINE
|
|
#endif
|