我正在尝试为一个项目重新实现一些 coreutils,并且我看到 TYPE_MINIMUM(some int) 很多,但是我看不到它的定义位置或它的任何用法。我不确定它是在制作过程中产生的,还是故意的。有任何想法吗?
我已经包含了函数所需的所有头文件,并且一切正常,直到调用 TYPE_MINIMUM 进行验证。
正在使用的文件的完整来源:https ://github.com/coreutils/coreutils/blob/master/src/who.c
static const char *idle_string (time_t when, time_t boottime)
{
static time_t now = TYPE_MINIMUM (time_t);
if (now == TYPE_MINIMUM (time_t))
time (&now);
if (boottime < when && now - 24 * 60 * 60 < when && when <= now)
{
int seconds_idle = now - when;
if (seconds_idle < 60)
return " . ";
else
{
static char idle_hhmm[IDLESTR_LEN];
/* FIXME-in-2018: see if this assert is still required in order
to suppress gcc's unwarranted -Wformat-length= warning. */
assert (seconds_idle / (60 * 60) < 24);
sprintf (idle_hhmm, "%02d:%02d",
seconds_idle / (60 * 60),
(seconds_idle % (60 * 60)) / 60);
return idle_hhmm;
}
}
return (" old ");
}
error: ‘TYPE_MINIMUM’ was not declared in this scope