Skip to content
This repository was archived by the owner on May 16, 2024. It is now read-only.

Commit 60a8526

Browse files
cyb3r4ntmrts
authored andcommitted
Add exception for Apple macOS result code type
Apple version of pcsc-lite library is slightly different from official one, and defines result code constants in pcsclite.h as unsigned 32bit integers. Official pcsc-lite version uses LONG type and it is traslated to signed long on most platforms. This implementation difference is solved using pre-processor instructions. ----------------------------------------------------------------- Developer's Certificate of Origin 1.1 By making a contribution to this project, I certify that: The contribution was created in whole or in part by me and I have the right to submit it under the open source license indicated in the file. I understand and agree that this project and the contribution are public and that a record of the contribution (including all personal information I submit with it, including my sign-off) is maintained indefinitely and may be redistributed consistent with this project or the open source license(s) involved. Signed-off-by: cyb3r4nt <[email protected]>
1 parent e7d702b commit 60a8526

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/SCardCall.hpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,14 @@ void SCardCall(const char* callerFunctionName, const char* file, int line,
4747
const char* scardFunctionName, Func scardFunction, Args... args)
4848
{
4949
// TODO: Add logging - or is exception error message enough?
50+
51+
#ifdef __APPLE__
52+
// Apple version of pcsc-lite uses unsigned code constants
5053
const uint32_t result = scardFunction(args...);
54+
#else
55+
// Standard version of pcsc-lite uses signed code constants
56+
const LONG result = scardFunction(args...);
57+
#endif
5158

5259
// TODO: Add more cases when needed.
5360
switch (result) {

0 commit comments

Comments
 (0)