Re: [PATCH 1/1] support libnl-3 (v2)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 05/03/2012 11:55 AM, Stefan Berger wrote:
>>
>> +#ifdef HAVE_LIBNL1
>> +#define nl_alloc nl_handle_alloc
>> +#define nl_free nl_handle_destroy
>> +typedef struct nl_handle nlhandle_t;
>> +#else
>> +#define nl_alloc nl_socket_alloc
>> +#define nl_free nl_socket_free
>> +typedef struct nl_sock nlhandle_t;
>> +#endif
>> +
> 
> I would not #define in the namespace of that library (nl_*).

Agreed that a vir* namespace is safer.

> What about
> the following:

> #ifdef HAVE_LIBNL1
> 
> static struct nl_handle *
> virNLHandleAlloc(void)
> {
>     return nl_handle_alloc();
> }

One further:

typedef struct nl_handle virNLHandle;

static virNLHandle *
virNLHandleAlloc(void) ...

so that the rest of the code is indeed isolated into virNL wrappers with
no additional #ifdefs.

-- 
Eric Blake   eblake@xxxxxxxxxx    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]