[Top][All Lists]

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

Re: do I need "ifdef HAVE_UNISTD_H" if I import unistd?

From: Eric Blake
Subject: Re: do I need "ifdef HAVE_UNISTD_H" if I import unistd?
Date: Mon, 16 May 2011 13:56:46 -0600
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv: Gecko/20110428 Fedora/3.1.10-1.fc14 Lightning/1.0b3pre Mnenhy/0.8.3 Thunderbird/3.1.10

On 05/16/2011 01:53 PM, Sam Steingold wrote:
> DIUC that if I include the sys_time & unistd modules, I can write
> #include <unistd.h>
> #include <sys/time.h>
> instead of
> #ifdef HAVE_SYS_TIME_H
>  #include <sys/time.h>
> #endif
> #ifdef HAVE_UNISTD_H
>   #include <unistd.h>
> #endif
> ??
> the same question for all the other headers...

Absolutely!  In fact, the maintainer-mode module includes the
sc_prohibit_always_true_header_tests to help you check for files where
you can unconditionally include headers guaranteed by gnulib replacements.

Eric Blake   address@hidden    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

reply via email to

[Prev in Thread] Current Thread [Next in Thread]