Bug 103671

Summary: os_time.c:104:4: error: implicit declaration of function 'usleep' is invalid in C99
Product: Mesa Reporter: Vinson Lee <vlee>
Component: Mesa coreAssignee: mesa-dev
Status: RESOLVED FIXED QA Contact: mesa-dev
Severity: normal    
Priority: medium CC: jon.turney, maraeo, nhaehnle
Version: gitKeywords: regression
Hardware: x86-64 (AMD64)   
OS: Mac OS X (All)   
Whiteboard:
i915 platform: i915 features:

Description Vinson Lee 2017-11-10 16:44:58 UTC
mesa: e456d4def5cb0cff3c243c267dd08ac17042e9e4 (master 17.4.0-devel)

os_time.c:104:4: error: implicit declaration of function 'usleep' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
   usleep(usecs);
   ^
Comment 1 Jon Turney 2017-11-10 18:26:28 UTC
I guess this is fixed by 764f1e4d4509448797008c2b20956b31d8360ef0
Comment 2 Vinson Lee 2017-11-10 18:33:01 UTC
commit 764f1e4d4509448797008c2b20956b31d8360ef0
Author: Jon Turney <jon.turney@dronecode.org.uk>
Date:   Fri Nov 10 11:41:13 2017 +0000

    util: include unistd.h, which may be required for usleep prototype
    
    This seems to be dropped in 222a2fb9 "util: move os_time.[ch] to src/util"
    
    ../../../src/util/os_time.c: In function ‘os_time_sleep’:
    ../../../src/util/os_time.c:104:4: error: implicit declaration of function ‘usleep’ [-Werror=implicit-function-declaration]
    
    Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
    Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.