[Mesa-dev] [PATCH v2 01/26] util: move os_time.[ch] to src/util

Jon Turney jon.turney at dronecode.org.uk
Fri Nov 10 12:35:04 UTC 2017


On 06/11/2017 10:23, Nicolai Hähnle wrote:
> diff --git a/src/gallium/auxiliary/os/os_time.h b/src/util/os_time.h
> similarity index 89%
> rename from src/gallium/auxiliary/os/os_time.h
> rename to src/util/os_time.h
> index ca0bdd5a0c4..049ab118db2 100644
> --- a/src/gallium/auxiliary/os/os_time.h
> +++ b/src/util/os_time.h
> @@ -28,34 +28,29 @@
>   /**
>    * @file
>    * OS independent time-manipulation functions.
>    *
>    * @author Jose Fonseca <jfonseca at vmware.com>
>    */
>   
>   #ifndef _OS_TIME_H_
>   #define _OS_TIME_H_
>   
> -
> -#include "pipe/p_config.h"
> -
> -#if defined(PIPE_OS_UNIX)
> -#  include <unistd.h> /* usleep */
> -#endif
> -
> -#include "pipe/p_compiler.h"
> -
> +#include <stdbool.h>
> +#include <stdint.h>
>   
>   #ifdef __cplusplus
>   extern "C" {
>   #endif

This patch seems to drop the include of unistd.h, which may be needed 
for usleep() prototype.

(See http://dronecode.duckdns.org:8010/builders/mesa-mesa/builds/5790)

Patch attached.
-------------- next part --------------
From a186f46272c9677f9c33764cbd9d8dc9d442b473 Mon Sep 17 00:00:00 2001
From: Jon Turney <jon.turney at dronecode.org.uk>
Date: Fri, 10 Nov 2017 11:41:13 +0000
Subject: [PATCH] util: include unistd.h, which may be required for usleep
 prototype
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

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 at dronecode.org.uk>
---
 src/util/os_time.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/util/os_time.c b/src/util/os_time.c
index 8d8291ff173..72dc7e49c0e 100644
--- a/src/util/os_time.c
+++ b/src/util/os_time.c
@@ -40,6 +40,7 @@
 #include "util/u_atomic.h"
 
 #if defined(PIPE_OS_UNIX)
+#  include <unistd.h> /* usleep */
 #  include <time.h> /* timeval */
 #  include <sys/time.h> /* timeval */
 #  include <sched.h> /* sched_yield */
-- 
2.15.0



More information about the mesa-dev mailing list