1 /* 2 * This file is part of FFmpeg. 3 * 4 * FFmpeg is free software; you can redistribute it and/or 5 * modify it under the terms of the GNU Lesser General Public 6 * License as published by the Free Software Foundation; either 7 * version 2.1 of the License, or (at your option) any later version. 8 * 9 * FFmpeg is distributed in the hope that it will be useful, 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 * Lesser General Public License for more details. 13 * 14 * You should have received a copy of the GNU Lesser General Public 15 * License along with FFmpeg; if not, write to the Free Software 16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 */ 18 19 /** 20 * @file 21 * @ingroup lavu 22 * Utility Preprocessor macros 23 */ 24 module ffmpeg.libavutil.macros; 25 extern (C) @nogc nothrow: 26 27 /** 28 * @addtogroup preproc_misc Preprocessor String Macros 29 * 30 * String manipulation macros 31 * 32 * @{ 33 */ 34 35 alias AV_STRINGIFY = AV_TOSTRING; 36 37 extern (D) string AV_TOSTRING(T)(auto ref T s) 38 { 39 import std.conv : to; 40 41 return to!string(s); 42 } 43 44 extern (D) string AV_GLUE(T0, T1)(auto ref T0 a, auto ref T1 b) 45 { 46 import std.conv : to; 47 48 return to!string(a) ~ to!string(b); 49 } 50 51 alias AV_JOIN = AV_GLUE; 52 53 /** 54 * @} 55 */ 56 57 extern (D) auto AV_PRAGMA(T)(auto ref T s) 58 { 59 import std.conv : to; 60 61 return _Pragma(to!string(s)); 62 } 63 64 extern (D) auto FFALIGN(T0, T1)(auto ref T0 x, auto ref T1 a) 65 { 66 return (x + a - 1) & ~(a - 1); 67 } 68 69 /* AVUTIL_MACROS_H */