Coder Social home page Coder Social logo

Add C++ compatibility about libnfc HOT 15 CLOSED

nfc-tools avatar nfc-tools commented on June 13, 2024
Add C++ compatibility

from libnfc.

Comments (15)

GoogleCodeExporter avatar GoogleCodeExporter commented on June 13, 2024
Can this be somehow combined with a fix for issue 14?

Original comment by fkooman%[email protected] on 3 Sep 2009 at 2:30

from libnfc.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 13, 2024
Thanks for report and solution.
r90 should fix this issue, code review wanted.

Original comment by [email protected] on 3 Sep 2009 at 3:26

  • Changed state: Fixed

from libnfc.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 13, 2024
r97 may allow C++ compatibility in Windows (code review and bug report is 
welcome).

Original comment by [email protected] on 4 Sep 2009 at 2:08

from libnfc.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 13, 2024
C++ compatibility broken in r123.

Original comment by [email protected] on 1 Oct 2009 at 8:40

  • Changed state: New

from libnfc.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 13, 2024
Please fix it

Original comment by emanuele.bertoldi on 2 Oct 2009 at 10:49

from libnfc.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 13, 2024
Talking with Roel about this issue, we think you could try to include libnfc 
like that:
{{{
extern "C" {
#include <libnfc.h>
}
}}}
This should export libnfc functions in C++.

Original comment by [email protected] on 2 Oct 2009 at 1:07

from libnfc.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 13, 2024
ok, but why this decision? 

In my opinion the "NFCAPI prefix" approach is better.

Original comment by emanuele.bertoldi on 5 Oct 2009 at 1:11

from libnfc.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 13, 2024
I don't know exactly why Roël removes this but could you explain why you think 
that
"NFCAPI prefix" is a better approach ?

Original comment by [email protected] on 6 Oct 2009 at 10:12

  • Added labels: Priority-Low
  • Removed labels: Priority-Medium

from libnfc.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 13, 2024
Because, from a developer point of view, this makes easier to use this lib 
without
explicit declarations in the C++ project code. In my small experience, every C 
lib
I've seen use this approach.

Original comment by emanuele.bertoldi on 21 Oct 2009 at 1:55

from libnfc.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 13, 2024
You are right, we may wan to to go back to the extern "C" declaration. But can 
we
avoid that is compiled into the documentation? It is rather annoying if you see 
wierd
and "unknown" API (return) types. Maybe we just should add in the top of 
libnfc.h:

#ifdef __cplusplus 
    #define NFCAPI extern "C" {
#endif // __cplusplus

and in the bottom:
#ifdef __cplusplus 
}
#endif // __cplusplus

What do you both think about this?

Original comment by [email protected] on 31 Oct 2009 at 1:19

from libnfc.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 13, 2024
I agreed. This is fixed in r159.

Original comment by [email protected] on 2 Nov 2009 at 7:48

  • Changed state: Fixed

from libnfc.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 13, 2024
It seems to be not fixed...The problem is in "#define NCAPI ..." line. You must
remove the "define" stuff:

#ifdef __cplusplus 
extern "C" {
#endif // __cplusplus

// ...

#ifdef __cplusplus 
}
#endif // __cplusplus

Original comment by emanuele.bertoldi on 2 Dec 2009 at 8:34

from libnfc.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 13, 2024
This is the very trivial patch for the current revision (r236).

Original comment by emanuele.bertoldi on 7 Dec 2009 at 2:45

Attachments:

from libnfc.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 13, 2024

Original comment by emanuele.bertoldi on 8 Dec 2009 at 2:28

  • Changed state: New
  • Added labels: Priority-Medium
  • Removed labels: Priority-Low

from libnfc.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 13, 2024

Original comment by emanuele.bertoldi on 8 Dec 2009 at 3:10

  • Changed state: Fixed

from libnfc.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.