A small patch for C++ VFS modules.

Stefan (metze) Metzmacher metze at samba.org
Sat Jun 25 07:24:30 GMT 2005


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Ben Martin schrieb:
> On Fri, 2005-06-24 at 13:26 -0700, Jeremy Allison wrote:
> 
>>On Fri, Jun 24, 2005 at 11:23:40AM +1000, Ben Martin wrote:
>>
>>>OK, I had started doing it this way and reverted to header only. I'm
>>>happy to resubmit with the more intrusive versions. 
>>
>>You shouldn't need to. In order to make it easier for people to write
>>modules in C++ I've fixed our headers and code to make it C++ friendly.
>>
>>Checkout SAMBA_3_0 svn and please let me know it I missed anything.
>>
>>Jeremy.
> 
> 
> Excellent stuff! 
> 
> One minor thing: include/smb_acls.h 
> 
> .../source/include/smb_acls.h:262: error: conflicting declaration 'typedef struct SMB_ACL_T* SMB_ACL_T'
> .../source/include/smb_acls.h:260: error: 'struct SMB_ACL_T' has a previous declaration as 'struct SMB_ACL_T'
> .../source/include/smb_acls.h:266: error: conflicting declaration 'typedef struct SMB_ACL_ENTRY_T* SMB_ACL_ENTRY_T'
> .../source/include/smb_acls.h:264: error: 'struct SMB_ACL_ENTRY_T' has a previous declaration as 'struct SMB_ACL_ENTRY 
> 
> C++ seems to think that you are typedef'ing a pointer to the struct to
> be the same as the struct itself. Once these are guarded like the below
> then all is well, though there is probably a much cleaner way to do
> this. For my C++ eyes it does appear the typedef as it stands is rather
> self referential.
> 
> #ifdef __cplusplus
> typedef struct {
> #else
> typedef struct SMB_ACL_T {
> #endif
> 	int dummy;
> } *SMB_ACL_T;
> 
> #ifdef __cplusplus
>     typedef struct {
> #else
>     typedef struct SMB_ACL_ENTRY_T {
> #endif
> 	int dummy;
> } *SMB_ACL_ENTRY_T;
> 

I do we need this ugly ifdef's?

wouldn't be this fine by c-compilers too:

     typedef struct {
 	int dummy;
 } *SMB_ACL_ENTRY_T;

- --
metze

Stefan Metzmacher <metze at samba.org> www.samba.org
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3-nr1 (Windows XP)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFCvQatm70gjA5TCD8RAj2AAKCYHal8+xAJnpsgL1LkB2gEqvdMFACeKQFT
RiCA1pdHKlT/OkTRlNaPHN0=
=v9oS
-----END PGP SIGNATURE-----


More information about the samba-technical mailing list