版本宏只在scanner模块中定义,sane模块通过接口获取版本号

This commit is contained in:
gb 2023-08-23 11:04:27 +08:00
parent 890d4a1c78
commit 659c455107
1 changed files with 6 additions and 4 deletions

View File

@ -2630,14 +2630,16 @@ extern "C" { // avoid compiler exporting name in C++ style !!!
}
SANE_Status inner_sane_ex_get_driver_version(SANE_Int* hh, SANE_Int* hl, SANE_Int* lh, SANE_Int* ll)
{
unsigned long long v = hg_scanner_get_version();
if (hh)
*hh = VERSION_MAJOR;
*hh = (v >> 24) & 0x0ff;
if (hl)
*hl = VERSION_MINOR;
*hl = (v >> 16) & 0x0ff;
if (lh)
*lh = VERSION_YEAR;
*lh = (v >> 8) & 0x0ff;
if (ll)
*ll = GET_BUILD_VER;
*ll = (v >> 0) & 0x0ff;
return SANE_STATUS_GOOD;
}