Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changes to make it compilable in recent Cygwin environment #175

Closed
wants to merge 8 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ fix-rights:
$(MAKE) -C src $@

ACLOCAL_AMFLAGS = -I m4
AM_LIBTOOLFLAGS = -no-undefined

DISTCHECK_CONFIGURE_FLAGS = \
--with-systemdsystemunitdir=$$dc_install_base/$(systemdsystemunitdir)
Expand Down
5 changes: 4 additions & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,10 @@ AS_CASE(["$host"],
IOKIT="-Wl,-framework,IOKit"
AS_IF([test "$GCC" = "yes"], [CFLAGS="$CFLAGS -no-cpp-precomp"])
use_libusb=no
AC_MSG_WARN([libusb disabled on Darwin for pcsc-lite])]
AC_MSG_WARN([libusb disabled on Darwin for pcsc-lite])],
[*-*-cygwin*], [
CPPFLAGS="$CPPFLAGS -I/usr/include"
LDFLAGS="$LDFLAGS -L/usr/lib"]
)

# Options
Expand Down
2 changes: 1 addition & 1 deletion src/PCSC/ifdhandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ whichever location your reader resides.
#ifndef _ifd_handler_h_
#define _ifd_handler_h_

#include <pcsclite.h>
#include "pcsclite.h"

/*
* List of data structures available to ifdhandler
Expand Down
2 changes: 1 addition & 1 deletion src/PCSC/pcsclite.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifndef __pcsclite_h__
#define __pcsclite_h__

#include <wintypes.h>
#include "wintypes.h"

#ifdef __cplusplus
extern "C"
Expand Down
28 changes: 24 additions & 4 deletions src/PCSC/wintypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,10 @@ extern "C"

#else

#ifdef __CYGWIN__
#include <_mingw.h>
#endif

#ifndef BYTE
typedef unsigned char BYTE;
#endif
Expand All @@ -82,14 +86,26 @@ extern "C"
typedef unsigned short USHORT;

#ifndef __COREFOUNDATION_CFPLUGINCOM__
typedef unsigned long ULONG;
#ifndef __CYGWIN__
typedef unsigned long ULONG;
#else
typedef unsigned __LONG32 ULONG;
#endif
typedef void *LPVOID;
#endif

typedef const void *LPCVOID;
typedef unsigned long DWORD;
#ifndef __CYGWIN__
typedef unsigned long DWORD;
#else
typedef unsigned __LONG32 DWORD;
#endif
typedef DWORD *PDWORD;
typedef long LONG;
#ifndef __CYGWIN__
typedef long LONG;
#else
typedef __LONG32 LONG;
#endif
typedef const char *LPCSTR;
typedef const BYTE *LPCBYTE;
typedef BYTE *LPBYTE;
Expand All @@ -102,7 +118,11 @@ extern "C"
typedef LPCSTR LPCTSTR;

/* types unused by pcsc-lite */
typedef short BOOL;
#ifndef __CYGWIN__
typedef short BOOL;
#else
typedef int BOOL;
#endif
typedef unsigned short WORD;
typedef ULONG *PULONG;

Expand Down
4 changes: 2 additions & 2 deletions src/eventhandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

#include <stdint.h>

#include "pcsclite.h"
#include "PCSC/pcsclite.h"
#include "readerfactory.h"
#include "wintypes.h"
#include "PCSC/wintypes.h"

/**
* Define an exported public reader state structure so each
Expand Down
2 changes: 1 addition & 1 deletion src/readerfactory.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <inttypes.h>
#include <pthread.h>

#include "ifdhandler.h"
#include "PCSC/ifdhandler.h"
#include "pcscd.h"
#include "simclist.h"

Expand Down
4 changes: 2 additions & 2 deletions src/winscard_msg.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

#include <stdint.h>

#include "pcsclite.h"
#include "wintypes.h"
#include "PCSC/pcsclite.h"
#include "PCSC/wintypes.h"

/** Major version of the current message protocol */
#define PROTOCOL_VERSION_MAJOR 4
Expand Down