Include files are missing extern "C" for SDK prototypes

dkinzer
Posts: 52
Joined: Fri Jul 31, 2015 7:37 am

Include files are missing extern "C" for SDK prototypes

Postby dkinzer » Thu Aug 27, 2015 7:23 am

It is considered good form to wrap function prototypes for C-linkage routines thus

Code: Select all

#if defined(__cplusplus)
extern "C" {
#endif
/* place function prototypes here */
#if defined(__cplusplus)
}
#endif

Doing so simplifies using the SDK routines in C++ files. While it is true that we users can simply wrap the #includes with the same #ifdef, it is something that is expected to be present in professionally produced code.
Don Kinzer
Beaverton, OR, USA

ESP_Faye
Posts: 1646
Joined: Mon Oct 27, 2014 11:08 am

Re: Include files are missing extern "C" for SDK prototypes

Postby ESP_Faye » Thu Aug 27, 2015 9:02 pm

Hi,

Thanks for your valuable advice !

We will add it !

Who is online

Users browsing this forum: No registered users and 45 guests