Bug 1178 - libsmbclient.h doesn't contain extern "C" wrapper around function prototypes.
Summary: libsmbclient.h doesn't contain extern "C" wrapper around function prototypes.
Alias: None
Product: Samba 3.0
Classification: Unclassified
Component: libsmbclient (show other bugs)
Version: 3.0.2a
Hardware: All Linux
: P3 enhancement
Target Milestone: none
Assignee: Tim Potter
QA Contact:
Depends on:
Reported: 2004-03-11 09:01 UTC by Steven McClellan
Modified: 2005-08-24 10:26 UTC (History)
0 users

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description Steven McClellan 2004-03-11 09:01:17 UTC
The libsmbclient.h doesn't contain extern "C" wrapper(s) around function 
prototypes and consequently doesn't allow C++ program to link to 
libsmbclient.so shared library.  Consequently a

#ifdef __cplusplus
extern "C" {

int smbc_init(smbc_get_auth_data_fn fn, int debug);

#ifdef __cplusplus

must be added in order to make it work for C++.
Comment 1 Tim Potter 2004-03-12 02:17:07 UTC
Can't you add the extern "C" bit around the #include instead?
Comment 2 Tim Potter 2004-03-12 02:17:30 UTC
add cc
Comment 3 Gerald (Jerry) Carter (dead mail address) 2004-03-12 06:24:22 UTC
Steve, please make sure to include responses in 
bugzilla rather than responding to the email 
notifications directly.  Thanks.   --jerry

> Yes, but most libraries that I have been using 
> from various sources have them in the header, so at 
> least this should be considered, or perhaps a
> documentation change for the libsmbclient examples 
> would be in order.
Comment 4 Richard Sharpe 2004-05-08 17:59:14 UTC
OK, perhaps I should add these to the include file.
Comment 5 Richard Sharpe 2004-05-08 21:19:13 UTC
OK, I think I have done the right thing here. Revision 599. Can someone check
that it is correct?
Comment 6 Jelmer Vernooij 2005-03-20 06:38:08 UTC

#ifdef __cplusplus
extern "C" {

is only necessary on top of the file, not before every function
Comment 7 Tim Potter 2005-03-20 14:53:56 UTC
Changed to include only one C++ guard.  I think this can be closed now!
Comment 8 Gerald (Jerry) Carter (dead mail address) 2005-08-24 10:26:27 UTC
sorry for the same, cleaning up the database to prevent unecessary reopens of bugs.