/* * Copyright (c) 2002 Fabrice Bellard * * This file is part of FFmpeg. * * FFmpeg is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * FFmpeg is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with FFmpeg; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
/** * @def DECLARE_ALIGNED(n,t,v) * Declare a variable that is aligned in memory. * * @code{.c} * DECLARE_ALIGNED(16, uint16_t, aligned_int) = 42; * DECLARE_ALIGNED(32, uint8_t, aligned_array)[128]; * * // The default-alignment equivalent would be * uint16_t aligned_int = 42; * uint8_t aligned_array[128]; * @endcode * * @param n Minimum alignment in bytes * @param t Type of the variable (or array element) * @param v Name of the variable
*/
/** * @def DECLARE_ASM_ALIGNED(n,t,v) * Declare an aligned variable appropriate for use in inline assembly code. * * @code{.c} * DECLARE_ASM_ALIGNED(16, uint64_t, pw_08) = UINT64_C(0x0008000800080008); * @endcode * * @param n Minimum alignment in bytes * @param t Type of the variable (or array element) * @param v Name of the variable
*/
/** * @def DECLARE_ASM_CONST(n,t,v) * Declare a static constant aligned variable appropriate for use in inline * assembly code. * * @code{.c} * DECLARE_ASM_CONST(16, uint64_t, pw_08) = UINT64_C(0x0008000800080008); * @endcode * * @param n Minimum alignment in bytes * @param t Type of the variable (or array element) * @param v Name of the variable
*/
#ifdefined(__DJGPP__) #define DECLARE_ALIGNED_T(n,t,v) alignas(FFMIN(n, 16)) t v #define DECLARE_ASM_ALIGNED(n,t,v) alignas(FFMIN(n, 16)) t av_used v #define DECLARE_ASM_CONST(n,t,v) alignas(FFMIN(n, 16)) staticconst t av_used v #elifdefined(_MSC_VER) #define DECLARE_ALIGNED_T(n,t,v) __declspec(align(n)) t v #define DECLARE_ASM_ALIGNED(n,t,v) __declspec(align(n)) t v #define DECLARE_ASM_CONST(n,t,v) __declspec(align(n)) staticconst t v #else #define DECLARE_ALIGNED_T(n,t,v) alignas(n) t v #define DECLARE_ASM_ALIGNED(n,t,v) alignas(n) t av_used v #define DECLARE_ASM_CONST(n,t,v) alignas(n) staticconst t av_used v #endif
// Macro needs to be double-wrapped in order to expand // possible other macros being passed for n. #define DECLARE_ALIGNED_V(n,t,v) DECLARE_ALIGNED_##n(t,v)
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.