marcus905 / libnfc

Automatically exported from code.google.com/p/libnfc
GNU Lesser General Public License v3.0
0 stars 0 forks source link

Update Windows port #215

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
This issue was created by revision 0af58b1cdd50.

Due to the recent configuration file parsing introduction, libnfc can not be 
built under Windows: regex.h is missing.
Google says there is a port of PCRE for Windows which contains a compiliant 
regex.h.
Contribution are welcome as nobody from currently active team use Windows as OS.

Original issue reported on code.google.com by romu...@libnfc.org on 5 Dec 2012 at 5:30

GoogleCodeExporter commented 9 years ago
I've addressed two of the problems found in windows in the 1.7.0-rc2 (and 
latest) in a git branch:

alexlian-windows-compatibility

I've addressed:

1. Compilation with regex.h (by changing CMake to require a PCRE include and 
lib)
   However, this remains to be linked and tested (see later)
2. MinGW complains with the "ISO C99 requires rest arguments to be used", and I 
fixed this with a minor hacky trick within contrib/windows.h and how the 
VA_ARGS are declared.

However, things are still broken, and before modifying the next part I wanted 
to check as to desired solutions.

- Linking is failing due to use of setenv/unsetenv which is not present in 
MinGW.

I see two solutions:

1. Modifying nfc.c to use putenv for both cases
2. Adding stubs into contrib for windows implementing setenv/unsetenv using the 
Win32 calls of SetEnvironmentVariable

My thoughts are to choose option #2, so I'll likely implement it that way but 
thought to toss the issue out there that setenv is not portable for Windows.

Original comment by alex.l...@gmail.com on 26 Jan 2013 at 11:55

GoogleCodeExporter commented 9 years ago
I've committed a number of further changes to alexlian-window-compatibility
such that libnfc compiles on Windows via CMake. (referencing PCRE)

Review and critique and consideration for merge up would be appreciated, but I 
haven't validated any tools or tests. These changes simply get the library 
compiling error free. Warnings are another issue entirely. Additionally, no 
testing on other platforms done. I might try to get a linux environment going 
to do so later.

Original comment by alex.l...@gmail.com on 28 Jan 2013 at 4:27

GoogleCodeExporter commented 9 years ago
Very great work!

I think we should introduce most of your patches soon..

Original comment by romu...@libnfc.org on 30 Jan 2013 at 4:55

GoogleCodeExporter commented 9 years ago

Original comment by romu...@libnfc.org on 14 Feb 2013 at 2:30