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 25 module ffmpeg.libavutil.macros; 26 27 extern (C): 28 import ffmpeg; @nogc nothrow: 29 30 /** 31 * @addtogroup preproc_misc Preprocessor String Macros 32 * 33 * String manipulation macros 34 * 35 * @{ 36 */ 37 38 alias AV_STRINGIFY = AV_TOSTRING; 39 40 extern (D) string AV_TOSTRING(T)(auto ref T s) 41 { 42 import std.conv : to; 43 44 return to!string(s); 45 } 46 47 extern (D) string AV_GLUE(T0, T1)(auto ref T0 a, auto ref T1 b) 48 { 49 import std.conv : to; 50 51 return to!string(a) ~ to!string(b); 52 } 53 54 alias AV_JOIN = AV_GLUE; 55 56 /** 57 * @} 58 */ 59 60 extern (D) auto AV_PRAGMA(T)(auto ref T s) 61 { 62 import std.conv : to; 63 64 return _Pragma(to!string(s)); 65 } 66 67 extern (D) auto FFALIGN(T0, T1)(auto ref T0 x, auto ref T1 a) 68 { 69 return (x + a - 1) & ~(a - 1); 70 } 71 72 /* AVUTIL_MACROS_H */