過去に #define に出くわすたびに、次のように使用されていました
#define MOD 1000000007
上記の場合、コード内の MOD のすべてのインスタンスが 1000000007 に置き換えられました。
私はオープン ソース開発に不慣れで、VLC メディア プレーヤーのいくつかのビデオ フィルターを調べていました。#define
as-のいくつかの用途があります。
//example1
#define MSG_LONGTEXT N_( \
"Marquee text to display. " \
"(Available format strings: " \
"Time related: %Y = year, %m = month, %d = day, %H = hour, " \
"%M = minute, %S = second, ... " \
"Meta data related: $a = artist, $b = album, $c = copyright, " \
"$d = description, $e = encoded by, $g = genre, " \
"$l = language, $n = track num, $p = now playing, " \
"$r = rating, $s = subtitles language, $t = title, "\
"$u = url, $A = date, " \
"$B = audio bitrate (in kb/s), $C = chapter," \
"$D = duration, $F = full name with path, $I = title, "\
"$L = time left, " \
"$N = name, $O = audio language, $P = position (in %), $R = rate, " \
"$S = audio sample rate (in kHz), " \
"$T = time, $U = publisher, $V = volume, $_ = new line) ")
//example 2
#define POSY_TEXT N_("Y offset")
//example 3
#define TIMEOUT_LONGTEXT N_("Number of milliseconds the marquee must remain " \
"displayed. Default value is " \
"0 (remains forever).")
誰かがこれらの例を説明できますか
#define
とソフトウェア開発の両方またはいくつかのリソースを提供しますか?