[sane-devel] sane.h misses extern "C"
Mattias Ellert
mattias.ellert@tsl.uu.se
Mon, 12 Jul 2004 20:17:27 +0200
This is a cryptographically signed message in MIME format.
--------------ms040602050803040803090604
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
Henning Meier-Geinitz wrote:
> Hi,
>
>>Is there a good reason why the installed sane.h misses the usual
>>header lines needed for compilation with C++?
>
> Well, it's a C and not a C++ header and these #ifdefs are ugly :-)
If you put them in the header file you only need them once. Since they
are not in the header files you have to do
extern "C" {
#include <sane/sane.h>
}
in every c++ file. I think this is more "ugly". Having the extern
declaration in one single place (i.e. in the header file) makes so much
more sense than having to put in in every single file where you include it.
You don't have to do this kind of hack for normal system header files.
Almost all other header files have the extern "C" declaration (or the
equivalent __BEGIN_DECLS __END_DECLS pair).
> Isn't it a better solution to use the extern "C" when including the
> file in the C++ .C code if you really want to use sane.h in C++? Or do
> we get trouble this way because it includes the structs?
I think having them in the header file is "the better solution".
>>May I just commit them to CVS?
I would say YES.
> Please wait some time before doing that. Maybe someone else can tell
> us real reasons not to use the extern "C" stuff.
>
> Bye,
> Henning
Mattias
--
________________________________________________________________________
mattias.ellert@tsl.uu.se tel: +46 18 471 32 58
http://www.tsl.uu.se/~ellert/ fax: +46 18 471 35 13
________________________________________________________________________
--------------ms040602050803040803090604
Content-Type: application/x-pkcs7-signature; name="smime.p7s"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="smime.p7s"
Content-Description: S/MIME Cryptographic Signature
MIAGCSqGSIb3DQEHAqCAMIACAQExCzAJBgUrDgMCGgUAMIAGCSqGSIb3DQEHAQAAoIIGbDCC
AzIwggKboAMCAQICAgJ2MA0GCSqGSIb3DQEBBAUAME8xDTALBgNVBAoTBEdyaWQxEjAQBgNV
BAoTCU5vcmR1R3JpZDEqMCgGA1UEAxMhTm9yZHVHcmlkIENlcnRpZmljYXRpb24gQXV0aG9y
aXR5MB4XDTA0MDUwNDE0MjY0MVoXDTA1MDUwNDE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