On Mon, Apr 3, 2017 at 7:20 PM,  <[email protected]> wrote:
> The reason I think correct C type is used is because in the "winscard.h" C
> header file, the expected type is LPSCARD_READERSTATE.
> And , in the golang cgo code, i.e. scard_unix.go, the argument 3 is cast as
> (C.LPSCARD_READERSTATE).
>
>
>
>
> Further details (not sure if is useful):
> I found that in another C header file (pcsclite.h),  LPSCARD_READERSTATE is
> defined as:
> typedef struct
> {
>         const char *szReader;
>         void *pvUserData;
>         DWORD dwCurrentState;
>         DWORD dwEventState;
>         DWORD cbAtr;
>         unsigned char rgbAtr[MAX_ATR_SIZE];
> }
> SCARD_READERSTATE, *LPSCARD_READERSTATE;
>
>
> And, on Windows , I could compile the code but failed on linux.

The Windows code is different anyhow.  The file that fails is not
compiled on Windows.

Anyhow, I do see this now.  Thanks for the report.  Filed
https://golang.org/issue/19832.

It's just a warning, so the immediate workaround is to simply ignore
the problem.

Another workaround would be to modify the Go code to not call
`C.SCardGetStatusChange` directly, but to call a little function,
defined in the C comment, that takes a void* argument and calls the
real C function.

Ian

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to