Skip to content

Commit

Permalink
Fix compilation error in mode --enable-strict
Browse files Browse the repository at this point in the history
Log2() is not available in the redirection lib.

/usr/bin/ld: ./.libs/libpcsclite.so: undefined reference to `log_msg'

Log2() is used in SYS_RandomInt() that is not called by the redirection
library so no problem here.
  • Loading branch information
LudovicRousseau committed Apr 6, 2024
1 parent 1f12286 commit 586b778
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ libpcsclite_la_SOURCES = \
libredirect.c \
sys_unix.c
libpcsclite_la_LDFLAGS = -version-info 1:0:0
libpcsclite_la_CFLAGS = -DLIBREDIRECT

libpcsclite_real_la_SOURCES = \
debug.c \
Expand Down
2 changes: 2 additions & 0 deletions src/sys_unix.c
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,9 @@ INTERNAL int SYS_RandomInt(void)
ret = getrandom(c, sizeof c, 0);
if (-1 == ret)
{
#ifndef LIBREDIRECT
Log2(PCSC_LOG_ERROR, "getrandom() failed: %s", strerror(errno));
#endif
return lrand48();
}
// this loop avoids trap representations that may occur in the naive solution
Expand Down

0 comments on commit 586b778

Please sign in to comment.