Skip to content

Commit

Permalink
Use correct type for IFD* functions
Browse files Browse the repository at this point in the history
Fix the ifdwrapper.h header file so the functions types correspond to
what we have in ifdwrapper.c since the commit
eecf685

The compilation was broken on macOS with:
ifdwrapper.c:67:14: error: conflicting types for 'IFDSetPTS'
RESPONSECODE IFDSetPTS(READER_CONTEXT * rContext, DWORD dwProtocol,
             ^
./ifdwrapper.h:52:7: note: previous declaration is here
        LONG IFDSetPTS(READER_CONTEXT *, DWORD, UCHAR, UCHAR, UCHAR, UCHAR);
             ^

Compilation was correct on GNU/Linux but incorrect on macOS because we
have:
    typedef long RESPONSECODE;
For both macOS and GNU/Linux.

and
    typedef int32_t LONG;
for maCOS and
    typedef long LONG;
For GNU/LInux

So on macOS LONG and RESPONSECODE types are not equivalent.
  • Loading branch information
LudovicRousseau committed Sep 15, 2020
1 parent 4e30dc5 commit 0680e83
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/ifdwrapper.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,18 +39,18 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifndef __ifdwrapper_h__
#define __ifdwrapper_h__

LONG IFDOpenIFD(READER_CONTEXT *);
LONG IFDCloseIFD(READER_CONTEXT *);
LONG IFDPowerICC(READER_CONTEXT *, DWORD, PUCHAR, /*@out@*/ PDWORD);
RESPONSECODE IFDOpenIFD(READER_CONTEXT *);
RESPONSECODE IFDCloseIFD(READER_CONTEXT *);
RESPONSECODE IFDPowerICC(READER_CONTEXT *, DWORD, PUCHAR, /*@out@*/ PDWORD);
LONG IFDStatusICC(READER_CONTEXT *, /*@out@*/ PDWORD);
LONG IFDControl_v2(READER_CONTEXT *, PUCHAR, DWORD, /*@out@*/ PUCHAR,
PDWORD);
LONG IFDControl(READER_CONTEXT *, DWORD, LPCVOID, DWORD, LPVOID,
DWORD, LPDWORD);
LONG IFDTransmit(READER_CONTEXT *, SCARD_IO_HEADER,
PUCHAR, DWORD, /*@out@*/ PUCHAR, PDWORD, PSCARD_IO_HEADER);
LONG IFDSetPTS(READER_CONTEXT *, DWORD, UCHAR, UCHAR, UCHAR, UCHAR);
LONG IFDSetCapabilities(READER_CONTEXT *, DWORD, DWORD, PUCHAR);
LONG IFDGetCapabilities(READER_CONTEXT *, DWORD, PDWORD, /*@out@*/ PUCHAR);
RESPONSECODE IFDSetPTS(READER_CONTEXT *, DWORD, UCHAR, UCHAR, UCHAR, UCHAR);
RESPONSECODE IFDSetCapabilities(READER_CONTEXT *, DWORD, DWORD, PUCHAR);
RESPONSECODE IFDGetCapabilities(READER_CONTEXT *, DWORD, PDWORD, /*@out@*/ PUCHAR);

#endif /* __ifdwrapper_h__ */

0 comments on commit 0680e83

Please sign in to comment.