From: Eric Branlund Date: Wed, 20 Jan 2021 23:02:38 +0000 (-0800) Subject: Change the KWD_* macros to be constant string pointers with definitions in cmd-spell... X-Git-Tag: vmacos2.2.1-7f^0 X-Git-Url: http://git.osdn.net/view?p=hengbandforosx%2Fhengbandosx.git;a=commitdiff_plain;h=efab26668ea8acc8ee9d6ffd0305d96492bb3a52 Change the KWD_* macros to be constant string pointers with definitions in cmd-spell.c. On platforms that use configure and automake, that allows the preprocessing done to switch character encoding to affect them since only the .c files that are compiled are preprocessed. --- diff --git a/src/cmd-spell.c b/src/cmd-spell.c index be80d19d9..f983add0e 100644 --- a/src/cmd-spell.c +++ b/src/cmd-spell.c @@ -27,6 +27,18 @@ #include "player-status.h" #include "object-hook.h" +/* + * Define these here, rather than use preprocessor macros set in cmd-spell.h, + * so that the preprocessing done to switch character encoding works on the + * platforms that use configure/automake. + */ +concptr KWD_DAM = _("損傷:", "dam "); +concptr KWD_RANGE = _("射程:", "rng "); +concptr KWD_DURATION = _("期間:", "dur "); +concptr KWD_SPHERE = _("範囲:", "range "); +concptr KWD_HEAL = _("回復:", "heal "); +concptr KWD_RANDOM = _("ランダム", "random"); + /*! * @brief * 魔法の効果を「キャプション:ダイス+定数値」のフォーマットで出力する / Generate dice info string such as "foo 2d10" diff --git a/src/cmd-spell.h b/src/cmd-spell.h index 9e1ebefc2..32829d981 100644 --- a/src/cmd-spell.h +++ b/src/cmd-spell.h @@ -1,9 +1,9 @@ -#define KWD_DAM _("損傷:", "dam ") -#define KWD_RANGE _("射程:", "rng ") -#define KWD_DURATION _("期間:", "dur ") -#define KWD_SPHERE _("範囲:", "range ") -#define KWD_HEAL _("回復:", "heal ") -#define KWD_RANDOM _("ランダム", "random") +extern concptr KWD_DAM; +extern concptr KWD_RANGE; +extern concptr KWD_DURATION; +extern concptr KWD_SPHERE; +extern concptr KWD_HEAL; +extern concptr KWD_RANDOM; extern concptr info_string_dice(concptr str, DICE_NUMBER dice, DICE_SID sides, int base); extern concptr info_damage(DICE_NUMBER dice, DICE_SID sides, int base);