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

Add extern "C" guard blocks to SDK header files #1352

Closed
dannybackx opened this issue Jan 2, 2016 · 5 comments
Closed

Add extern "C" guard blocks to SDK header files #1352

dannybackx opened this issue Jan 2, 2016 · 5 comments

Comments

@dannybackx
Copy link

dannybackx commented Jan 2, 2016

Hi,

This appears to be missing from sntp.h and also the other include files.

Danny

acer: {541} diff -c sntp.h~ sntp.h
*** sntp.h~     2015-11-24 09:50:33.000000000 +0100
--- sntp.h      2016-01-02 15:45:41.976664979 +0100
***************
*** 7,12 ****
--- 7,17 ----
  #else
  #include "ip_addr.h"
  #endif
+ 
+ #if defined(__cplusplus)
+ extern "C" {
+ #endif
+ 
  /**
   * get the seconds since Jan 01, 1970, 00:00 (GMT + 8)
   */
***************
*** 66,68 ****
--- 71,77 ----
  #define sntp_servermode_dhcp(x)
  
  #endif
+ 
+ #if defined(__cplusplus)
+ }
+ #endif
acer: {542} 

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

@igrr
Copy link
Member

igrr commented Feb 29, 2016

Since we are modifying some of the SDK headers anyway, it might make sense to add cpp guard blocks to all of them.

@igrr igrr changed the title sntp.h patch to allow C++ compiler Add extern "C" guard blocks to SDK header files Feb 29, 2016
@igrr igrr added this to the 2.2.0 milestone Feb 29, 2016
@igrr igrr modified the milestones: 2.2.0, 2.3.0 Apr 18, 2016
@igrr igrr modified the milestones: 2.3.0, 2.4.0 Jun 3, 2016
@devyte
Copy link
Collaborator

devyte commented Nov 20, 2017

@igrr exactly which SDK files should get the guards? Should I just add the guards to the files, or should there be some patch made to apply to newer versions in the future? I seem to remember you mentioning that you keep a set of patches somewhere...

@dannybackx
Copy link
Author

dannybackx commented Nov 20, 2017 via email

@igrr
Copy link
Member

igrr commented Dec 27, 2017

@devyte c++ guards should be added to all files in tools/sdk/include.

About updates to newer versions, don't worry about that for now. Changes have been fairly small recently and i was able to generate diffs from the SDK and apply them here, with minimal manual intervention. I'll document the process some time later.

@devyte devyte self-assigned this Dec 29, 2017
devyte added a commit that referenced this issue Dec 30, 2017
* Add extern C guard blocks to SDK header files #1352

* fixed some extern C blocks in core and libraries
@devyte
Copy link
Collaborator

devyte commented Dec 30, 2017

Closed via #4044 .

@devyte devyte closed this as completed Dec 30, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants