[Spice-devel] [PATCH libcacard 3/3] libcacard: add G_BEGIN/END_DECLS

Eduardo Lima (Etrunko) etrunko at redhat.com
Thu Nov 19 12:58:50 PST 2015


On 11/19/2015 02:58 PM, Marc-André Lureau wrote:
> 
> 
> ----- Original Message -----
>> On 11/19/2015 02:25 PM, Marc-André Lureau wrote:
>>>
>>>
>>> ----- Original Message -----
>>>> On 11/19/2015 02:00 PM, Marc-André Lureau wrote:
>>>>>
>>>>>
>>>>> ----- Original Message -----
>>>>>> On 11/19/2015 10:30 AM, Marc-André Lureau wrote:
>>>>>>> If the compiler in use is a C++ compiler, adds extern "C" around the
>>>>>>> header.
>>>>>>>
>>>>>>> Signed-off-by: Marc-André Lureau <marcandre.lureau at gmail.com>
>>>>>>> ---
>>>>>>>  src/libcacard.h | 6 ++++++
>>>>>>>  1 file changed, 6 insertions(+)
>>>>>>>
>>>>>>> diff --git a/src/libcacard.h b/src/libcacard.h
>>>>>>> index 0770d13..2b2082e 100644
>>>>>>> --- a/src/libcacard.h
>>>>>>> +++ b/src/libcacard.h
>>>>>>> @@ -5,6 +5,10 @@
>>>>>>>  #ifndef LIBCACARD_H
>>>>>>>  #define LIBCACARD_H
>>>>>>>  
>>>>>>> +#include <glib.h>
>>>>>>> +
>>>>>>
>>>>>> I guess this glib.h include shouldn't be here.
>>>>>
>>>>> Why? (need more coffee?)
>>>>
>>>> Well, it might as well be a convention on the project, but in my opinion
>>>> it should only include files from the project itself. For instance, you
>>>> don't have a glib.h include in gtk.h
>>>
>>> It doesn't make much difference. libcacard depends on glib anyway.
>>>  And the fact is some header use glib macro is enough to include glib.
>>>
>>> How would you provide a library that would use glib type for ex, otherwise?
>>>
>>> Sure we can replace the glib macros with our own to avoid glib.h inclusion,
>>> but what's the point here?
>>>
>>
>> My point was not to include glib.h in the "high level" include file
>> which is libcacard.h, but in any other files that require glib.h, even
>> though it means every one of them.
> 
> I added glib.h in src/vscard_common.h for direct include usage.
> 
> I added glib.h in src/libcacard.h for G_BEGIN/END_DECLS macros
> 

Oh yes, now it makes sense to me. Thank you.


-- 
Eduardo de Barros Lima (Etrunko)
Software Engineer - RedHat
etrunko at redhat.com


More information about the Spice-devel mailing list