Try to avoid parse_{time,units,flags} symbol conflicts

On Debian stretch systems PAM modules linked against Heimdal run into
symbol conflicts with parse_time() in systemd libraries.  We redefine
parse_time() and friends to rk_parse_time(), ... while keeping the old
names for ABI compatibility with existing clients.

The legacy names should eventually be droppped.
This commit is contained in:
Viktor Dukhovni
2017-08-23 17:33:29 +00:00
committed by Nico Williams
parent 237cd892d9
commit d73ec2510a
5 changed files with 111 additions and 7 deletions

View File

@@ -325,3 +325,54 @@ print_flags_table (const struct units *units, FILE *f)
for(u = units; u->name; ++u)
fprintf(f, "%s%s", u->name, (u+1)->name ? ", " : "\n");
}
#undef parse_units
#undef unparse_units
#undef unparse_units_approx
#undef print_units_table
#undef parse_flags
#undef unparse_flags
#undef print_flags_table
ROKEN_LIB_FUNCTION int ROKEN_LIB_CALL
parse_units(const char *s, const struct units *units,
const char *def_unit)
{
return rk_parse_units(s, units, def_unit);
}
ROKEN_LIB_FUNCTION int ROKEN_LIB_CALL
unparse_units(int num, const struct units *units, char *s, size_t len)
{
return rk_unparse_units(num, units, s, len);
}
ROKEN_LIB_FUNCTION int ROKEN_LIB_CALL
unparse_units_approx(int num, const struct units *units, char *s, size_t len)
{
return rk_unparse_units_approx(num, units, s, len);
}
ROKEN_LIB_FUNCTION void ROKEN_LIB_CALL
print_units_table(const struct units *units, FILE *f)
{
print_units_table(units, f);
}
ROKEN_LIB_FUNCTION int ROKEN_LIB_CALL
parse_flags(const char *s, const struct units *units, int orig)
{
return rk_parse_flags(s, units, orig);
}
ROKEN_LIB_FUNCTION int ROKEN_LIB_CALL
unparse_flags(int num, const struct units *units, char *s, size_t len)
{
return rk_unparse_flags(num, units, s, len);
}
ROKEN_LIB_FUNCTION void ROKEN_LIB_CALL
print_flags_table (const struct units *units, FILE *f)
{
return rk_print_flags_table (units, f);
}